Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8749

Show
Ignore:
Timestamp:
01/30/08 01:32:28 (7 months ago)
Author:
nzkoz
Message:

Make the non inferrable controller message a little friendlier. [Koz]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/test_case.rb

    r8570 r8749  
    44  class NonInferrableControllerError < ActionControllerError 
    55    def initialize(name) 
     6      @name = name 
    67      super "Unable to determine the controller to test from #{name}. " + 
    78        "You'll need to specify it using 'tests YourController' in your " + 
    8         "test case definition" 
     9        "test case definition. This could mean that #{inferred_controller_name} does not exist " + 
     10        "or it contains syntax errors" 
     11    end 
     12 
     13    def inferred_controller_name 
     14      @name.sub(/Test$/, '') 
    915    end 
    1016  end