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
上级 6a48e89a
......@@ -238,7 +238,9 @@ def route(*args)
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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册