mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
This is for making sure const_missing is triggered without warnings
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
module LoadsConstant
|
||||
end
|
||||
|
||||
RequiresConstant
|
||||
# The _ = assignment is to prevent warnings
|
||||
_ = RequiresConstant
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user