diff options
Diffstat (limited to 'spec/ruby/core/string/tr_s_spec.rb')
-rw-r--r-- | spec/ruby/core/string/tr_s_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/ruby/core/string/tr_s_spec.rb b/spec/ruby/core/string/tr_s_spec.rb index cdf5667ea3..c6ad12139e 100644 --- a/spec/ruby/core/string/tr_s_spec.rb +++ b/spec/ruby/core/string/tr_s_spec.rb @@ -45,8 +45,16 @@ describe "String#tr_s" do "bla".tr_s(from_str, to_str).should == "BlA" end - it "returns subclass instances when called on a subclass" do - StringSpecs::MyString.new("hello").tr_s("e", "a").should be_an_instance_of(StringSpecs::MyString) + ruby_version_is ''...'3.0' do + it "returns subclass instances when called on a subclass" do + StringSpecs::MyString.new("hello").tr_s("e", "a").should be_an_instance_of(StringSpecs::MyString) + end + end + + ruby_version_is '3.0' do + it "returns String instances when called on a subclass" do + StringSpecs::MyString.new("hello").tr_s("e", "a").should be_an_instance_of(String) + end end ruby_version_is ''...'2.7' do |