From 924ef18d4bf8f82c18b8362f3e7aab9e60ba5826 Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Thu, 17 Aug 2006 03:35:36 +0000 Subject: Detect missing_constants calls from removed modules and fail accordingly. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4780 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/test/dependencies_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'activesupport/test') diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index f043bbd438..f969a30891 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -372,4 +372,19 @@ class DependenciesTest < Test::Unit::TestCase end end + def test_removal_from_tree_should_be_detected + with_loading 'dependencies' do + root = Dependencies.autoload_paths.first + c = ServiceOne + Dependencies.clear + assert ! defined?(ServiceOne) + begin + Dependencies.load_missing_constant(c, :FakeMissing) + flunk "Expected exception" + rescue ArgumentError => e + assert_match %r{ServiceOne has been removed from the module tree}i, e.message + end + end + end + end -- cgit v1.2.3