diff options
Diffstat (limited to 'spec/ruby/library/stringio/reopen_spec.rb')
-rw-r--r-- | spec/ruby/library/stringio/reopen_spec.rb | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/spec/ruby/library/stringio/reopen_spec.rb b/spec/ruby/library/stringio/reopen_spec.rb index 6b5bdb57a1..32bf13dd6d 100644 --- a/spec/ruby/library/stringio/reopen_spec.rb +++ b/spec/ruby/library/stringio/reopen_spec.rb @@ -202,9 +202,11 @@ describe "StringIO#reopen when passed [Object]" do end # NOTE: WEIRD! - it "taints self when the passed Object was tainted" do - @io.reopen(StringIO.new("reopened").taint) - @io.tainted?.should be_true + ruby_version_is ""..."2.7" + it "taints self when the passed Object was tainted" do + @io.reopen(StringIO.new("reopened").taint) + @io.tainted?.should be_true + end end end @@ -270,11 +272,13 @@ describe "StringIO#reopen" do str.should == '' end - it "taints self if the provided StringIO argument is tainted" do - new_io = StringIO.new("tainted") - new_io.taint - @io.reopen(new_io) - @io.tainted?.should == true + ruby_version_is ""..."2.7" + it "taints self if the provided StringIO argument is tainted" do + new_io = StringIO.new("tainted") + new_io.taint + @io.reopen(new_io) + @io.tainted?.should == true + end end it "does not truncate the content even when the StringIO argument is in the truncate mode" do |