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.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index 5c83bfd..db8e741 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -61,4 +61,15 @@ class TC_OpenStruct < Test::Unit::TestCase
assert_not_respond_to(o, :a, bug)
assert_not_respond_to(o, :a=, bug)
end
+
+ def test_method_missing_handles_square_bracket_equals
+ o = OpenStruct.new
+ assert_raise(NoMethodError) { o[:foo] = :bar }
+ end
+
+ def test_method_missing_handles_square_brackets
+ o = OpenStruct.new
+ assert_raise(NoMethodError) { o[:foo] }
+ end
+
end