1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2021-10-05 19:41:44 +02:00
parent afcbb501ac
commit b9f34062f0
28 changed files with 692 additions and 31 deletions

View file

@ -10,6 +10,22 @@ describe "String#reverse" do
"".reverse.should == ""
end
ruby_version_is '3.0' do
it "returns String instances when called on a subclass" do
StringSpecs::MyString.new("stressed").reverse.should be_an_instance_of(String)
StringSpecs::MyString.new("m").reverse.should be_an_instance_of(String)
StringSpecs::MyString.new("").reverse.should be_an_instance_of(String)
end
end
ruby_version_is ''...'3.0' do
it "returns subclass instances when called on a subclass" do
StringSpecs::MyString.new("stressed").reverse.should be_an_instance_of(StringSpecs::MyString)
StringSpecs::MyString.new("m").reverse.should be_an_instance_of(StringSpecs::MyString)
StringSpecs::MyString.new("").reverse.should be_an_instance_of(StringSpecs::MyString)
end
end
ruby_version_is ''...'2.7' do
it "taints the result if self is tainted" do
"".taint.reverse.should.tainted?
@ -20,7 +36,6 @@ describe "String#reverse" do
it "reverses a string with multi byte characters" do
"微軟正黑體".reverse.should == "體黑正軟微"
end
end
describe "String#reverse!" do