[rspec-users] "Tricks" for testing after_create callback???
dchelimsky at gmail.com
Thu Dec 13 10:07:10 EST 2007
On Dec 13, 2007 8:59 AM, Rick DeNatale <rick.denatale at gmail.com> wrote:
> 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.
This is a bit scary :(
Rick - would you mind sticking this information, a bit filtered, into
> Rick DeNatale
> My blog on Ruby
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users