summaryrefslogtreecommitdiff
path: root/test/ostruct
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2020-09-08 17:13:29 -0400
committerMarc-Andre Lafortune <github@marc-andre.ca>2020-09-14 12:46:51 -0400
commit12a2e32d43256e37d36903c5fa5fabe556337d84 (patch)
treece3a0c6210ce740f7fd6409237fdf4c09af21d40 /test/ostruct
parent12a13eef49dd2d839f502a7d848b7d600e8b645a (diff)
[ruby/ostruct] Add access to public instance methods in case they are overriden
Diffstat (limited to 'test/ostruct')
-rw-r--r--test/ostruct/test_ostruct.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index 3c934ccbec..d07fef3a83 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -241,4 +241,9 @@ class TC_OpenStruct < Test::Unit::TestCase
assert_equal(:foo, os.method)
assert_equal(:bar, os.class)
end
+
+ def test_access_original_methods
+ os = OpenStruct.new(method: :foo)
+ assert_equal(os.object_id, os.method!(:object_id).call)
+ end
end