[rspec-devel] Congrats & stubbing methods with specific args question

David Chelimsky dchelimsky at gmail.com
Sat Sep 1 13:33:09 EDT 2007

On 9/1/07, Scott Taylor <mailing_lists at railsnewbie.com> wrote:
> Congratulations on the 1.0.9 release!

Huh? Release? News to me.

> This release, I think, is
> worth at least a major version number (if not 2.0)- with rbehave, the
> internals of rspec completely refactored, the textmate bundle with
> lots of new features, enhancements to the mocking framework, etc.  So
> thanks for all the hard work - especially Dan North, Brian Takita -
> and the usual suspects: David & Aslak.

We'll probably make it 1.1. There's still a lot of unification of the
runners to happen before we get anywhere near a 2.0.

> Just one thing on the changeset that I saw:
> * You can now stub!(:msg).with(specific args)
>   Does this mean that a stub with specific args will only be stubbed
> in those cases, but in others it will act as if it weren't?

Not quite. It means that you can set up different stub return values
for different argument values, but it does NOT mean that the call will
be passed on to the object if those values are not sent in. Once you
stub or mock a method on a real object, that method is owned by the
mock framework.

> This may
> be one of the best new features of rspec.
> Thanks, all, for your help, support, and hard work,
> Scott
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel

More information about the rspec-devel mailing list