[rspec-users] there should be one test or two?

J. B. Rainsberger me at jbrains.ca
Fri Sep 3 19:43:06 EDT 2010

On Fri, Aug 27, 2010 at 02:43, Zhenning Guan <lists at ruby-forum.com> wrote:

> in real world, when user deposit money into their bank, bank have money
> and can check deposit record. so what would it be in rspec?

I prefer two specs, because you are checking two unrelated things:
bank account balance and transaction record.

In general, I like to put each check in a separate spec, then combine
checks if I see they are related. This is my style.
J. B. (Joe) Rainsberger :: http://www.jbrains.ca ::
Diaspar Software Services :: http://www.diasparsoftware.com
Author, JUnit Recipes
2005 Gordon Pask Award for contribution to Agile practice :: Agile
2010: Learn. Practice. Explore.

More information about the rspec-users mailing list