diff options
Diffstat (limited to 'spec/rubyspec')
-rw-r--r-- | spec/rubyspec/core/file/open_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/rubyspec/core/file/open_spec.rb b/spec/rubyspec/core/file/open_spec.rb index 09b1cb6add..440921a796 100644 --- a/spec/rubyspec/core/file/open_spec.rb +++ b/spec/rubyspec/core/file/open_spec.rb @@ -522,10 +522,10 @@ describe "File.open" do platform_is :linux do if defined?(File::TMPFILE) it "creates an unnamed temporary file with File::TMPFILE" do - dir = tmp("").chomp("/") - rm_r @file - Dir["#{dir}/*"].should == [] + dir = tmp("tmpfilespec") + mkdir_p dir begin + Dir["#{dir}/*"].should == [] File.open(dir, "r+", flags: File::TMPFILE) do |io| io.write("ruby") io.flush @@ -537,6 +537,8 @@ describe "File.open" do # EOPNOTSUPP: no support from the filesystem # EINVAL: presumably bug in glibc 1.should == 1 + ensure + rm_r dir end end end |