diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-09 20:52:48 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-09 21:10:48 +0900 |
commit | b194973dcd5eda6c9e256029ea39dc532ae18962 (patch) | |
tree | 30ebee5b13e2c3511ab3a41fc6219a779d89ad8f /spec/ruby/library | |
parent | 6997109fcaef0567f176e53dfc092aecc49f9ece (diff) |
Revert the related commits about `Tempfile.open` change.
Start with https://github.com/ruby/ruby/commit/fa21985a7a2f8f52a8bd82bd12a724e9dca74934
to https://github.com/ruby/ruby/commit/d7492a0be885ea9f2b9f71e3e95582f9a859c439
Diffstat (limited to 'spec/ruby/library')
-rw-r--r-- | spec/ruby/library/tempfile/open_spec.rb | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/spec/ruby/library/tempfile/open_spec.rb b/spec/ruby/library/tempfile/open_spec.rb index dabbe92a8a..ef2c95376f 100644 --- a/spec/ruby/library/tempfile/open_spec.rb +++ b/spec/ruby/library/tempfile/open_spec.rb @@ -38,10 +38,8 @@ describe "Tempfile.open" do end it "is passed an array [base, suffix] as first argument" do - Tempfile.open(["specs", ".tt"]) { |tempfile| - @tempfile = tempfile - tempfile.path.should =~ /specs.*\.tt$/ - } + Tempfile.open(["specs", ".tt"]) { |tempfile| @tempfile = tempfile } + @tempfile.path.should =~ /specs.*\.tt$/ end it "passes the third argument (options) to open" do @@ -67,7 +65,7 @@ describe "Tempfile.open when passed a block" do end after :each do - # Tempfile.open with block does not unlink in Ruby <= 2.7 + # Tempfile.open with block does not unlink @tempfile.close! if @tempfile end @@ -96,24 +94,4 @@ describe "Tempfile.open when passed a block" do Tempfile.open("specs") { |tempfile| @tempfile = tempfile } @tempfile.closed?.should be_true end - - ruby_version_is ""..."2.8" do - it "does not unlink the file after the block ends" do - path = Tempfile.open("specs") { |tempfile| - @tempfile = tempfile - tempfile.path - } - File.should.exist?(path) - end - end - - ruby_version_is "2.8" do - it "unlinks the file after the block ends" do - path = Tempfile.open("specs") { |tempfile| - @tempfile = tempfile - tempfile.path - } - File.should_not.exist?(path) - end - end end |