summaryrefslogtreecommitdiff
path: root/test/test_delegate.rb
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-16 08:36:56 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-16 08:36:56 +0000
commit3009bcb67967ebeb3450e771746336512eb03206 (patch)
tree17f7951176eaf9c7450781553124f00a062746cc /test/test_delegate.rb
parentfe5b495f883bbd5e34b15130f551e14600835465 (diff)
* test/test_delegate.rb: add new test file for delegate.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_delegate.rb')
-rw-r--r--test/test_delegate.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_delegate.rb b/test/test_delegate.rb
new file mode 100644
index 0000000..73740dd
--- /dev/null
+++ b/test/test_delegate.rb
@@ -0,0 +1,15 @@
+require 'test/unit'
+require 'delegate'
+
+class TestDelegateClass < Test::Unit::TestCase
+ module M
+ attr_reader :m
+ end
+
+ def test_extend
+ obj = DelegateClass(Array).new([])
+ obj.instance_eval { @m = :m }
+ obj.extend M
+ assert_equal(:m, obj.m, "[ruby-dev:33116]")
+ end
+end