[rspec-devel] [ rspec-Bugs-13579 ] NoMethodError not raised for missing helper methods

noreply at rubyforge.org noreply at rubyforge.org
Thu Sep 6 09:23:48 EDT 2007


Bugs item #13579, was opened at 2007-09-01 17:45
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13579&group_id=797

Category: rails plugin
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: Rupert Voelcker (rupert)
Assigned to: Nobody (None)
Summary: NoMethodError not raised for missing helper methods

Initial Comment:
If in a helper spec you spec a method that doesn't exist in the helper a NoMethodError isn't raised.  This means that a spec like:

describe PeopleHelper do
  it "should return 'garbage'" do
    non_existant_helper_method.should == 'garbage'
  end
end

passes when the non_existant_helper_method doesn't exist in the helper.

I've enclosed a diff file containing a failing spec.

Having a wee look with the debugger, it goes through the end of method_missing of rails_behaviour.rb where it gets super'd up to the method_missing in prototype_helper.rb which creates a new JavaScrptProxy -this doesn't seem quite right.  Not having any idea how this part of things works I'm afraid I can't suggest anything at the moment so I'm hoping some bright spark will know straightaway what's wrong.

Cheers

Rupert

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

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-09-06 13:23

Message:
This was fixed with [13713] (http://rubyforge.org/tracker/?func=detail&atid=3149&aid=13713&group_id=797).

I've added your example (slightly tweaked - it raises a NameError, not a NoMethodError) to the plugin specs (not the example app specs).

Thanks!

Fixed in r2528

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

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


More information about the rspec-devel mailing list