aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2008-01-30 01:32:28 +0000
committerMichael Koziarski <michael@koziarski.com>2008-01-30 01:32:28 +0000
commit05707a436bb259a00fc11cfb78d453fe52bb6264 (patch)
tree6576356dbcd8091a875e93b7eee02969bf40ca0e
parent900d6d7bd24519cbcab11b18ae42ae843e3b8aa9 (diff)
downloadrails-05707a436bb259a00fc11cfb78d453fe52bb6264.tar.gz
rails-05707a436bb259a00fc11cfb78d453fe52bb6264.tar.bz2
rails-05707a436bb259a00fc11cfb78d453fe52bb6264.zip
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
-rw-r--r--actionpack/lib/action_controller/test_case.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb
index 431876a72e..dc022cbde3 100644
--- a/actionpack/lib/action_controller/test_case.rb
+++ b/actionpack/lib/action_controller/test_case.rb
@@ -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