summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-01 17:08:59 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-01 17:08:59 +0000
commit59609c547d7990ac092b0219d273bdbf10bbd4f6 (patch)
tree75b3586f2b174cb1ef83898749e741208a310ce6 /spec
parent51a38a24014e35126714e08e3c58a2d696e3ee66 (diff)
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')
-rw-r--r--spec/rubyspec/core/file/open_spec.rb8
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