@@ -56,20 +56,19 @@ def write_file(feature_filename, data)
5656 end
5757
5858 define_steps do
59- Given ( / a passing scenario/ ) do
59+ Given ( ' a passing scenario' ) do
6060 Kernel . puts 'foo'
6161 end
6262 end
6363
64- define_feature <<- FEATURE
65- Feature: One passing feature
64+ define_feature <<~ FEATURE
65+ Feature: One passing feature
6666
67- Scenario: Passing
68- Given a passing scenario
67+ Scenario: Passing
68+ Given a passing scenario
6969 FEATURE
7070
7171 it 'will contain the file attribute' do
72- expect ( @doc . xpath ( '//testsuite/testcase/@file' ) . size ) . to equal 1
7372 expect ( @doc . xpath ( '//testsuite/testcase/@file' ) . first . value ) . to eq ( 'spec.feature' )
7473 end
7574 end
@@ -93,20 +92,20 @@ def write_file(feature_filename, data)
9392 end
9493
9594 define_steps do
96- Given ( / a passing scenario/ ) do
95+ Given ( ' a passing scenario' ) do
9796 Kernel . puts 'foo'
9897 end
9998 end
10099
101- define_feature <<- FEATURE
102- Feature: One passing feature
100+ define_feature <<~ FEATURE
101+ Feature: One passing feature
103102
104- Scenario: Passing
105- Given a passing scenario
103+ Scenario: Passing
104+ Given a passing scenario
106105 FEATURE
107106
108107 it 'will not contain the file attribute' do
109- expect ( @doc . xpath ( '//testsuite/testcase/@file' ) . size ) . to equal 0
108+ expect ( @doc . xpath ( '//testsuite/testcase/@file' ) ) . to be_empty
110109 end
111110 end
112111 end
@@ -124,20 +123,20 @@ def write_file(feature_filename, data)
124123 end
125124
126125 define_steps do
127- Given ( / a passing scenario/ ) do
126+ Given ( ' a passing scenario' ) do
128127 Kernel . puts 'foo'
129128 end
130129 end
131130
132- define_feature <<- FEATURE
133- Feature: One passing scenario
131+ define_feature <<~ FEATURE
132+ Feature: One passing feature
134133
135- Scenario: Passing
136- Given a passing scenario
134+ Scenario: Passing
135+ Given a passing scenario
137136 FEATURE
138137
139138 it 'will not contain the file attribute' do
140- expect ( @doc . xpath ( '//testsuite/testcase/@file' ) . size ) . to equal 0
139+ expect ( @doc . xpath ( '//testsuite/testcase/@file' ) ) . to be_empty
141140 end
142141 end
143142 end
@@ -155,23 +154,23 @@ def write_file(feature_filename, data)
155154 end
156155
157156 define_steps do
158- Given ( / a passing ctrl scenario/ ) do
157+ Given ( ' a passing ctrl scenario' ) do
159158 Kernel . puts "boo\b \c x\e \a \f boo "
160159 end
161160 end
162161
163- define_feature <<- FEATURE
164- Feature: One passing scenario, one failing scenario
162+ define_feature <<~ FEATURE
163+ Feature: One passing scenario, one failing scenario
165164
166- Scenario: Passing
167- Given a passing ctrl scenario
165+ Scenario: Passing
166+ Given a passing ctrl scenario
168167 FEATURE
169168
170169 it { expect ( @doc . xpath ( '//testsuite/testcase/system-out' ) . first . content ) . to match ( /\s +boo boo\s +/ ) }
171170 end
172171
173172 describe 'a feature with no name' do
174- define_feature <<- FEATURE
173+ define_feature <<~ FEATURE
175174 Feature:
176175 Scenario: Passing
177176 Given a passing scenario
@@ -189,7 +188,7 @@ def write_file(feature_filename, data)
189188 end
190189
191190 describe 'with a single scenario' do
192- define_feature <<- FEATURE
191+ define_feature <<~ FEATURE
193192 Feature: One passing scenario, one failing scenario
194193
195194 Scenario: Passing
@@ -199,19 +198,19 @@ def write_file(feature_filename, data)
199198 it { expect ( @doc . to_s ) . to match ( /One passing scenario, one failing scenario/ ) }
200199
201200 it 'has not a root system-out node' do
202- expect ( @doc . xpath ( '//testsuite/system-out' ) . size ) . to eq 0
201+ expect ( @doc . xpath ( '//testsuite/system-out' ) ) . to be_empty
203202 end
204203
205204 it 'has not a root system-err node' do
206- expect ( @doc . xpath ( '//testsuite/system-err' ) . size ) . to eq 0
205+ expect ( @doc . xpath ( '//testsuite/system-err' ) ) . to be_empty
207206 end
208207
209208 it 'has a system-out node under <testcase/>' do
210- expect ( @doc . xpath ( '//testcase/system-out' ) . size ) . to eq 1
209+ expect ( @doc . xpath ( '//testcase/system-out' ) . length ) . to eq ( 1 )
211210 end
212211
213212 it 'has a system-err node under <testcase/>' do
214- expect ( @doc . xpath ( '//testcase/system-err' ) . size ) . to eq 1
213+ expect ( @doc . xpath ( '//testcase/system-err' ) . length ) . to eq ( 1 )
215214 end
216215 end
217216
@@ -224,44 +223,45 @@ def write_file(feature_filename, data)
224223 ) , File . join ( 'features' , 'some' , 'path' , 'spec.feature' )
225224
226225 it 'writes the filename with absolute path' do
227- expect ( @formatter . written_files . keys . first ) . to eq File . absolute_path ( 'TEST-features-some-path-spec.xml' )
226+ expect ( @formatter . written_files . keys . first ) . to eq ( File . absolute_path ( 'TEST-features-some-path-spec.xml' ) )
228227 end
229228 end
230229
231230 describe 'with a scenario outline table' do
232231 define_steps do
233- Given ( /.*/ ) { }
232+ Given ( '{word}' ) { }
234233 end
235234
236- define_feature <<- FEATURE
235+ define_feature <<~ FEATURE
237236 Feature: Eat things when hungry
238237
239- Scenario Outline: Eat things
240- Given <Things >
238+ Scenario Outline: Eat variety of things
239+ Given <things >
241240 And stuff:
242241 | foo |
243242 | bar |
244243
245244 Examples: Good
246- | Things |
245+ | things |
247246 | Cucumber |
248- | Whisky |
247+
249248 Examples: Evil
250- | Things |
251- | Big Mac |
249+ | things |
250+ | Burger |
251+ | Whisky |
252252 FEATURE
253253
254254 it { expect ( @doc . to_s ) . to match ( /Eat things when hungry/ ) }
255255 it { expect ( @doc . to_s ) . to match ( /Cucumber/ ) }
256+ it { expect ( @doc . to_s ) . to match ( /Burger/ ) }
256257 it { expect ( @doc . to_s ) . to match ( /Whisky/ ) }
257- it { expect ( @doc . to_s ) . to match ( /Big Mac/ ) }
258- it { expect ( @doc . to_s ) . not_to match ( /Things/ ) }
258+ it { expect ( @doc . to_s ) . not_to match ( /Cake/ ) }
259259 it { expect ( @doc . to_s ) . not_to match ( /Good|Evil/ ) }
260260 it { expect ( @doc . to_s ) . not_to match ( /type="skipped"/ ) }
261261 end
262262
263263 describe 'scenario with skipped test in junit report' do
264- define_feature <<- FEATURE
264+ define_feature <<~ FEATURE
265265 Feature: junit report with skipped test
266266
267267 Scenario Outline: skip a test and junit report of the same
@@ -283,7 +283,7 @@ def write_file(feature_filename, data)
283283 Then ( /I should have visited at least/ ) { |table | }
284284 end
285285
286- define_feature <<- FEATURE
286+ define_feature <<~ FEATURE
287287 Feature: Shortlist
288288
289289 Scenario: Procure items
@@ -306,14 +306,15 @@ def write_file(feature_filename, data)
306306 Before do
307307 raise 'Before hook failed'
308308 end
309- Given ( / a passing step/ ) do
309+ Given ( ' a passing step' ) do
310310 end
311311 end
312- define_feature <<-FEATURE
313- Feature: One passing scenario
314312
315- Scenario: Passing
316- Given a passing step
313+ define_feature <<~FEATURE
314+ Feature: One passing scenario
315+
316+ Scenario: Passing
317+ Given a passing step
317318 FEATURE
318319
319320 it { expect ( @doc . to_s ) . to match ( /Before hook at spec\/ cucumber\/ formatter\/ junit_spec.rb:(\d +)/ ) }
@@ -324,14 +325,14 @@ def write_file(feature_filename, data)
324325 After do
325326 raise 'After hook failed'
326327 end
327- Given ( / a passing step/ ) do
328+ Given ( ' a passing step' ) do
328329 end
329330 end
330- define_feature <<- FEATURE
331- Feature: One passing scenario
331+ define_feature <<~ FEATURE
332+ Feature: One passing scenario
332333
333- Scenario: Passing
334- Given a passing step
334+ Scenario: Passing
335+ Given a passing step
335336 FEATURE
336337
337338 it { expect ( @doc . to_s ) . to match ( /After hook at spec\/ cucumber\/ formatter\/ junit_spec.rb:(\d +)/ ) }
@@ -342,14 +343,14 @@ def write_file(feature_filename, data)
342343 AfterStep do
343344 raise 'AfterStep hook failed'
344345 end
345- Given ( / a passing step/ ) do
346+ Given ( ' a passing step' ) do
346347 end
347348 end
348- define_feature <<- FEATURE
349- Feature: One passing scenario
349+ define_feature <<~ FEATURE
350+ Feature: One passing scenario
350351
351- Scenario: Passing
352- Given a passing step
352+ Scenario: Passing
353+ Given a passing step
353354 FEATURE
354355
355356 it { expect ( @doc . to_s ) . to match ( /AfterStep hook at spec\/ cucumber\/ formatter\/ junit_spec.rb:(\d +)/ ) }
@@ -361,14 +362,14 @@ def write_file(feature_filename, data)
361362 block . call
362363 raise 'Around hook failed'
363364 end
364- Given ( / a passing step/ ) do
365+ Given ( ' a passing step' ) do
365366 end
366367 end
367- define_feature <<- FEATURE
368- Feature: One passing scenario
368+ define_feature <<~ FEATURE
369+ Feature: One passing scenario
369370
370- Scenario: Passing
371- Given a passing step
371+ Scenario: Passing
372+ Given a passing step
372373 FEATURE
373374
374375 it { expect ( @doc . to_s ) . to match ( /Around hook\n \n Message:/ ) }
@@ -393,31 +394,32 @@ def write_file(feature_filename, data)
393394
394395 describe 'with a scenario outline table' do
395396 define_steps do
396- Given ( /.*/ ) { }
397+ Given ( '{word}' ) { }
397398 end
398399
399- define_feature <<- FEATURE
400+ define_feature <<~ FEATURE
400401 Feature: Eat things when hungry
401402
402403 Scenario Outline: Eat things
403- Given <Things >
404+ Given <things >
404405 And stuff:
405406 | foo |
406407 | bar |
407408
408409 Examples: Good
409- | Things |
410+ | things |
410411 | Cucumber |
411- | Whisky |
412+
412413 Examples: Evil
413- | Things |
414- | Big Mac |
414+ | things |
415+ | Burger |
416+ | Whisky |
415417 FEATURE
416418
417419 it { expect ( @doc . to_s ) . to match ( /Eat things when hungry/ ) }
418420 it { expect ( @doc . to_s ) . to match ( /Cucumber/ ) }
419421 it { expect ( @doc . to_s ) . to match ( /Whisky/ ) }
420- it { expect ( @doc . to_s ) . to match ( /Big Mac / ) }
422+ it { expect ( @doc . to_s ) . to match ( /Burger / ) }
421423 it { expect ( @doc . to_s ) . not_to match ( /Things/ ) }
422424 it { expect ( @doc . to_s ) . not_to match ( /Good|Evil/ ) }
423425 it { expect ( @doc . to_s ) . not_to match ( /type="skipped"/ ) }
0 commit comments