[rspec-devel] Stub patch

David Chelimsky dchelimsky at gmail.com
Fri Sep 22 08:11:19 EDT 2006


On 9/22/06, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 9/22/06, Brian Takita <brian.takita at gmail.com> wrote:
> > 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.
>
> This is beautiful. Thanks Brian. I started to commit it but there are
> a bunch of new warnings and coverage went down to by 3%. If you can
> eliminate the warnings and address the coverage issues and get "rake
> pre_commit" to run, feel free to commit this. Otherwise I'll look at
> it as time allows, but that won't likely be for a couple of days.

Well, I found the time. It wasn't much. I just don't know how to use
patch properly, so for some reason all code in the new files appeared
twice, hence the warnings and the coverage.

I've committed this and you can all experience the love if you check
out the trunk.

Brian, before we do a release I want to get this documented. Do you
want to take a crack at it?

Release coming no later than 2 weeks (very busy until that time frame)
but possibly sooner.

Cheers,
David



>
> Thanks again. This is great.
>
> David
>
> >
> > Brian
> >
> > _______________________________________________
> > rspec-devel mailing list
> > rspec-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/rspec-devel
> >
> >
>


More information about the rspec-devel mailing list