diff options
Diffstat (limited to 'spec/ruby/core/string/sub_spec.rb')
-rw-r--r-- | spec/ruby/core/string/sub_spec.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/ruby/core/string/sub_spec.rb b/spec/ruby/core/string/sub_spec.rb index f240cd8cff..80cf8622d5 100644 --- a/spec/ruby/core/string/sub_spec.rb +++ b/spec/ruby/core/string/sub_spec.rb @@ -148,14 +148,14 @@ describe "String#sub with pattern, replacement" do hello_t.taint; a_t.taint; empty_t.taint - hello_t.sub(/./, a).tainted?.should == true - hello_t.sub(/./, empty).tainted?.should == true + hello_t.sub(/./, a).should.tainted? + hello_t.sub(/./, empty).should.tainted? - hello.sub(/./, a_t).tainted?.should == true - hello.sub(/./, empty_t).tainted?.should == true - hello.sub(//, empty_t).tainted?.should == true + hello.sub(/./, a_t).should.tainted? + hello.sub(/./, empty_t).should.tainted? + hello.sub(//, empty_t).should.tainted? - hello.sub(//.taint, "foo").tainted?.should == false + hello.sub(//.taint, "foo").should_not.tainted? end end @@ -298,14 +298,14 @@ describe "String#sub with pattern and block" do hello_t.taint; a_t.taint; empty_t.taint - hello_t.sub(/./) { a }.tainted?.should == true - hello_t.sub(/./) { empty }.tainted?.should == true + hello_t.sub(/./) { a }.should.tainted? + hello_t.sub(/./) { empty }.should.tainted? - hello.sub(/./) { a_t }.tainted?.should == true - hello.sub(/./) { empty_t }.tainted?.should == true - hello.sub(//) { empty_t }.tainted?.should == true + hello.sub(/./) { a_t }.should.tainted? + hello.sub(/./) { empty_t }.should.tainted? + hello.sub(//) { empty_t }.should.tainted? - hello.sub(//.taint) { "foo" }.tainted?.should == false + hello.sub(//.taint) { "foo" }.should_not.tainted? end end end @@ -320,8 +320,8 @@ describe "String#sub! with pattern, replacement" do ruby_version_is ''...'2.7' do it "taints self if replacement is tainted" do a = "hello" - a.sub!(/./.taint, "foo").tainted?.should == false - a.sub!(/./, "foo".taint).tainted?.should == true + a.sub!(/./.taint, "foo").should_not.tainted? + a.sub!(/./, "foo".taint).should.tainted? end end @@ -370,8 +370,8 @@ describe "String#sub! with pattern and block" do ruby_version_is ''...'2.7' do it "taints self if block's result is tainted" do a = "hello" - a.sub!(/./.taint) { "foo" }.tainted?.should == false - a.sub!(/./) { "foo".taint }.tainted?.should == true + a.sub!(/./.taint) { "foo" }.should_not.tainted? + a.sub!(/./) { "foo".taint }.should.tainted? end end |