mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
delegate.rb: refix r43682
* lib/delegate.rb (Delegator#send): separate from method_missing so that super calls proper method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b9294f226b
commit
a9a6c103e5
3 changed files with 26 additions and 1 deletions
|
@ -145,4 +145,13 @@ class TestDelegateClass < Test::Unit::TestCase
|
|||
assert_nothing_raised(ArgumentError) {d.open}
|
||||
assert_nothing_raised(ArgumentError) {d.send(:open)}
|
||||
end
|
||||
|
||||
def test_send_method_in_delegator
|
||||
d = Class.new(SimpleDelegator) do
|
||||
def foo
|
||||
"foo"
|
||||
end
|
||||
end.new(Object.new)
|
||||
assert_equal("foo", d.send(:foo))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue