aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/dependencies_test.rb
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-09-05 23:36:14 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-09-05 23:36:14 +0000
commit7441b19d0c6f944b8547725f1f51349c79608576 (patch)
tree8beba648391739ae07e3e7605dc41ed832fea709 /activesupport/test/dependencies_test.rb
parent951b4d279953f05188327294ff5174c846f624a0 (diff)
downloadrails-7441b19d0c6f944b8547725f1f51349c79608576.tar.gz
rails-7441b19d0c6f944b8547725f1f51349c79608576.tar.bz2
rails-7441b19d0c6f944b8547725f1f51349c79608576.zip
Fix logic error in determining what was loaded by a given file. Closes #6039.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5035 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test/dependencies_test.rb')
-rw-r--r--activesupport/test/dependencies_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb
index c80e35c5f6..fcd2889ac2 100644
--- a/activesupport/test/dependencies_test.rb
+++ b/activesupport/test/dependencies_test.rb
@@ -428,4 +428,22 @@ class DependenciesTest < Test::Unit::TestCase
end
end
+ def test_preexisting_constants_are_not_marked_as_autoloaded
+ with_loading 'autoloading_fixtures' do
+ require_dependency 'e'
+ assert Dependencies.autoloaded?(:E)
+ Dependencies.clear
+ end
+
+ Object.const_set :E, Class.new
+ with_loading 'autoloading_fixtures' do
+ require_dependency 'e'
+ assert ! Dependencies.autoloaded?(:E), "E shouldn't be marked autoloaded!"
+ Dependencies.clear
+ end
+
+ ensure
+ Object.send :remove_const, :E if Object.const_defined?(:E)
+ end
+
end