diff options
author | Benoit Daloze <eregontp@gmail.com> | 2021-11-29 15:50:28 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2021-11-29 15:50:28 +0100 |
commit | 67a1e2258974df4b597d019739595c18fbb9a7c1 (patch) | |
tree | 992ad4fc0fc08a6af8f04373703a339f957eb143 /spec/ruby/core/matchdata/to_s_spec.rb | |
parent | e6d93a27afa058319e6dad093bbef637e49fce47 (diff) |
Update to ruby/spec@7f22a0b
Diffstat (limited to 'spec/ruby/core/matchdata/to_s_spec.rb')
-rw-r--r-- | spec/ruby/core/matchdata/to_s_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/core/matchdata/to_s_spec.rb b/spec/ruby/core/matchdata/to_s_spec.rb index 9e213bb342..aab0955ae1 100644 --- a/spec/ruby/core/matchdata/to_s_spec.rb +++ b/spec/ruby/core/matchdata/to_s_spec.rb @@ -1,7 +1,15 @@ require_relative '../../spec_helper' +require_relative 'fixtures/classes' describe "MatchData#to_s" do it "returns the entire matched string" do /(.)(.)(\d+)(\d)/.match("THX1138.").to_s.should == "HX1138" end + + ruby_version_is "3.0" do + it "returns an instance of String when given a String subclass" do + str = MatchDataSpecs::MyString.new("THX1138.") + /(.)(.)(\d+)(\d)/.match(str).to_s.should be_an_instance_of(String) + end + end end |