diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-24 18:08:15 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-24 18:08:15 +0000 |
commit | e565c838ce2f70f7f632aa0b728430fe195357fb (patch) | |
tree | 6e60acf1dff6953a87fc6ccb61137c962feac16f /test/ostruct | |
parent | e077e7956a63cbe266368d034fa76a35020cf78e (diff) |
lib/ostruct.rb: Use frozen literals.
Patch adapted from Espartaco Palma. [GH-1714] [Bug #14000]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ostruct')
-rw-r--r-- | test/ostruct/test_ostruct.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index 32eb73a89d..24ffb77380 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -52,12 +52,14 @@ class TC_OpenStruct < Test::Unit::TestCase foo.bar = 1 foo.baz = 2 assert_equal("#<OpenStruct bar=1, baz=2>", foo.inspect) + assert_equal(false, foo.inspect.frozen?) foo = OpenStruct.new foo.bar = OpenStruct.new assert_equal('#<OpenStruct bar=#<OpenStruct>>', foo.inspect) foo.bar.foo = foo assert_equal('#<OpenStruct bar=#<OpenStruct foo=#<OpenStruct ...>>>', foo.inspect) + assert_equal(false, foo.inspect.frozen?) end def test_frozen |