This patch allows objects to be stubbed. It also reverts the object to its unstubbed state after the spec is finished
executing.
For example:
require File.dirname(__FILE__) + '/../lib/spec'
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 |