O'Reilly logo

Instant Cucumber BDD How-to by Wayne Ye

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing your first Hello World feature (Simple)

During the first two recipes we learnt the concept of BDD and the basics of Cucumber; now we know that we can benefit from BDD using Cucumber, so it is time to write the first Hello World Cucumber feature.

Getting ready

In the first recipe we've already successfully installed Ruby, RubyGems, bundle, and Rails. To write our first Cucumber feature, we need a Rails application with Cucumber installed.

How to do it...

Now we create a Rails project and install Cucumber in the project. Follow the given steps:

  1. Create a new Rails app, cucumber_bdd_how_to, by running the following Rails command in the terminal:
    $ rails new cucumber_bdd_how_to
    
  2. Add gem 'cucumber-rails' into the project's Gemfile; it should be similar ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required