This is for making sure const_missing is triggered without warnings

This commit is contained in:
Santiago Pastorino
2010-07-26 12:42:07 -03:00
parent 514624e53c
commit 4ea1753fc2
2 changed files with 8 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
module LoadsConstant
end
RequiresConstant
# The _ = assignment is to prevent warnings
_ = RequiresConstant

View File

@@ -220,11 +220,12 @@ class DependenciesTest < Test::Unit::TestCase
$:.push(path)
with_autoloading_fixtures do
RequiresConstant
# The _ = assignments are to prevent warnings
_ = RequiresConstant
assert defined?(RequiresConstant)
assert defined?(LoadedConstant)
ActiveSupport::Dependencies.clear
RequiresConstant
_ = RequiresConstant
assert defined?(RequiresConstant)
assert defined?(LoadedConstant)
end
@@ -241,11 +242,12 @@ class DependenciesTest < Test::Unit::TestCase
$:.push(path)
with_autoloading_fixtures do
LoadsConstant
# The _ = assignments are to prevent warnings
_ = LoadsConstant
assert defined?(LoadsConstant)
assert defined?(LoadedConstant)
ActiveSupport::Dependencies.clear
LoadsConstant
_ = LoadsConstant
assert defined?(LoadsConstant)
assert defined?(LoadedConstant)
end