[rspec-users] When to use Factories, Mock Models, Mocks & Stubs

David Chelimsky dchelimsky at gmail.com
Wed Feb 3 09:32:50 EST 2010


On Wed, Feb 3, 2010 at 8:18 AM, Matt Wynne <matt at mattwynne.net> wrote:
>
> On 3 Feb 2010, at 11:35, J. B. Rainsberger wrote:
>
>> I find this rule of thumb helpful: stub unless you're certain to want
>> to verify this time that the client invoke the server correctly, and
>> never, never mock multiple methods at once.
>
> Right, because the mock (should_receive) is an assertion, and it's usually
> better to have one assertion per example.

Over here to the east of the pond, we say "expectation." :)

> cheers,
> Matt
>
> http://mattwynne.net
> +447974 430184
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list