mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add test for {SimpleDelegator, DelegateClass}#class .
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b177ff64db
commit
54e2cb8179
1 changed files with 12 additions and 0 deletions
|
@ -17,4 +17,16 @@ class TestDelegateClass < Test::Unit::TestCase
|
|||
e = SystemCallError.new(0)
|
||||
assert((SimpleDelegator.new(e) == e) == (e == SimpleDelegator.new(e)), "[ruby-dev:34808]")
|
||||
end
|
||||
|
||||
class Myclass < DelegateClass(Array);end
|
||||
|
||||
def test_delegateclass_class
|
||||
myclass=Myclass.new([])
|
||||
assert_equal(Myclass,myclass.class)
|
||||
end
|
||||
|
||||
def test_simpledelegator_class
|
||||
simple=SimpleDelegator.new([])
|
||||
assert_equal(SimpleDelegator,simple.class)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue