[rspec-devel] [ rspec-Feature Requests-12894 ] Stubs should be able to both return and yield a value

noreply at rubyforge.org noreply at rubyforge.org
Mon Nov 19 00:15:33 EST 2007


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

Category: None
Group: None
Status: Open
Priority: 3
Submitted By: Scott Taylor (smtlaissezfaire)
Assigned to: Nobody (None)
Summary: Stubs should be able to both return and yield a value

Initial Comment:

Stubs can return values:

obj.stub!(:example_method).and_return "val"

or they could yield to values:

obj.stub!(:example_method).and_yield "val"

What if they could do both?

obj.stub!(:example_method).yield("val").and_return "val"

Better syntax is welcome.

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

Comment By: Chad Humphries (spicycode)
Date: 2007-11-19 00:15

Message:
Moved to http://rspec.lighthouseapp.com/projects/5645-rspec/tickets/105-12894-stubs-should-be-able-to-both-return-and-yield-a-value

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

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


More information about the rspec-devel mailing list