mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Ruby constant look-up no longer falls back to top-level since 2.5
This behavior used to warn until 2.4, and raises since 2.5.
The test here was intentinally named not to start with "test_" and so it used not to be executed because this never passes,
but now is should pass in trunk.
https://bugs.ruby-lang.org/issues/11547
44a2576f79
closes #19897
This commit is contained in:
parent
6a1c0218df
commit
6b7bfece37
1 changed files with 10 additions and 7 deletions
|
@ -397,14 +397,17 @@ class DependenciesTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def failing_test_access_thru_and_upwards_fails
|
# This raises only on 2.5.. (warns on ..2.4)
|
||||||
with_autoloading_fixtures do
|
if RUBY_VERSION > "2.5"
|
||||||
assert_not defined?(ModuleFolder)
|
def test_access_thru_and_upwards_fails
|
||||||
assert_raise(NameError) { ModuleFolder::Object }
|
with_autoloading_fixtures do
|
||||||
assert_raise(NameError) { ModuleFolder::NestedClass::Object }
|
assert_not defined?(ModuleFolder)
|
||||||
|
assert_raise(NameError) { ModuleFolder::Object }
|
||||||
|
assert_raise(NameError) { ModuleFolder::NestedClass::Object }
|
||||||
|
end
|
||||||
|
ensure
|
||||||
|
remove_constants(:ModuleFolder)
|
||||||
end
|
end
|
||||||
ensure
|
|
||||||
remove_constants(:ModuleFolder)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_non_existing_const_raises_name_error_with_fully_qualified_name
|
def test_non_existing_const_raises_name_error_with_fully_qualified_name
|
||||||
|
|
Loading…
Reference in a new issue