summaryrefslogtreecommitdiff
path: root/spec/ruby/core/matchdata/string_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/matchdata/string_spec.rb')
-rw-r--r--spec/ruby/core/matchdata/string_spec.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/ruby/core/matchdata/string_spec.rb b/spec/ruby/core/matchdata/string_spec.rb
index 420233e1f3..952e953318 100644
--- a/spec/ruby/core/matchdata/string_spec.rb
+++ b/spec/ruby/core/matchdata/string_spec.rb
@@ -17,8 +17,9 @@ describe "MatchData#string" do
md.string.should equal(md.string)
end
- it "returns a frozen copy of the matched string for gsub(String)" do
- 'he[[o'.gsub!('[', ']')
+ it "returns a frozen copy of the matched string for gsub!(String)" do
+ s = +'he[[o'
+ s.gsub!('[', ']')
$~.string.should == 'he[[o'
$~.string.should.frozen?
end