summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-12-13 02:11:05 +0900
committerKoichi Sasada <ko1@atdot.net>2021-12-13 10:23:52 +0900
commit5164c2b36f66e7b1d2e0f908663ee3f3a3830605 (patch)
treee2303d235718776ae16b4baebac1ee213415b5bf /test/ruby
parentfdfb43b2b129afb78c352c95776118eeceb245a2 (diff)
Pass UnboundMethod to 2nd arg of define_method
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5252
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_struct.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_struct.rb b/test/ruby/test_struct.rb
index 5a39ecc3aa..176e2ac5de 100644
--- a/test/ruby/test_struct.rb
+++ b/test/ruby/test_struct.rb
@@ -503,7 +503,7 @@ module TestStruct
assert_equal 1, klass.instance_method(:a=).arity
klass.module_eval do
- define_method(:b=, &klass.new.method(:a=).to_proc)
+ define_method(:b=, instance_method(:a=))
alias c= a=
end
@@ -518,7 +518,7 @@ module TestStruct
assert_equal [[:req, :_]], klass.instance_method(:a=).parameters
klass.module_eval do
- define_method(:b=, &klass.new.method(:a=).to_proc)
+ define_method(:b=, instance_method(:a=))
alias c= a=
end