summaryrefslogtreecommitdiff
path: root/test/ostruct/test_ostruct.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-05 01:57:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-05 01:57:26 +0000
commit10ce99866f4c335e8015b462bc1c0c2278aa8a74 (patch)
treef7f49610a5903308df571c71da8132d0f4dc9c67 /test/ostruct/test_ostruct.rb
parent530f543e4601b3a49607d666c4285f8b2e7fe09b (diff)
ostruct.rb: append suffixes to protected methods
* lib/ostruct.rb (modifiable?, new_ostruct_member!, table!): append suffixes to protected methods so that they will not clash with assigned members. [Fix GH-806] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49145 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ostruct/test_ostruct.rb')
-rw-r--r--test/ostruct/test_ostruct.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index 14bc2b2da8..2c0da2a419 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -135,4 +135,10 @@ class TC_OpenStruct < Test::Unit::TestCase
e = assert_raise(ArgumentError) { os.send :foo=, true, true }
assert_match(/#{__callee__}/, e.backtrace[0])
end
+
+ def test_modifiable
+ os = OpenStruct.new(modifiable: true)
+ assert_equal true, os.modifiable
+ assert_nothing_raised { os.foo = true }
+ end
end