1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_defined.rb (TestDefined#test_autoloaded_noload):

autoload file should no be loaded.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-03-24 14:41:17 +00:00
parent d3326ddf11
commit ab69aba3ec

View file

@ -105,6 +105,8 @@ class TestDefined < Test::Unit::TestCase
end
def test_autoloaded_noload
loaded = $".dup
$".clear
klass = Class.new do
autoload(:A, "a")
def a?
@ -113,5 +115,8 @@ class TestDefined < Test::Unit::TestCase
end
x = klass.new
assert_equal("constant", x.a?)
assert_equal([], $")
ensure
$".replace(loaded)
end
end