diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-01 17:08:59 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-01 17:08:59 +0000 |
commit | d9e7246bbebd01ea7ed6c4ae5cb68bb2d2bcab16 (patch) | |
tree | 75b3586f2b174cb1ef83898749e741208a310ce6 /spec/rubyspec/core/file | |
parent | 4466f88e0e6729b2d6f152c4f712afa50c0729e5 (diff) | |
download | ruby-d9e7246bbebd01ea7ed6c4ae5cb68bb2d2bcab16.tar.gz |
Create the file in the File::TMPFILE spec in its own directory
* Avoids failing the spec if rubyspec_temp is not empty.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/rubyspec/core/file')
-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 |