diff options
Diffstat (limited to 'spec/ruby/core/string/ljust_spec.rb')
-rw-r--r-- | spec/ruby/core/string/ljust_spec.rb | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/spec/ruby/core/string/ljust_spec.rb b/spec/ruby/core/string/ljust_spec.rb index ed4cb86859..f377e39775 100644 --- a/spec/ruby/core/string/ljust_spec.rb +++ b/spec/ruby/core/string/ljust_spec.rb @@ -31,12 +31,14 @@ describe "String#ljust with length, padding" do "radiology".ljust(8, '-').should == "radiology" end - it "taints result when self or padstr is tainted" do - "x".taint.ljust(4).tainted?.should == true - "x".taint.ljust(0).tainted?.should == true - "".taint.ljust(0).tainted?.should == true - "x".taint.ljust(4, "*").tainted?.should == true - "x".ljust(4, "*".taint).tainted?.should == true + ruby_version_is ''...'2.7' do + it "taints result when self or padstr is tainted" do + "x".taint.ljust(4).tainted?.should == true + "x".taint.ljust(0).tainted?.should == true + "".taint.ljust(0).tainted?.should == true + "x".taint.ljust(4, "*").tainted?.should == true + "x".ljust(4, "*".taint).tainted?.should == true + end end it "tries to convert length to an integer using to_int" do @@ -81,10 +83,12 @@ describe "String#ljust with length, padding" do "foo".ljust(10, StringSpecs::MyString.new("x")).should be_an_instance_of(String) end - it "when padding is tainted and self is untainted returns a tainted string if and only if length is longer than self" do - "hello".ljust(4, 'X'.taint).tainted?.should be_false - "hello".ljust(5, 'X'.taint).tainted?.should be_false - "hello".ljust(6, 'X'.taint).tainted?.should be_true + ruby_version_is ''...'2.7' do + it "when padding is tainted and self is untainted returns a tainted string if and only if length is longer than self" do + "hello".ljust(4, 'X'.taint).tainted?.should be_false + "hello".ljust(5, 'X'.taint).tainted?.should be_false + "hello".ljust(6, 'X'.taint).tainted?.should be_true + end end describe "with width" do |