aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-01 09:07:16 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-01 09:07:16 +0000
commitcef616b3a31ed486b123a86c2b2972cd30a9a068 (patch)
treea87a11bdd4dcd8bfa52ab6f9700c478e3d4af0a1 /test
parent7037a9f8a1353df739a72ab41a6cfd2df1daf345 (diff)
downloadruby-cef616b3a31ed486b123a86c2b2972cd30a9a068.tar.gz
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
Diffstat (limited to 'test')
-rw-r--r--test/test_forwardable.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_forwardable.rb b/test/test_forwardable.rb
index e48dbfe18f..b3f8467c5c 100644
--- a/test/test_forwardable.rb
+++ b/test/test_forwardable.rb
@@ -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(