From 95d9bcf2b2921baee5dfacdf9dfd606a4c5167a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lafortune?= Date: Mon, 6 Dec 2021 23:05:53 -0500 Subject: [ruby/ostruct] Alias less methods Skips methods that do not end with letter (in particular `!~` and `=~`) For JRuby, also skip `instance_exec`, `instance_eval` and `eval` --- test/ostruct/test_ostruct.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index 4ec4d43084..6487cc831c 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -280,6 +280,7 @@ class TC_OpenStruct < Test::Unit::TestCase os = OpenStruct.new(method: :foo, hash: 42) assert_equal(os.object_id, os.method!(:object_id).call) assert_not_equal(42, os.hash!) + refute os.methods.include?(:"!~!") end def test_override_subclass -- cgit v1.2.3