diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-27 05:23:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-27 05:23:10 +0000 |
commit | f983896e0b809e3e040b432e4bc1fbf7953eab45 (patch) | |
tree | 76a71d7a058cc4c2f0b0fcac50f9bddd0dd91579 /test | |
parent | b472d819f547510b4d46b43bb49b74abfb8af96c (diff) | |
download | ruby-f983896e0b809e3e040b432e4bc1fbf7953eab45.tar.gz ruby-f983896e0b809e3e040b432e4bc1fbf7953eab45.tar.xz ruby-f983896e0b809e3e040b432e4bc1fbf7953eab45.zip |
* lib/ostruct.rb (modifiable): check if really frozen.
[ruby-core:22559]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ostruct/test_ostruct.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index 5e0f4b241..8adfd0159 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -43,5 +43,9 @@ class TC_OpenStruct < Test::Unit::TestCase assert_not_respond_to(o, :b) assert_raise(TypeError) {o.a = 'z'} assert_equal('a', o.a) + o = OpenStruct.new :a => 42 + def o.frozen?; nil end + o.freeze + assert_raise(TypeError, '[ruby-core:22559]') {o.a = 1764} end end |