mirror of
https://github.com/github/rails.git
synced 2026-01-27 07:17:58 -05:00
Make the non inferrable controller message a little friendlier. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8749 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -3,9 +3,15 @@ require 'active_support/test_case'
|
||||
module ActionController
|
||||
class NonInferrableControllerError < ActionControllerError
|
||||
def initialize(name)
|
||||
@name = name
|
||||
super "Unable to determine the controller to test from #{name}. " +
|
||||
"You'll need to specify it using 'tests YourController' in your " +
|
||||
"test case definition"
|
||||
"test case definition. This could mean that #{inferred_controller_name} does not exist " +
|
||||
"or it contains syntax errors"
|
||||
end
|
||||
|
||||
def inferred_controller_name
|
||||
@name.sub(/Test$/, '')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user