should_have_db_columns: Really, Shoulda?

14 March 2010

should_have_db_columns :title, :url, :summary, :published_at

(a Shoulda) helper

Just boggles the mind, really, how anyone could write a test suite that wouldn’t fail somewhere along the line if they left out some database columns. If your tests are that bad, maybe ya shoulda written better tests to start with. You know, instead of adding a one-liner to see if you actually added the column.

Or, how about a metaphor. Let’s say you’re testing a car. If you like should_have_db_columns, you’ll love should_have_all_four_wheels. Though some would say: even without that test, you’d eventually realize a wheel was gone.