File tree 5 files changed +21
-12
lines changed
5 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 1
1
## [ In Git] ( https://github.com/cucumber/cucumber-ruby-core/compare/3.0.0.pre.2...master )
2
2
3
3
### New Features
4
- * Handle selective strict settings. ([ #143 ] ( https://github.com/cucumber/cucumber-ruby-core/pull/143 ) @brasmusson )
4
+ * Do not create test cases for scenarios with no steps ([ #144 ] ( https://github.com/cucumber/cucumber-ruby-core/pull/144 ) @brasmusson )
5
+ * Handle selective strict settings ([ #143 ] ( https://github.com/cucumber/cucumber-ruby-core/pull/143 ) @brasmusson )
5
6
6
7
### Bugfixes
7
8
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def on_step(source)
45
45
end
46
46
47
47
def on_test_case ( source )
48
- Test ::Case . new ( test_steps , source ) . describe_to ( receiver )
48
+ Test ::Case . new ( test_steps , source ) . describe_to ( receiver ) if test_steps . count > 0
49
49
@test_steps = nil
50
50
self
51
51
end
Original file line number Diff line number Diff line change @@ -157,6 +157,23 @@ def self.stubs(*names)
157
157
end
158
158
end
159
159
160
+ context 'empty scenarios' do
161
+ it 'does not create test cases for them' do
162
+ gherkin_documents = [
163
+ gherkin do
164
+ feature do
165
+ scenario do
166
+ end
167
+ end
168
+ end
169
+ ]
170
+ compile ( gherkin_documents ) do |visitor |
171
+ expect ( visitor ) . to receive ( :test_case ) . never
172
+ expect ( visitor ) . to receive ( :done ) . once . ordered
173
+ end
174
+ end
175
+ end
176
+
160
177
describe Compiler ::FeatureCompiler do
161
178
let ( :receiver ) { double ( 'receiver' ) }
162
179
let ( :compiler ) { Compiler ::FeatureCompiler . new ( receiver ) }
Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ module Test
277
277
gherkin = Gherkin ::Document . new ( 'features/treasure.feature' , %{# language: en-pirate
278
278
Ahoy matey!: Treasure map
279
279
Heave to: Find the treasure
280
- Gangway!: a map
280
+ Gangway! a map
281
281
} )
282
282
receiver = double . as_null_object
283
283
expect ( receiver ) . to receive ( :test_case ) do |test_case |
Original file line number Diff line number Diff line change @@ -96,8 +96,6 @@ module Cucumber::Core
96
96
Given a table
97
97
| a | b |
98
98
| 1 | 2 |
99
-
100
- Scenario: empty
101
99
END
102
100
end
103
101
@@ -112,13 +110,6 @@ def test_case_named(name)
112
110
expect ( receiver . test_case_locations ) . to eq [ test_case_named ( 'two' ) . location ]
113
111
end
114
112
115
- it 'matches the precise location of an empty scenario' do
116
- location = test_case_named ( 'empty' ) . location
117
- filter = Test ::LocationsFilter . new ( [ location ] )
118
- compile [ doc ] , receiver , [ filter ]
119
- expect ( receiver . test_case_locations ) . to eq [ test_case_named ( 'empty' ) . location ]
120
- end
121
-
122
113
it 'matches multiple locations' do
123
114
good_location = Ast ::Location . new ( file , 8 )
124
115
bad_location = Ast ::Location . new ( file , 5 )
You can’t perform that action at this time.
0 commit comments