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:
parent
d3326ddf11
commit
ab69aba3ec
1 changed files with 5 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue