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

Changeset 8838

Show
Ignore:
Timestamp:
02/10/08 01:10:14 (5 months ago)
Author:
nzkoz
Message:

2-0-stable: Make the non inferrable controller message a little friendlier. [Koz]

Merging [8749]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2-0-stable/actionpack/lib/action_controller/test_case.rb

    r8498 r8838  
    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