I am Paul Wilson; Mere Complexities Limited, sells my consulting, coaching, and coding services. I am passionate about Agile, particularly Test Driven Development.


Rails' Test Generation

A few weeks ago Alan Francis suggested that

The sample test case that Rails generates for models and controllers (assert true) should be created as a failure (assert false).

My badly worded comment was misunderstood. It's not how generic the test is that bothers me; I simply disagree. If rails generated broken production code then a failing test would be better. But when (for instance) you generate a model, you get a perfectly working ActiveRecord that

  • works
  • has ActiveRecord functionality is part of the framework and tested
  • you may not want to change for a while

Under these circumstances a failing test would just be annoying. Start adding failing tests when you need to add functionality.


0 Comments:

Post a Comment

<< Home

subscribe here subscribe

About me

picture

Conference

RailsConf Europe 2008
Scotland on Rails Organiser

Previous blog posts

Blog archive

Other links: