1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/forwardable] Fix NoMethodError on ruby 2.4 or earlier

https://github.com/ruby/forwardable/runs/242918994#step:5:12
```
Error: test_obj_single_delegators_send_id(TestForwardable): NoMethodError: private method `attr_reader' called for #<Class:#<Object:0x00005605af501f58>>
```

https://github.com/ruby/forwardable/commit/711bbb2466
This commit is contained in:
Kazuhiro NISHIYAMA 2019-10-10 11:33:44 +09:00 committed by Hiroshi SHIBATA
parent 0098977053
commit f625a4be3c

View file

@ -230,7 +230,7 @@ class TestForwardable < Test::Unit::TestCase
def test_obj_single_delegators_send_id
%i[def_delegators def_single_delegators].each do |m|
obj = single_forwardable_object do
singleton_class.attr_reader :receiver
singleton_class.__send__ :attr_reader, :receiver
__send__ m, :@receiver, :__send__, :__id__
end