How to equip rails for behavior driven development.
January 9th, 2010
First, you’re going to need a few gems: cucumber, rspec-rails, rspec, and webrat. Although there are a number of ways you can get these running in your new rails project, the best plan is to set up gem dependencies directly in your application using the handy config.gem command.
Just add these lines to config/environments/test.rb:
config.gem 'rspec-rails' , :lib => false config.gem 'rspec' , :lib => false config.gem 'cucumber' config.gem 'webrat'
Next, make sure these gems are installed by typing:
RAILS_ENV=test sudo rake gems:install
Finally, you’ll need to bootstrap your rails application for development with Cucumber and RSpec. Simply type:
script/generate rspec script/generate cucumber
That’s it. Now you’re set up for behavior driven development in your rails app.