diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_string.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index dc76b53810..0fd0538d00 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -444,6 +444,14 @@ CODE s = S("").freeze assert_raise_with_message(RuntimeError, /frozen/) {s.chomp!} + + s = S("ax") + o = Struct.new(:s).new(s) + def o.to_str + s.freeze + "x" + end + assert_raise_with_message(RuntimeError, /frozen/) {s.chomp!(o)} ensure $/ = save end |