ruby-changes:46877
From: eregon <ko1@a...>
Date: Fri, 2 Jun 2017 02:09:03 +0900 (JST)
Subject: [ruby-changes:46877] eregon:r58992 (trunk): Create the file in the File::TMPFILE spec in its own directory
eregon 2017-06-02 02:08:59 +0900 (Fri, 02 Jun 2017) New Revision: 58992 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58992 Log: Create the file in the File::TMPFILE spec in its own directory * Avoids failing the spec if rubyspec_temp is not empty. Modified files: trunk/spec/rubyspec/core/file/open_spec.rb Index: spec/rubyspec/core/file/open_spec.rb =================================================================== --- spec/rubyspec/core/file/open_spec.rb (revision 58991) +++ spec/rubyspec/core/file/open_spec.rb (revision 58992) @@ -522,10 +522,10 @@ describe "File.open" do https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/file/open_spec.rb#L522 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 https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/core/file/open_spec.rb#L537 # EOPNOTSUPP: no support from the filesystem # EINVAL: presumably bug in glibc 1.should == 1 + ensure + rm_r dir end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/