Setting Up Cucumber
To install Cucumber, we need two gems in the Gemfile:
â | group :development, :test âdoâ |
â | gem â'cucumber-rails'â, require: false â# The false prevents a warningâ |
â | gem â'database_cleaner'â |
â | âendâ |
Then bundle install.
Strictly speaking, database_cleaner isnât required, but itâs valuable and gives fixture-like transaction behavior to your nonfixture using tests. The cucumber gem will be installed as a dependency of cucumber-rails. As I write this, weâre talking about version 1.3.15 of Cucumber and version 1.4.1 of cucumber_rails.
To install Cucumber, thereâs a command-line generator:
â | rails generate cucumber:install |
This creates a config/cucumber.yml file for runtime options, the actual ...
Get Rails 4 Test Prescriptions 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.