diff options
Diffstat (limited to 'spec/ruby/core/matchdata/regexp_spec.rb')
-rw-r--r-- | spec/ruby/core/matchdata/regexp_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ruby/core/matchdata/regexp_spec.rb b/spec/ruby/core/matchdata/regexp_spec.rb index 05a8e80567..7a4783434c 100644 --- a/spec/ruby/core/matchdata/regexp_spec.rb +++ b/spec/ruby/core/matchdata/regexp_spec.rb @@ -10,4 +10,9 @@ describe "MatchData#regexp" do m = 'haystack'.match(/hay/) m.regexp.should == /hay/ end + + it "returns a Regexp for the result of gsub(String)" do + 'he[[o'.gsub('[', ']') + $~.regexp.should == /\[/ + end end |