summaryrefslogtreecommitdiff
path: root/test/ostruct/test_ostruct.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ostruct/test_ostruct.rb')
-rw-r--r--test/ostruct/test_ostruct.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index 79662c6437..37b7cd137e 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -34,4 +34,12 @@ class TC_OpenStruct < Test::Unit::TestCase
foo.bar.foo = foo
assert_equal('#<OpenStruct bar=#<OpenStruct foo=#<OpenStruct ...>>>', foo.inspect)
end
+
+ def test_frozen
+ o = OpenStruct.new
+ o.a = 'a'
+ o.freeze
+ assert_raise(TypeError) {o.b = 'b'}
+ assert_not_respond_to(o, :b)
+ end
end