aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/dependencies_test.rb
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-12-09 05:21:33 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-12-09 05:21:33 +0000
commit6a485c3100090fbf474336802c851b842b8a96f3 (patch)
treeab4121b338acea7e1bb87f3e08d7650f271889cf /activesupport/test/dependencies_test.rb
parentd1a2449220303f24da0d70504f5959635730da88 (diff)
downloadrails-6a485c3100090fbf474336802c851b842b8a96f3.tar.gz
rails-6a485c3100090fbf474336802c851b842b8a96f3.tar.bz2
rails-6a485c3100090fbf474336802c851b842b8a96f3.zip
Fix remove_constant to correctly handle constant names of the form "::A::...". References #6720.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5710 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/dependencies_test.rb')
-rw-r--r--activesupport/test/dependencies_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index 954f2f4a85..52f83e0f9f 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -691,4 +691,15 @@ class DependenciesTest < Test::Unit::TestCase
ensure
Object.send(:remove_const, :RaisesNameError) if defined?(::RaisesNameError)
end
+
+ def test_remove_constant_handles_double_colon_at_start
+ Object.const_set 'DeleteMe', Module.new
+ DeleteMe.const_set 'OrMe', Module.new
+ Dependencies.send :remove_constant, "::DeleteMe::OrMe"
+ assert ! defined?(DeleteMe::OrMe)
+ assert defined?(DeleteMe)
+ Dependencies.send :remove_constant, "::DeleteMe"
+ assert ! defined?(DeleteMe)
+ end
+
end