diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-08 16:04:37 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-08 16:04:37 -0800 |
commit | 3c8e0a47f942e435208b69d90a95eb8c6cea8cf9 (patch) | |
tree | d4cbb5da120045c28b38cd2db299ac85c130c5bd /activesupport/test | |
parent | 3c2fe5ccc5e51c0c3133f471cb3f0ee882fabf54 (diff) | |
parent | 4fa8c8b52f2ee7155b18cee2f3fc978075c68db1 (diff) | |
download | rails-3c8e0a47f942e435208b69d90a95eb8c6cea8cf9.tar.gz rails-3c8e0a47f942e435208b69d90a95eb8c6cea8cf9.tar.bz2 rails-3c8e0a47f942e435208b69d90a95eb8c6cea8cf9.zip |
Merge pull request #13977 from Octember/master
Fixed an issue where reloading of removed dependencies would cause an un...
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/dependencies_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index 00bec5bd9d..4ca63b3417 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -948,6 +948,18 @@ class DependenciesTest < ActiveSupport::TestCase Object.class_eval { remove_const :A if const_defined?(:A) } end + def test_access_unloaded_constants_for_reload + with_autoloading_fixtures do + assert_kind_of Module, A + assert_kind_of Class, A::B # Necessary to load A::B for the test + ActiveSupport::Dependencies.mark_for_unload(A::B) + ActiveSupport::Dependencies.remove_unloadable_constants! + + A::B # Make sure no circular dependency error + end + end + + def test_autoload_once_paths_should_behave_when_recursively_loading with_loading 'dependencies', 'autoloading_fixtures' do ActiveSupport::Dependencies.autoload_once_paths = [ActiveSupport::Dependencies.autoload_paths.last] |