From 12a2e32d43256e37d36903c5fa5fabe556337d84 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Tue, 8 Sep 2020 17:13:29 -0400 Subject: [ruby/ostruct] Add access to public instance methods in case they are overriden --- test/ostruct/test_ostruct.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ostruct') 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 -- cgit v1.2.3