Cucumber

Installation Steps (modified by Luis Manotas @xluisManotasx)

Pre-Install
Install [capybara] to use cucumber with it. Cucumber will detect it and make the needed configurations to use it during testing.

Rails 2.x

Step1
Including config.gem instructions in your environment.rb or environments/test.rb is not needed as cucumber generator will automatically create a new environment and configure it properly.

Step 2
Generate features folder:

ruby script/generate cucumber

This command also generates a file: config/environments/cucumber.rb, which stores environment configurations for cucumber.

Rails 3.x

Step1
In your gemfile

group :cucumber do
  gem 'capybara'
  gem 'cucumber'
  gem 'cucumber-rails'
end

Step2
Lets run the bundle install

$ bundle install

Step3
Generate the cucumber configuration

$ rails g cucumber:install

To run your Cucumber Features
There are two ways

With rake:

$ rake cucumber [options]

With bundler:
$ bundle exec cucumber [options]

Manual Installation
Run the following commands:

gem install cucumber
gem install cucumber-rails

Integrating with Autotest

See autotest.

Documentation and Examples

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License