From 8eefa8f3736cd5dbf7256f571b368198102f11cc Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Tue, 8 Sep 2020 16:30:02 -0400 Subject: [ruby/ostruct] Allow overriding public methods [Fixes https://bugs.ruby-lang.org/issues/15409] --- test/ostruct/test_ostruct.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ostruct') diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index 0688d8950c..3c934ccbec 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -235,4 +235,10 @@ class TC_OpenStruct < Test::Unit::TestCase assert_equal(:foo, os.puts) assert_equal(:bar, os.format) end + + def test_overriden_public_methods + os = OpenStruct.new(method: :foo, class: :bar) + assert_equal(:foo, os.method) + assert_equal(:bar, os.class) + end end -- cgit v1.2.1