[rspec-devel] [ rspec-Bugs-10744 ] should raise_error not working in new controller specs

noreply at rubyforge.org noreply at rubyforge.org
Thu May 10 15:52:17 EDT 2007


Bugs item #10744, was opened at 2007-05-10 12:26
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=10744&group_id=797

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Paul Pagel (paulwpagel)
Assigned to: Nobody (None)
Summary: should raise_error not working in new controller specs

Initial Comment:
I have the following spec

  it "Should raise exception when ***" do
    lambda{post :index, :key => '987'}.should raise_error(Exception)
  end

which fails because of

'The LoginController Should raise exception when packet is not found' FAILED
expected Exception but nothing was raised
login_controller_spec.rb:42:

and in the controller i have an index method which does throw an exception, which I can verify by wrapping it in a begin/rescue block, but the spec still fails.

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

Comment By: Aslak Hellesøy (aslak_hellesoy)
Date: 2007-05-10 15:52

Message:
Before investigating this we need to know the versions of all 
relevant software you are using, for example:

* OS X 10.4.9
* Ruby 1.8.6
* RSpec 1.8.2 or RSpec trunk r1643
* Spec::Rails 1.8.2 or Spec::Rails tag r1234...
* Rails 1.2.3 or Rails edge r5645
* Whatever other relevant software.

Without this information it's like solving 1 equation (your 
question) with 5 unknown variables (the versions).

We strongly recommend that you use the latest released version of
RSpec, alternatively the subversion trunk (if you're the bleeding
edge kind of person).

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

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


More information about the rspec-devel mailing list