From 1243255c3a36433041012b6107a5ac48658a0895 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 30 Nov 2019 21:26:52 +0100 Subject: Update to ruby/spec@4eec3dc --- spec/ruby/core/matchdata/regexp_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/ruby/core/matchdata/regexp_spec.rb') diff --git a/spec/ruby/core/matchdata/regexp_spec.rb b/spec/ruby/core/matchdata/regexp_spec.rb index 7a4783434c..099b59c559 100644 --- a/spec/ruby/core/matchdata/regexp_spec.rb +++ b/spec/ruby/core/matchdata/regexp_spec.rb @@ -11,6 +11,12 @@ describe "MatchData#regexp" do m.regexp.should == /hay/ end + it "returns the same Regexp used to match" do + r = /hay/ + m = 'haystack'.match(r) + m.regexp.object_id.should == r.object_id + end + it "returns a Regexp for the result of gsub(String)" do 'he[[o'.gsub('[', ']') $~.regexp.should == /\[/ -- cgit v1.2.3