diff options
author | Akira Matsuda <ronnie@dio.jp> | 2017-01-30 16:39:13 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2017-01-30 16:52:54 +0900 |
commit | 6b7bfece376c025e1da04478c0e34a88bdb9cf83 (patch) | |
tree | 310583df43a95e20a1bf357f99600926142d0218 | |
parent | 6a1c0218df1fcffaac97e7288db07934bfef277f (diff) | |
download | rails-6b7bfece376c025e1da04478c0e34a88bdb9cf83.tar.gz rails-6b7bfece376c025e1da04478c0e34a88bdb9cf83.tar.bz2 rails-6b7bfece376c025e1da04478c0e34a88bdb9cf83.zip |
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
https://github.com/ruby/ruby/commit/44a2576f798b07139adde2d279e48fdbe71a0148
closes #19897
-rw-r--r-- | activesupport/test/dependencies_test.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index e772d15d53..53a75f0ad4 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -397,14 +397,17 @@ class DependenciesTest < ActiveSupport::TestCase end end - def failing_test_access_thru_and_upwards_fails - with_autoloading_fixtures do - assert_not defined?(ModuleFolder) - assert_raise(NameError) { ModuleFolder::Object } - assert_raise(NameError) { ModuleFolder::NestedClass::Object } + # This raises only on 2.5.. (warns on ..2.4) + if RUBY_VERSION > "2.5" + def test_access_thru_and_upwards_fails + with_autoloading_fixtures do + assert_not defined?(ModuleFolder) + assert_raise(NameError) { ModuleFolder::Object } + assert_raise(NameError) { ModuleFolder::NestedClass::Object } + end + ensure + remove_constants(:ModuleFolder) end - ensure - remove_constants(:ModuleFolder) end def test_non_existing_const_raises_name_error_with_fully_qualified_name |