3
In order to use cucumber's rake task
5
I do not want to see rake's backtraces when it fails
6
Also I want to get zero exit status code on failures
7
And non-zero exit status code when is pases
10
Given a file named "features/passing_and_failing.feature" with:
20
Given a file named "features/step_definitions/steps.rb" with:
29
Given a file named "Rakefile" with:
31
require 'cucumber/rake/task'
33
SAMPLE_FEATURE_FILE = 'features/passing_and_failing.feature'
35
Cucumber::Rake::Task.new(:pass) do |t|
36
t.cucumber_opts = "#{SAMPLE_FEATURE_FILE}:3"
39
Cucumber::Rake::Task.new(:fail) do |t|
40
t.cucumber_opts = "#{SAMPLE_FEATURE_FILE}:6"
44
Scenario: Passing feature
45
When I run `bundle exec rake pass`
46
Then the exit status should be 0
48
Scenario: Failing feature
49
When I run `bundle exec rake fail`
50
Then the exit status should not be 0
51
And the output should not contain "rake aborted!"