mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@3affe1e
This commit is contained in:
parent
6ae81d49b5
commit
45cf4f2187
277 changed files with 3844 additions and 7624 deletions
|
@ -40,12 +40,6 @@ describe "String#chomp" do
|
|||
"".chomp.should == ""
|
||||
end
|
||||
|
||||
ruby_version_is ''...'2.7' do
|
||||
it "taints the result if self is tainted" do
|
||||
"abc".taint.chomp.tainted?.should be_true
|
||||
end
|
||||
end
|
||||
|
||||
ruby_version_is ''...'3.0' do
|
||||
it "returns subclass instances when called on a subclass" do
|
||||
str = StringSpecs::MyString.new("hello\n").chomp
|
||||
|
@ -80,12 +74,6 @@ describe "String#chomp" do
|
|||
str.chomp(nil).should_not equal(str)
|
||||
end
|
||||
|
||||
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
|
||||
"".chomp(nil).should == ""
|
||||
end
|
||||
|
@ -112,12 +100,6 @@ describe "String#chomp" do
|
|||
"abc\r\n\r\n\r\n".chomp("").should == "abc"
|
||||
end
|
||||
|
||||
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
|
||||
"".chomp("").should == ""
|
||||
end
|
||||
|
@ -140,12 +122,6 @@ describe "String#chomp" do
|
|||
"abc\r\n\r\n".chomp("\n").should == "abc\r\n"
|
||||
end
|
||||
|
||||
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
|
||||
"".chomp("\n").should == ""
|
||||
end
|
||||
|
@ -178,16 +154,6 @@ describe "String#chomp" do
|
|||
"".chomp("abc").should == ""
|
||||
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
|
||||
end
|
||||
end
|
||||
|
||||
it "returns an empty String when the argument equals self" do
|
||||
"abc".chomp("abc").should == ""
|
||||
end
|
||||
|
@ -232,12 +198,6 @@ describe "String#chomp!" do
|
|||
"".chomp!.should be_nil
|
||||
end
|
||||
|
||||
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
|
||||
str = StringSpecs::MyString.new("hello\n").chomp!
|
||||
str.should be_an_instance_of(StringSpecs::MyString)
|
||||
|
@ -280,12 +240,6 @@ describe "String#chomp!" do
|
|||
"abc\r\n\r\n\r\n".chomp!("").should == "abc"
|
||||
end
|
||||
|
||||
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
|
||||
"".chomp!("").should be_nil
|
||||
end
|
||||
|
@ -304,12 +258,6 @@ describe "String#chomp!" do
|
|||
"abc\r\n\r\n".chomp!("\n").should == "abc\r\n"
|
||||
end
|
||||
|
||||
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
|
||||
"".chomp!("\n").should be_nil
|
||||
end
|
||||
|
@ -341,16 +289,6 @@ describe "String#chomp!" do
|
|||
it "returns nil when self is empty" do
|
||||
"".chomp!("abc").should be_nil
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
it "raises a FrozenError on a frozen instance when it is modified" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue