[rspec-devel] [ rspec-Feature Requests-8393 ] [PATCH?] Could an unhelpful error message be improved?

noreply at rubyforge.org noreply at rubyforge.org
Fri Feb 2 16:18:48 EST 2007


Feature Requests item #8393, was opened at 2007-02-02 19:42
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=8393&group_id=797

Category: rails plugin
Group: None
>Status: Closed
Priority: 3
Submitted By: Jerry West (jjw)
Assigned to: Nobody (None)
Summary: [PATCH?] Could an unhelpful error message be improved?

Initial Comment:
Missing out the controller_name declaration from a controller spec context raises this unhelpful error for each spec in the context:

NoMethodError in 'GET /assessments (:index) should render index.rhtml'
undefined method `session=' for #<Object:0xb70efb3c>
.../vendor/plugins/rspec_on_rails/lib/spec/rails/context/controller.rb:134:in `setup_extra'
.../vendor/plugins/rspec_on_rails/lib/spec/rails/functional_eval_context.rb:22:in `setup'
.../vendor/plugins/rspec_on_rails/lib/spec/rails/context/controller.rb:151:in `setup'

A trivial fix (submitted by someone who doesn't fully understand the implications of meddling with code they did not write) would be to insert something like

        raise Exception.new('context requires controller name!') if @controller_class_name.blank?

immediately before the call to super in class ControllerEvalContext#setup() - around line 151 of rspec_on_rails/lib/spec/rails/functional_eval_context.rb

Rgds,
  Jerry

----------------------------------------------------------------------

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-02-02 21:18

Message:
Duplicate w/ 8240 which was just resolved earlier today.

----------------------------------------------------------------------

Comment By: Jerry West (jjw)
Date: 2007-02-02 19:43

Message:
Sorry, this is 0.7.5.1 (r1395)

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=8393&group_id=797


More information about the rspec-devel mailing list