RSpec 2 on Rails 3
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"
end
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.
But where is autospec? Is it gone with rspec2?
Falk
14th February, 2010 at 1:58 pm
@Falk see http://blog.davidchelimsky.net/2010/03/15/rspec-2-and-autotest/
Ryan Walker
26th March, 2010 at 2:04 am
[...] found the following posts helpful: RSpec 2 on Rails 3 using bundler with Rails [...]
Rails3, RSpec2 and WebMock
9th May, 2010 at 9:32 pm