RSpec 1.0 was quietly released last weekend, after a flurry of activity from Aslak and David, who were hiding at a little table last Saturday during Railsconf finishing it up. Since it didn't get the blogosphere loving that I thought it should have, here are some of the important changes:

  • The API is now considered stable, which is huge news for those of us that have been suffering through upgrades for a while now.
  • You can now include examples that are not implemented by not providing a block to the example. These examples then show up in yellow in your spec report. For instance:

    it 'should tell us it is sharp'

    will produce:

    Spec image

    when run. Much handier than a TODO comment, right? It allows you to do a lot of thinking about how your object should act beforehand, and then implement it piece by piece.

  • A spec:rcov task was added to the Rails rake tasks that will automatically produce a code coverage report from your specs.

  • Numerous other bug fixes and small changes. See the changelog here.

If you haven't checked out RSpec yet, you don't have any more excuses not to. You can install it into your Rails app right now and start writing specs without changing anything else. You can even throw it away and go back to the normal Rails testing framework anytime that you want to, although I doubt that you will.

Comments