diff options
Diffstat (limited to 'spec/ruby/core/string/insert_spec.rb')
-rw-r--r-- | spec/ruby/core/string/insert_spec.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/spec/ruby/core/string/insert_spec.rb b/spec/ruby/core/string/insert_spec.rb index 588b8ab272..de7c12423a 100644 --- a/spec/ruby/core/string/insert_spec.rb +++ b/spec/ruby/core/string/insert_spec.rb @@ -41,14 +41,16 @@ describe "String#insert with index, other" do "abcd".insert(-3, other).should == "abXYZcd" end - it "taints self if string to insert is tainted" do - str = "abcd" - str.insert(0, "T".taint).tainted?.should == true - - str = "abcd" - other = mock('T') - def other.to_str() "T".taint end - str.insert(0, other).tainted?.should == true + ruby_version_is ''...'2.7' do + it "taints self if string to insert is tainted" do + str = "abcd" + str.insert(0, "T".taint).tainted?.should == true + + str = "abcd" + other = mock('T') + def other.to_str() "T".taint end + str.insert(0, other).tainted?.should == true + end end it "raises a TypeError if other can't be converted to string" do |