duck_punching

Ruby, Rails and tech. No ducks were harmed in the making of this blog.

RSpec 2.0 rake tasks

RSpec is going through a transition with a huge refactoring for version 2. It’s currently only in beta, but if you want to get the jump on things with RSpec 2.0 there are a few changes worth knowing to ease the upgrade path.

The rake tasks have changed a little. There has been a namespace change and consequently a filename change. This is what you need to get them working again.

Nothing difficult there, but tricky enough to need to go digging through the source, while the docs for this version are scarce.

A significant change is that you must now use a file named .rspec in the root of your project to declare the spec options. This file used to be named spec.opts. Previously you were able to add spec options in the rake task block as well as the spec.opts file. This change removes the possible duplication giving you only one way.

Oh yes, one more thing to note. The binary for RSpec 2.0 is now called rspec. That might save you some wasted time also.

I’ll post more tips as I come across them.

UPDATE: Added clarification about the old spec.opts file.

2 comments

2 Comments so far

  1. up to date January 5th, 2012 5:37 pm

    ligtv yayinakisi

  2. Christoph G February 2nd, 2012 8:41 pm

    Very nice, thank you!

Leave a reply

Mexico