[rspec-users] Specifying that code is called in a block

Bryan Helmkamp bhelmkamp at gmail.com
Fri Mar 2 11:04:48 EST 2007


On 2/28/07, aslak hellesoy <aslak.hellesoy at gmail.com> wrote:
> I can't help but feeling that if you're specifying behaviour at this
> level of detail you're too specific. You're testing implementation,
> not verifying behaviour.

Aslak,

Is there an alternate solution you'd propose, or would you go without
this spec entirely? It's easy to imagine a case where the lack of
specifying the need for a transaction could allow a bug.

More generally, what metrics do you apply to differentiate between
testing implementation and verifying behavior?

As I understand it, if one were to follow a strict spec-first style of
development, each piece of implementation would have to demanded by a
failing spec before it could be written. In this particular case, that
would mean not adding the transaction block until there is a unit spec
requiring it. How do you reconcile these two seemingly conflicting
principles?

-Bryan


More information about the rspec-users mailing list