ruby-changes:50035
From: hsbt <ko1@a...>
Date: Thu, 1 Feb 2018 18:07:21 +0900 (JST)
Subject: [ruby-changes:50035] hsbt:r62153 (trunk): Add test for Forwardable#def_delegator with r55366.
hsbt 2018-02-01 18:07:16 +0900 (Thu, 01 Feb 2018) New Revision: 62153 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62153 Log: Add test for Forwardable#def_delegator with r55366. Patch by @aycabta [Bug #12837][ruby-core:77611] Modified files: trunk/test/test_forwardable.rb Index: test/test_forwardable.rb =================================================================== --- test/test_forwardable.rb (revision 62152) +++ test/test_forwardable.rb (revision 62153) @@ -296,6 +296,14 @@ class TestForwardable < Test::Unit::Test https://github.com/ruby/ruby/blob/trunk/test/test_forwardable.rb#L296 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( -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/