[rspec-devel] [ rspec-Feature Requests-13645 ] Support for alternative expectations

noreply at rubyforge.org noreply at rubyforge.org
Tue Sep 4 06:33:34 EDT 2007


Feature Requests item #13645, was opened at 2007-09-04 12:33
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=13645&group_id=797

Category: mock module
Group: None
Status: Open
Priority: 3
Submitted By: Rodrigo Alvarez (papipo)
Assigned to: Nobody (None)
Summary: Support for alternative expectations

Initial Comment:
I would like to be able to do something like:

@model.should_receive(:save).and_return(true).or_receive(:save!).and_raise(ActiveRecord::RecordNotSaved)

At the moment I must stub both methods, and that does the work, but that way I'm not specifying what is supposed to happen. 

This allows more verbosity.

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

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


More information about the rspec-devel mailing list