O'Reilly logo

The Cucumber Book, 2nd Edition by Steve Tooke, Aslak Hellesoy, Matt Wynne

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

Running Cucumber from Rake

Many projects use a build tool to perform common tasks. For Ruby projects, Rake is the de facto build tool. Cucumber has a Rake task that makes it easy to run Cucumber from Rake. If you are using Cucumber-Rails, which we describe in Chapter 14, Bootstrapping Rails, you will have Rake tasks set up automatically.

If you are not using Rake, it’s still easy to set it up yourself. Try adding this to a Rakefile in the root of your project:

 require ​'cucumber/rake/task'
 
 Cucumber::Rake::Task.new ​# defines a task named cucumber

Now you can run your Cucumber features from Rake:

 $ ​​rake​​ ​​cucumber

Profiles from cucumber.yml will be picked up when you run Cucumber from Rake, but you can also define Cucumber ...

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