diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-01 17:27:38 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-01 17:27:38 +0000 |
commit | 9543908c9f2f6322117627f9c7a4a5699c9158d9 (patch) | |
tree | 39520e93bcd71a5482ba12f5f3fea6ab690f1d46 /test/ostruct | |
parent | 428fe14f5e5077a615bf4338f3fd88a5cbd322eb (diff) |
* lib/ostruct.rb: Fix case of frozen object with initializer.
Bug revealed by RubySpec [ruby-core:72639]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ostruct')
-rw-r--r-- | test/ostruct/test_ostruct.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index 02c4c74152..8b9b647720 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -61,13 +61,14 @@ class TC_OpenStruct < Test::Unit::TestCase end def test_frozen - o = OpenStruct.new + o = OpenStruct.new(foo: 42) o.a = 'a' o.freeze assert_raise(RuntimeError) {o.b = 'b'} assert_not_respond_to(o, :b) assert_raise(RuntimeError) {o.a = 'z'} assert_equal('a', o.a) + assert_equal(42, o.foo) o = OpenStruct.new :a => 42 def o.frozen?; nil end o.freeze |