[rspec-users] "Tricks" for testing after_create callback???

Rick DeNatale rick.denatale at gmail.com
Thu Dec 13 09:59:18 EST 2007

On 12/13/07, Daniel Tenner <daniel.ruby at tenner.org> wrote:
> Then I definitely think there's little point in specifying what
> "deliver_secret_santa" is called with. The chances that you'll get
> that wrong are extremely small, and even if you do it will be picked
> up instantly by your integration tests, and be very easy to fix.
> What's much more likely to break is SantasMailbox - so focus the
> time, the effort, and the lines of code on speccing that quite
> thoroughly, so you know it can take every likely Message that you
> might throw at it.
> (/opinion)

Well IMHO, I think that it's important to spec both.  Even though the
callback is simple, it's a crucial design point, and I'm not unknown
to break such assumptions as code progresses.

It shouldn't be so hard to do either,  I just can't figure out now,
why rspec seems to be calling the create in my spec twice.

Rick DeNatale

My blog on Ruby

More information about the rspec-users mailing list