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

Add test for Forwardable#def_delegator with r55366.

Patch by @aycabta
  [Bug #12837][ruby-core:77611]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2018-02-01 09:07:16 +00:00
parent 7af65953de
commit 499658abff

View file

@ -296,6 +296,14 @@ class TestForwardable < Test::Unit::TestCase
end
end
def test_non_module
str = String.new
str.extend Forwardable
str.instance_variable_set("@h", 42)
str.def_delegator("@h", :to_s, :forty_two)
assert_equal("42", str.forty_two)
end
private
def forwardable_class(