aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/string/chomp_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/chomp_spec.rb')
-rw-r--r--spec/ruby/core/string/chomp_spec.rb66
1 files changed, 42 insertions, 24 deletions
diff --git a/spec/ruby/core/string/chomp_spec.rb b/spec/ruby/core/string/chomp_spec.rb
index 9db47d1dc6..20a0925959 100644
--- a/spec/ruby/core/string/chomp_spec.rb
+++ b/spec/ruby/core/string/chomp_spec.rb
@@ -38,8 +38,10 @@ describe "String#chomp" do
"".chomp.should == ""
end
- it "taints the result if self is tainted" do
- "abc".taint.chomp.tainted?.should be_true
+ ruby_version_is ''...'2.7' do
+ it "taints the result if self is tainted" do
+ "abc".taint.chomp.tainted?.should be_true
+ end
end
it "returns subclass instances when called on a subclass" do
@@ -63,8 +65,10 @@ describe "String#chomp" do
str.chomp(nil).should_not equal(str)
end
- it "taints the result if self is tainted" do
- "abc".taint.chomp(nil).tainted?.should be_true
+ ruby_version_is ''...'2.7' do
+ it "taints the result if self is tainted" do
+ "abc".taint.chomp(nil).tainted?.should be_true
+ end
end
it "returns an empty String when self is empty" do
@@ -93,8 +97,10 @@ describe "String#chomp" do
"abc\r\n\r\n\r\n".chomp("").should == "abc"
end
- it "taints the result if self is tainted" do
- "abc".taint.chomp("").tainted?.should be_true
+ ruby_version_is ''...'2.7' do
+ it "taints the result if self is tainted" do
+ "abc".taint.chomp("").tainted?.should be_true
+ end
end
it "returns an empty String when self is empty" do
@@ -115,8 +121,10 @@ describe "String#chomp" do
"abc\r\n\r\n".chomp("\n").should == "abc\r\n"
end
- it "taints the result if self is tainted" do
- "abc".taint.chomp("\n").tainted?.should be_true
+ ruby_version_is ''...'2.7' do
+ it "taints the result if self is tainted" do
+ "abc".taint.chomp("\n").tainted?.should be_true
+ end
end
it "returns an empty String when self is empty" do
@@ -151,12 +159,14 @@ describe "String#chomp" do
"".chomp("abc").should == ""
end
- it "taints the result if self is tainted" do
- "abc".taint.chomp("abc").tainted?.should be_true
- end
+ ruby_version_is ''...'2.7' do
+ it "taints the result if self is tainted" do
+ "abc".taint.chomp("abc").tainted?.should be_true
+ end
- it "does not taint the result when the argument is tainted" do
- "abc".chomp("abc".taint).tainted?.should be_false
+ it "does not taint the result when the argument is tainted" do
+ "abc".chomp("abc".taint).tainted?.should be_false
+ end
end
it "returns an empty String when the argument equals self" do
@@ -201,8 +211,10 @@ describe "String#chomp!" do
"".chomp!.should be_nil
end
- it "taints the result if self is tainted" do
- "abc\n".taint.chomp!.tainted?.should be_true
+ ruby_version_is ''...'2.7' do
+ it "taints the result if self is tainted" do
+ "abc\n".taint.chomp!.tainted?.should be_true
+ end
end
it "returns subclass instances when called on a subclass" do
@@ -247,8 +259,10 @@ describe "String#chomp!" do
"abc\r\n\r\n\r\n".chomp!("").should == "abc"
end
- it "taints the result if self is tainted" do
- "abc\n".taint.chomp!("").tainted?.should be_true
+ ruby_version_is ''...'2.7' do
+ it "taints the result if self is tainted" do
+ "abc\n".taint.chomp!("").tainted?.should be_true
+ end
end
it "returns nil when self is empty" do
@@ -269,8 +283,10 @@ describe "String#chomp!" do
"abc\r\n\r\n".chomp!("\n").should == "abc\r\n"
end
- it "taints the result if self is tainted" do
- "abc\n".taint.chomp!("\n").tainted?.should be_true
+ ruby_version_is ''...'2.7' do
+ it "taints the result if self is tainted" do
+ "abc\n".taint.chomp!("\n").tainted?.should be_true
+ end
end
it "returns nil when self is empty" do
@@ -305,12 +321,14 @@ describe "String#chomp!" do
"".chomp!("abc").should be_nil
end
- it "taints the result if self is tainted" do
- "abc".taint.chomp!("abc").tainted?.should be_true
- end
+ ruby_version_is ''...'2.7' do
+ it "taints the result if self is tainted" do
+ "abc".taint.chomp!("abc").tainted?.should be_true
+ end
- it "does not taint the result when the argument is tainted" do
- "abc".chomp!("abc".taint).tainted?.should be_false
+ it "does not taint the result when the argument is tainted" do
+ "abc".chomp!("abc".taint).tainted?.should be_false
+ end
end
end