aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2012-11-28 00:13:14 +0100
committerXavier Noria <fxn@hashref.com>2012-11-28 00:13:14 +0100
commit46ebce6b49d8c646241a11821c39e6bbc20d61d5 (patch)
tree3bfd4cf2985ce2d9638b2b4f8219fc22a49c9fb2 /activesupport/test
parent5aade8245a0fe10e80e60fd0d01427406b53e753 (diff)
downloadrails-46ebce6b49d8c646241a11821c39e6bbc20d61d5.tar.gz
rails-46ebce6b49d8c646241a11821c39e6bbc20d61d5.tar.bz2
rails-46ebce6b49d8c646241a11821c39e6bbc20d61d5.zip
prevent Dependencies#remove_const from autoloading parents [fixes #8301]
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/dependencies_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index 67bd6669c5..7fea72dab5 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -938,6 +938,16 @@ class DependenciesTest < ActiveSupport::TestCase
assert !defined?(ShouldNotBeAutoloaded)
end
+ def test_remove_constant_does_not_autoload_already_removed_parents_as_a_side_effect
+ with_autoloading_fixtures do
+ ::A
+ ::A::B
+ ActiveSupport::Dependencies.remove_constant('A')
+ ActiveSupport::Dependencies.remove_constant('A::B')
+ assert !defined?(A)
+ end
+ end
+
def test_load_once_constants_should_not_be_unloaded
with_autoloading_fixtures do
ActiveSupport::Dependencies.autoload_once_paths = ActiveSupport::Dependencies.autoload_paths