Getting Started: A Behavior Driven Development Primer
There are lots of perfectly useful tutorials on getting started with Rails, so I won’t go into a lot of detail there. I assume that you already have Ruby and Rails installed; as of the time of this writing, I’m using versions 1.9.2 and 3.0.4 respectively.
Set up Rails
Create a new Rails application:
rails server and point your browser at http://localhost:3000/ to make sure that it runs.
Gemfile and add these lines to the bottom:
bundle install to update gems. Run
rails server again as a sanity check.
Set up RSpec
Install RSpec into the application:
Configure the application to create specs instead of unit tests. Edit
config/application.rb and add to the bottom of the class definition:
Set up Cucumber
Install Cucumber into the application:
Test it out
First, generate the database:
Make sure RSpec doesn’t choke:
And that Cucumber doesn’t, either:
Now we’re ready to start writing features and specs.