зеркало из https://github.com/github/ruby.git
Test for [Bug #16669]
This commit is contained in:
Родитель
de9d6a7a8c
Коммит
da5bd0047d
|
@ -61,6 +61,14 @@ class TestDefined < Test::Unit::TestCase
|
|||
f.attrasgn_test { |v| assert(v) }
|
||||
end
|
||||
|
||||
def test_defined_undef
|
||||
x = Object.new
|
||||
def x.foo; end
|
||||
assert(defined?(x.foo))
|
||||
x.instance_eval {undef :foo}
|
||||
assert(!defined?(x.foo), "undefed method should not be defined?")
|
||||
end
|
||||
|
||||
def test_defined_yield
|
||||
assert(defined_test) # not iterator
|
||||
assert(!defined_test{}) # called as iterator
|
||||
|
|
Загрузка…
Ссылка в новой задаче