Installing Cucumber (and RSpec)

Cucumber is packaged as a gem and can be installed by running gem install cucumber. However, most of the examples in this book assume you install it via Bundler, which means having a Gemfile in the root directory of your project. Most of the examples also assume you’ll use RSpec,[77] so you’ll need that in your Gemfile too:

installation/Gemfile
 
source :rubygems
 
 
group :test ​do
 
gem ​'cucumber'​, ​'1.2.1'
 
gem ​'rspec-expectations'​, ​'2.11.2'
 
end

Cucumber will then install with the following command:

 
$ ​bundle install

To verify that you have installed it properly, run cucumber --help.

Get The Cucumber Book now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.