3
In order to ease the development process
4
As a developer and CI server administrator
5
Cucumber features should be executable via Rake
8
And a file named "features/missing_step_definitions.feature" with:
13
Given I want to run this
16
Given I don't want this ran
19
Scenario: rake task with a defined profile
20
Given the following profile is defined:
22
foo: --quiet --no-color features/missing_step_definitions.feature:3
24
And a file named "Rakefile" with:
26
require 'cucumber/rake/task'
28
Cucumber::Rake::Task.new do |t|
32
When I run `rake cucumber`
33
Then it should pass with:
38
Given I want to run this
40
1 scenario (1 undefined)
44
Scenario: rake task without a profile
45
Given a file named "Rakefile" with:
47
require 'cucumber/rake/task'
49
Cucumber::Rake::Task.new do |t|
50
t.cucumber_opts = %w{--quiet --no-color}
53
When I run `rake cucumber`
54
Then it should pass with:
59
Given I want to run this
62
Given I don't want this ran
64
2 scenarios (2 undefined)
68
Scenario: rake task with a defined profile and cucumber_opts
69
Given the following profile is defined:
71
bar: ['features/missing_step_definitions.feature:3']
73
And a file named "Rakefile" with:
75
require 'cucumber/rake/task'
77
Cucumber::Rake::Task.new do |t|
79
t.cucumber_opts = %w{--quiet --no-color}
82
When I run `rake cucumber`
83
Then it should pass with:
88
Given I want to run this
90
1 scenario (1 undefined)
94
Scenario: respect requires
95
Given an empty file named "features/support/env.rb"
96
And an empty file named "features/support/dont_require_me.rb"
97
And the following profile is defined:
99
no_bomb: features/missing_step_definitions.feature:3 --require features/support/env.rb --verbose
101
And a file named "Rakefile" with:
103
require 'cucumber/rake/task'
105
Cucumber::Rake::Task.new do |t|
106
t.profile = "no_bomb"
107
t.cucumber_opts = %w{--quiet --no-color}
110
When I run `rake cucumber`
112
And the output should not contain:
114
* features/support/dont_require_me.rb
117
Scenario: feature files with spaces
118
Given a file named "features/spaces are nasty.feature" with:
120
Feature: The futures green
123
Given this is missing
125
And a file named "Rakefile" with:
127
require 'cucumber/rake/task'
129
Cucumber::Rake::Task.new do |t|
130
t.cucumber_opts = %w{--quiet --no-color}
133
When I run `rake cucumber`
134
Then it should pass with:
136
Feature: The futures green
139
Given this is missing