diff options
Diffstat (limited to 'spec/ruby/core/matchdata/element_reference_spec.rb')
-rw-r--r-- | spec/ruby/core/matchdata/element_reference_spec.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/spec/ruby/core/matchdata/element_reference_spec.rb b/spec/ruby/core/matchdata/element_reference_spec.rb index 0e0d3991cb..806db2d7b5 100644 --- a/spec/ruby/core/matchdata/element_reference_spec.rb +++ b/spec/ruby/core/matchdata/element_reference_spec.rb @@ -48,11 +48,9 @@ describe "MatchData#[]" do /(.)(.)(\d+)(\d)/.match("THX1138.")[nil..nil].should == %w|HX1138 H X 113 8| end - ruby_version_is "3.0" do - it "returns instances of String when given a String subclass" do - str = MatchDataSpecs::MyString.new("THX1138.") - /(.)(.)(\d+)(\d)/.match(str)[0..-1].each { |m| m.should be_an_instance_of(String) } - end + it "returns instances of String when given a String subclass" do + str = MatchDataSpecs::MyString.new("THX1138.") + /(.)(.)(\d+)(\d)/.match(str)[0..-1].each { |m| m.should be_an_instance_of(String) } end end @@ -115,7 +113,7 @@ describe "MatchData#[Symbol]" do it "returns matches in the String's encoding" do rex = /(?<t>t(?<a>ack))/u - md = 'haystack'.force_encoding('euc-jp').match(rex) + md = 'haystack'.dup.force_encoding('euc-jp').match(rex) md[:t].encoding.should == Encoding::EUC_JP end end |