Setting up Cucumber/RSpec with Rails 2.3 for Leopard

Install the gems:

sudo gem install rails --source
sudo gem install dchelimsky-rspec
sudo gem install dchelimsky-rspec-rails
sudo gem install cucumber
sudo gem install webrat

Create your app:

rails myapp
cd myapp

Freeze Rails to vendor:

rake rails:freeze:edge

Manage your gem dependencies through rails, edit config/environments/test.rb. Add the following lines:

config.gem "dchelimsky-rspec", :lib => false, :version => ">="
config.gem "dchelimsky-rspec-rails", :lib => false, :version => ">="
config.gem 'aslakhellesoy-cucumber', :lib => false, :version => ">="
config.gem 'webrat', :lib => false

Unpack your gems:

rake gems:unpack RAILS_ENV=test
rake gems:unpack:dependencies RAILS_ENV=test

And generate your testing folders:

script/generate rspec
script/generate cucumber

That’s it, have fun.

comments powered by Disqus