mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
16 lines
290 B
Ruby
16 lines
290 B
Ruby
|
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
|