[rspec-devel] Stub patch

Brian Takita brian.takita at gmail.com
Fri Sep 22 03:53:04 EDT 2006


Hello,

I added a patch that adds stubbing support to rspec.

http://rubyforge.org/tracker/index.php?func=detail&aid=5844&group_id=797&atid=3151

context "A consumer of a stub" do

  specify "should be able to stub objects" do
    obj = Object.new
    stub(obj).method(:foobar).with {:return_value}
    obj.foobar.should_equal :return_value
  end

end

It also resets the object to its prestubb state after the spec is finished.
This would allow stubbing of class methods like Stubby or flexstub.

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20060922/29b6776c/attachment.html 


More information about the rspec-devel mailing list