No PhD

I work for Nature Publishing, but I haven't got a PhD

RSpec 2 on Rails 3

with 3 comments

Just a quickie – RSpec 2 is on its way, but if you’re itching to get specs running under Rails 3 you can. The RSpec 2 alpha/beta gems are in the wild, so to get it running under Rails 3, just do the following.

Firstly, install the gems:

$ sudo gem install rspec --prerelease
$ sudo gem install webrat
$ sudo gem install rspec-rails --prerelease

Once this is done, you need to add the gem declarations to your Rails Gemfile:

group :test do
gem "rspec", "2.0.0.a5"
gem "rspec-rails", "2.0.0.a6"

Note, these versions are correct as of 12th Feb, but will change.

Finally, you need to run the newly available generator to create the RSpec structure and helpers:

$ rails g rspec:install

And you should be set. Happy speccing.


Written by spanx

12th February, 2010 at 11:28 pm

Posted in Code

3 Responses

Subscribe to comments with RSS.

  1. But where is autospec? Is it gone with rspec2?


    14th February, 2010 at 1:58 pm

  2. […] found the following posts helpful: RSpec 2 on Rails 3 using bundler with Rails […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: