diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-29 03:48:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-29 03:48:36 +0000 |
commit | 0d52ec9c8c5a4c3c25e5ff9ac7a91d0405738fc5 (patch) | |
tree | d65ca77efdc1fe08e2d81aee9675d2ac6426499e /test | |
parent | c7030e1997c9c3e1e4b4e093bca0689d4bedc803 (diff) | |
download | ruby-0d52ec9c8c5a4c3c25e5ff9ac7a91d0405738fc5.tar.gz |
ostruct.rb: respond_to?
* lib/ostruct.rb (OpenStruct): make respond_to? working on
just-allocated objects for workaround of Psych.
[ruby-core:72501] [Bug #11884]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53366 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 8c122b94a7..8b0424d2d8 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -23,6 +23,10 @@ class TC_OpenStruct < Test::Unit::TestCase assert_respond_to(o, :a=) end + def test_respond_to_allocated + assert_not_respond_to(OpenStruct.allocate, :a) + end + def test_equality o1 = OpenStruct.new o2 = OpenStruct.new |