diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-17 02:14:32 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-17 02:14:32 +0000 |
commit | 5199aea4aa5d07cf978270f22d03abefbee245c2 (patch) | |
tree | 3a79456303ad3937f7ae2337706b627d07ca7e9a /actionpack | |
parent | 6a48e89ae7811904822eb203ad9f54897e460f07 (diff) | |
download | rails-5199aea4aa5d07cf978270f22d03abefbee245c2.tar.gz rails-5199aea4aa5d07cf978270f22d03abefbee245c2.tar.bz2 rails-5199aea4aa5d07cf978270f22d03abefbee245c2.zip |
Better fix for requireing a missing route file in unit tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@643 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 6c3b73843c..2633eff09c 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -238,7 +238,9 @@ module ActionController def reload begin - require_dependency(ROUTE_FILE) if Object.method_defined?(:require_dependency) + require_dependency(ROUTE_FILE) + rescue NoMethodError + # ignore for unit tests rescue LoadError, ScriptError => e raise RoutingError, "Cannot load config/routes.rb:\n #{e.message}" ensure # Ensure that there is at least one route: |