Colin A. Bartlett on 13 Sep 2007 15:10:43 -0000

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PhillyOnRails] rspec slides

Cassius Rosenthal wrote:
My conclusion --which I hope Colin will comment on-- is that rSpec has many drawbacks, but we should all be using it anyway. Disadvantages of rSpec/BDD:
* breaks DRY, which is also a Rails convention
How does it break DRY?
* slows development for experienced coders
Writing tests may add marginal more time to the initial coding but saves mountains of time squashing bugs later.
* does not suggest good tests
Not sure I follow. Use RCov and Heckle to check if your tests are good.
* differentiation between 'good' and 'bad' test is not implied by syntax
Not sure I follow. What's a bad test? A test (spec, really) that just test's ActiveRecord functions is lame because ActiveRecord is already heavily tested. Other then that, what is there?
* model tests seems solid, but controller tests seem excessive (map.resoures.should_not be_trusted =>?), and view tests don't seem meaningful
I've got no problems with controller tests. And you don't need to spec you entire view. Just the stuff that's business-relevant. How about a test that makes sure @credit_cards.display_all isn't run unless you're logged in as an Admin? Or, don't spec your views at all. Some specs is better then no specs.
* trivial changes to schema often will require non-trivial changes to model specs
I'm not sure that's true. But trivial changes to a schema can kill your app. Dead app = unhappy client. Accurate specs = Happy client.
* doesn't offer integration tests, although you can simulate them -- documentation suggests using selenium instead of RSpec
It's got 'em now. Haven't tried it but Story Runner sounds cool:

-- Colin A. Bartlett Kinetic Web Solutions

To unsubscribe or change your settings, visit: