cucumber 0.3.103 → 0.3.104

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/History.txt +27 -2
  2. data/Manifest.txt +10 -4
  3. data/examples/ramaze/README.textile +7 -0
  4. data/examples/ramaze/Rakefile +6 -0
  5. data/examples/ramaze/app.rb +21 -0
  6. data/examples/ramaze/features/add.feature +11 -0
  7. data/examples/ramaze/features/step_definitions/add_steps.rb +15 -0
  8. data/examples/ramaze/features/support/env.rb +32 -0
  9. data/examples/ramaze/layout/default.html.erb +8 -0
  10. data/examples/ramaze/view/index.html.erb +5 -0
  11. data/examples/sinatra/features/support/env.rb +1 -1
  12. data/features/cucumber_cli.feature +5 -5
  13. data/features/usage_and_stepdefs_formatter.feature +169 -0
  14. data/lib/cucumber/ast/step_invocation.rb +7 -0
  15. data/lib/cucumber/ast/tags.rb +6 -1
  16. data/lib/cucumber/ast/tree_walker.rb +5 -11
  17. data/lib/cucumber/cli/options.rb +20 -11
  18. data/lib/cucumber/formatter/html.rb +0 -2
  19. data/lib/cucumber/formatter/stepdefs.rb +14 -0
  20. data/lib/cucumber/formatter/usage.rb +106 -50
  21. data/lib/cucumber/language_support/language_methods.rb +6 -9
  22. data/lib/cucumber/rb_support/rb_language.rb +16 -3
  23. data/lib/cucumber/rb_support/rb_step_definition.rb +7 -1
  24. data/lib/cucumber/step_match.rb +4 -0
  25. data/lib/cucumber/step_mother.rb +8 -37
  26. data/lib/cucumber/version.rb +1 -1
  27. data/spec/cucumber/ast/background_spec.rb +0 -6
  28. data/spec/cucumber/ast/tree_walker_spec.rb +0 -7
  29. data/spec/cucumber/cli/options_spec.rb +12 -0
  30. data/spec/cucumber/formatter/html_spec.rb +0 -1
  31. data/spec/cucumber/rb_support/rb_step_definition_spec.rb +0 -9
  32. data/spec/cucumber/step_mother_spec.rb +13 -34
  33. metadata +12 -6
  34. data/features/steps_formatter.feature +0 -26
  35. data/features/usage.feature +0 -126
  36. data/lib/cucumber/formatter/profile.rb +0 -78
  37. data/lib/cucumber/formatters/unicode.rb +0 -7
@@ -1,4 +1,29 @@
1
- == 2009-09-24
1
+ == 0.3.104 2009-09-27
2
+
3
+ This release has some minor changes to the command line and formatters. The biggest change is internally, paving
4
+ the way for more programming language support in Cuke4Duke, which now supports step definitions written in Java, Scala,
5
+ Groovy, Clojure and Javascript!
6
+
7
+ === New Features
8
+ * "usage" formatter should display progress (#437 Aslak Hellesøy)
9
+ * Added example for Ramaze. (Yutaka HARA)
10
+
11
+ === Bugfixes
12
+ * Fixed regression in profile formatter from 0.3.102. (Aslak Hellesøy)
13
+ * Raise a proper error message if someone forgets @ for tags, example: --tags ~foo or --tags bar. (Aslak Hellesøy)
14
+ * lib/cucumber/formatter/html.rb requires xml (#458 Brent Snook)
15
+ * lib/cucumber/formatter/html.rb requires ruby-debug (#455 Assaf Arkin)
16
+ * Allow for STDOUT formatters to be defined in profiles. Addresses an Autotest plugin issue. (#375 Gabriel Medina)
17
+
18
+ === Removed features
19
+ * The --dry-run option no longer implies --no-source and --no-snippets. It only implies --no-snippets. (Aslak Hellesøy)
20
+
21
+ === Changed features
22
+ * The profile and usage formatters have been combined to the usage formatter. Use it eith or without --dry-run. See --help for more. (Aslak Hellesøy)
23
+ * The steps formatter has been renamed to stepdefs formatter. (Aslak Hellesøy)
24
+ * The internal programming language API has changed, giving more power to the implementation. See #428. (Aslak Hellesøy)
25
+
26
+ == 0.3.103 2009-09-24
2
27
 
3
28
  This release gives you back some of the control over the Rails environment that was accidentally taken away from you in the
4
29
  previous release.
@@ -16,7 +41,7 @@ Using this release on a Rails project requires a rerun of script/generate cucumb
16
41
  === Changed Features
17
42
  * The Formatter API has completely changed. Formatters are no longer a double-dispacth visitor - just a single-dispatch listener (#438 Matt Wynne)
18
43
 
19
- == 2009-09-22
44
+ == 0.3.102 2009-09-22
20
45
 
21
46
  This release has some changes in the Rails support, so make sure you run "script/generate cucumber" after you upgrade.
22
47
  Other noteworthy new features are improved Hook, tags and Transform support, and as always - several smaler bug fixes.
@@ -180,6 +180,14 @@ examples/python/features/step_definitions/fib_steps.py
180
180
  examples/python/features/step_definitions/fib_steps.rb
181
181
  examples/python/features/support/env.rb
182
182
  examples/python/lib/fib.py
183
+ examples/ramaze/README.textile
184
+ examples/ramaze/Rakefile
185
+ examples/ramaze/app.rb
186
+ examples/ramaze/features/add.feature
187
+ examples/ramaze/features/step_definitions/add_steps.rb
188
+ examples/ramaze/features/support/env.rb
189
+ examples/ramaze/layout/default.html.erb
190
+ examples/ramaze/view/index.html.erb
183
191
  examples/selenium/Rakefile
184
192
  examples/selenium/features/search.feature
185
193
  examples/selenium/features/step_definitons/search_steps.rb
@@ -288,12 +296,11 @@ features/report_called_undefined_steps.feature
288
296
  features/snippet.feature
289
297
  features/step_definitions/cucumber_steps.rb
290
298
  features/step_definitions/extra_steps.rb
291
- features/steps_formatter.feature
292
299
  features/support/env.rb
293
300
  features/table_diffing.feature
294
301
  features/transform.feature
295
302
  features/unicode_table.feature
296
- features/usage.feature
303
+ features/usage_and_stepdefs_formatter.feature
297
304
  features/work_in_progress.feature
298
305
  gem_tasks/contributors.rake
299
306
  gem_tasks/deployment.rake
@@ -355,14 +362,13 @@ lib/cucumber/formatter/junit.rb
355
362
  lib/cucumber/formatter/ordered_xml_markup.rb
356
363
  lib/cucumber/formatter/pdf.rb
357
364
  lib/cucumber/formatter/pretty.rb
358
- lib/cucumber/formatter/profile.rb
359
365
  lib/cucumber/formatter/progress.rb
360
366
  lib/cucumber/formatter/rerun.rb
367
+ lib/cucumber/formatter/stepdefs.rb
361
368
  lib/cucumber/formatter/steps.rb
362
369
  lib/cucumber/formatter/tag_cloud.rb
363
370
  lib/cucumber/formatter/unicode.rb
364
371
  lib/cucumber/formatter/usage.rb
365
- lib/cucumber/formatters/unicode.rb
366
372
  lib/cucumber/language_support.rb
367
373
  lib/cucumber/language_support/language_methods.rb
368
374
  lib/cucumber/language_support/step_definition_methods.rb
@@ -0,0 +1,7 @@
1
+ h1. Ramaze and Cucumber
2
+
3
+ This example will work with:
4
+
5
+ * ramaze 2009.07
6
+ * rack-test 0.5.0
7
+ * webrat 0.5.3
@@ -0,0 +1,6 @@
1
+ $:.unshift(File.dirname(__FILE__) + '/../../lib')
2
+ require 'cucumber/rake/task'
3
+
4
+ Cucumber::Rake::Task.new do |t|
5
+ t.cucumber_opts = %w{--format pretty}
6
+ end
@@ -0,0 +1,21 @@
1
+ begin
2
+ require 'ramaze'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ require 'ramaze'
6
+ end
7
+
8
+ class Main < Ramaze::Controller
9
+ engine :ERB
10
+ layout :default
11
+
12
+ def index
13
+ # just render views/index.html.erb
14
+ end
15
+
16
+ def add
17
+ "Answer: #{request[:first].to_i + request[:second].to_i}"
18
+ end
19
+ end
20
+
21
+ Ramaze.start :root => __DIR__
@@ -0,0 +1,11 @@
1
+ Feature: Addition
2
+ In order to avoid silly mistakes
3
+ As a math idiot
4
+ I want to be told the sum of two numbers
5
+
6
+ Scenario: Add two numbers
7
+ Given I visit the calculator page
8
+ And I fill in '50' for 'first'
9
+ And I fill in '70' for 'second'
10
+ When I press 'Add'
11
+ Then I should see 'Answer: 120'
@@ -0,0 +1,15 @@
1
+ Given /^I visit the calculator page$/ do
2
+ visit '/'
3
+ end
4
+
5
+ Given /^I fill in '(.*)' for '(.*)'$/ do |value, field|
6
+ fill_in(field, :with => value)
7
+ end
8
+
9
+ When /^I press '(.*)'$/ do |name|
10
+ click_button(name)
11
+ end
12
+
13
+ Then /^I should see '(.*)'$/ do |text|
14
+ response_body.should contain(/#{text}/m)
15
+ end
@@ -0,0 +1,32 @@
1
+ # See http://wiki.github.com/aslakhellesoy/cucumber/ramaze
2
+ # for more details about Ramaze with Cucumber
3
+
4
+ gem 'ramaze', '>= 2009.07'
5
+ gem 'rack-test', '>= 0.5.0'
6
+ gem 'webrat', '>= 0.5.3'
7
+
8
+ require 'ramaze'
9
+ Ramaze.options.started = true
10
+ require __DIR__("../../app.rb")
11
+
12
+ require 'spec/expectations'
13
+ require 'rack/test'
14
+ require 'webrat'
15
+
16
+ Webrat.configure do |config|
17
+ config.mode = :rack
18
+ end
19
+
20
+ class MyWorld
21
+ include Rack::Test::Methods
22
+ include Webrat::Methods
23
+ include Webrat::Matchers
24
+
25
+ Webrat::Methods.delegate_to_session :response_code, :response_body
26
+
27
+ def app
28
+ Ramaze::middleware
29
+ end
30
+ end
31
+
32
+ World{MyWorld.new}
@@ -0,0 +1,8 @@
1
+ <html>
2
+ <head>
3
+ <title>Addition</title>
4
+ </head>
5
+ <body>
6
+ <%= @content %>
7
+ </body>
8
+ </html>
@@ -0,0 +1,5 @@
1
+ <form method='post' action='/add'>
2
+ <input name='first'/>
3
+ <input name='second'/>
4
+ <input type='submit' value='Add'/>
5
+ </form>
@@ -1,7 +1,7 @@
1
1
  # See http://wiki.github.com/aslakhellesoy/cucumber/sinatra
2
2
  # for more details about Sinatra with Cucumber
3
3
 
4
- gem 'rack-test', '=0.4.1'
4
+ gem 'rack-test', '>=0.5.0'
5
5
  gem 'sinatra', '=0.9.4'
6
6
 
7
7
  app_file = File.join(File.dirname(__FILE__), *%w[.. .. app.rb])
@@ -201,7 +201,7 @@ Feature: Cucumber command line
201
201
  """
202
202
 
203
203
  Scenario: --dry-run
204
- When I run cucumber --dry-run --no-snippets features/*.feature --tags ~@lots
204
+ When I run cucumber --dry-run --no-source features/*.feature --tags ~@lots
205
205
  Then it should pass with
206
206
  """
207
207
  Feature: Calling undefined step
@@ -370,7 +370,7 @@ Feature: Cucumber command line
370
370
  """
371
371
 
372
372
  Scenario: Multiple formatters and outputs
373
- When I run cucumber --format progress --out tmp/progress.txt --format pretty --out tmp/pretty.txt --dry-run features/lots_of_undefined.feature
373
+ When I run cucumber --format progress --out tmp/progress.txt --format pretty --out tmp/pretty.txt --no-source --dry-run features/lots_of_undefined.feature
374
374
  And "examples/self_test/tmp/progress.txt" should contain
375
375
  """
376
376
  UUUUU
@@ -505,7 +505,7 @@ Feature: Cucumber command line
505
505
  """
506
506
 
507
507
  Scenario: Run with a negative tag
508
- When I run cucumber -q features/sample.feature --dry-run --tags ~@four
508
+ When I run cucumber -q features/sample.feature --no-source --dry-run --tags ~@four
509
509
  Then it should pass with
510
510
  """
511
511
  # Feature comment
@@ -529,7 +529,7 @@ Feature: Cucumber command line
529
529
  """
530
530
 
531
531
  Scenario: Run with limited tag count, blowing it on scenario
532
- When I run cucumber -q features/tags_sample.feature --dry-run --tags @sample_three:1
532
+ When I run cucumber -q features/tags_sample.feature --no-source --dry-run --tags @sample_three:1
533
533
  Then it should fail with
534
534
  """
535
535
  @sample_one
@@ -557,7 +557,7 @@ Feature: Cucumber command line
557
557
  """
558
558
 
559
559
  Scenario: Run with limited tag count, blowing it via feature inheritance
560
- When I run cucumber -q features/tags_sample.feature --dry-run --tags @sample_one:1
560
+ When I run cucumber -q features/tags_sample.feature --no-source --dry-run --tags @sample_one:1
561
561
  Then it should fail with
562
562
  """
563
563
  @sample_one
@@ -0,0 +1,169 @@
1
+ Feature: Cucumber command line
2
+ In order to be able to write an editor plugin that can jump between
3
+ steps and step definitions, Cucumber must provide a way to
4
+ display how they are related.
5
+
6
+ @mri186
7
+ Scenario: List usage of step definitions
8
+ When I run cucumber features --format usage --dry-run
9
+ Then it should pass with
10
+ """
11
+ -------------------------------------UU-U--------------UUUUU---------U-------U--------------U-UU-------------------------------------------------UU
12
+
13
+ /^'(.+)' cukes$/ # features/step_definitions/sample_steps.rb:27
14
+ Given '10' cukes # features/background/background_with_name.feature:4
15
+ Given '10' cukes # features/background/background_with_name.feature:4
16
+ And '10' cukes # features/background/failing_background.feature:6
17
+ And '10' cukes # features/background/failing_background.feature:6
18
+ And '10' cukes # features/background/failing_background.feature:6
19
+ Given '10' cukes # features/background/passing_background.feature:4
20
+ Given '10' cukes # features/background/passing_background.feature:4
21
+ Given '10' cukes # features/background/passing_background.feature:4
22
+ Given '10' cukes # features/background/scenario_outline_passing_background.feature:4
23
+ Given '2' cukes # features/tons_of_cukes.feature:4
24
+ Given '2' cukes # features/tons_of_cukes.feature:5
25
+ Given '2' cukes # features/tons_of_cukes.feature:6
26
+ Given '2' cukes # features/tons_of_cukes.feature:7
27
+ Given '2' cukes # features/tons_of_cukes.feature:8
28
+ Given '2' cukes # features/tons_of_cukes.feature:9
29
+ Given '2' cukes # features/tons_of_cukes.feature:10
30
+ Given '2' cukes # features/tons_of_cukes.feature:11
31
+ Given '2' cukes # features/tons_of_cukes.feature:12
32
+ Given '2' cukes # features/tons_of_cukes.feature:13
33
+ Given '2' cukes # features/tons_of_cukes.feature:14
34
+ Given '2' cukes # features/tons_of_cukes.feature:15
35
+ Given '2' cukes # features/tons_of_cukes.feature:16
36
+ Given '2' cukes # features/tons_of_cukes.feature:17
37
+ Given '2' cukes # features/tons_of_cukes.feature:18
38
+ Given '2' cukes # features/tons_of_cukes.feature:19
39
+ Given '2' cukes # features/tons_of_cukes.feature:20
40
+ Given '2' cukes # features/tons_of_cukes.feature:21
41
+ Given '2' cukes # features/tons_of_cukes.feature:22
42
+ Given '2' cukes # features/tons_of_cukes.feature:23
43
+ Given '2' cukes # features/tons_of_cukes.feature:24
44
+ Given '2' cukes # features/tons_of_cukes.feature:25
45
+ Given '2' cukes # features/tons_of_cukes.feature:26
46
+ Given '2' cukes # features/tons_of_cukes.feature:27
47
+ Given '2' cukes # features/tons_of_cukes.feature:28
48
+ Given '2' cukes # features/tons_of_cukes.feature:29
49
+ Given '2' cukes # features/tons_of_cukes.feature:30
50
+ Given '2' cukes # features/tons_of_cukes.feature:31
51
+ Given '2' cukes # features/tons_of_cukes.feature:32
52
+ Given '2' cukes # features/tons_of_cukes.feature:33
53
+ Given '2' cukes # features/tons_of_cukes.feature:34
54
+ Given '2' cukes # features/tons_of_cukes.feature:35
55
+ Given '2' cukes # features/tons_of_cukes.feature:36
56
+ Given '2' cukes # features/tons_of_cukes.feature:37
57
+ Given '2' cukes # features/tons_of_cukes.feature:38
58
+ Given '2' cukes # features/tons_of_cukes.feature:39
59
+ Given '2' cukes # features/tons_of_cukes.feature:40
60
+ Given '2' cukes # features/tons_of_cukes.feature:41
61
+ Given '2' cukes # features/tons_of_cukes.feature:42
62
+ Given '2' cukes # features/tons_of_cukes.feature:43
63
+ Given '2' cukes # features/tons_of_cukes.feature:44
64
+ Given '2' cukes # features/tons_of_cukes.feature:45
65
+ Given '2' cukes # features/tons_of_cukes.feature:46
66
+ Given '2' cukes # features/tons_of_cukes.feature:47
67
+ Given '2' cukes # features/tons_of_cukes.feature:48
68
+ Given '2' cukes # features/tons_of_cukes.feature:49
69
+ Given '2' cukes # features/tons_of_cukes.feature:50
70
+ Given '2' cukes # features/tons_of_cukes.feature:51
71
+ Given '2' cukes # features/tons_of_cukes.feature:52
72
+ /^'(.+)' global cukes$/ # features/step_definitions/sample_steps.rb:35
73
+ And '10' global cukes # features/background/failing_background_after_success.feature:5
74
+ And '10' global cukes # features/background/failing_background_after_success.feature:5
75
+ And '10' global cukes # features/background/failing_background_after_success.feature:5
76
+ /^I should have '(.+)' cukes$/ # features/step_definitions/sample_steps.rb:31
77
+ Then I should have '10' cukes # features/background/background_with_name.feature:7
78
+ Then I should have '10' cukes # features/background/failing_background.feature:9
79
+ Then I should have '10' cukes # features/background/failing_background.feature:12
80
+ Then I should have '10' cukes # features/background/passing_background.feature:7
81
+ Then I should have '10' cukes # features/background/passing_background.feature:10
82
+ Then I should have '10' cukes # features/background/pending_background.feature:7
83
+ Then I should have '10' cukes # features/background/pending_background.feature:10
84
+ /^I should have '(.+)' global cukes$/ # features/step_definitions/sample_steps.rb:42
85
+ Then I should have '10' global cukes # features/background/failing_background_after_success.feature:8
86
+ Then I should have '10' global cukes # features/background/failing_background_after_success.feature:11
87
+ /^a step definition that calls an undefined step$/ # features/step_definitions/sample_steps.rb:19
88
+ Given a step definition that calls an undefined step # features/call_undefined_step_from_step_def.feature:4
89
+ /^another unused$/ # features/step_definitions/sample_steps.rb:69
90
+ NOT MATCHED BY ANY STEPS
91
+ /^call step "(.*)"$/ # features/step_definitions/sample_steps.rb:23
92
+ Given call step "a step definition that calls an undefined step" # features/call_undefined_step_from_step_def.feature:7
93
+ /^failing expectation$/ # features/step_definitions/sample_steps.rb:62
94
+ Given failing expectation # features/failing_expectation.feature:4
95
+ /^failing without a table$/ # features/step_definitions/sample_steps.rb:15
96
+ Given failing without a table # features/background/failing_background.feature:5
97
+ Given failing without a table # features/background/failing_background.feature:5
98
+ Given failing without a table # features/background/failing_background.feature:5
99
+ Given failing without a table # features/background/scenario_outline_failing_background.feature:4
100
+ Given failing without a table # features/search_sample.feature:10
101
+ /^failing$/ # features/step_definitions/sample_steps.rb:8
102
+ Given failing # features/sample.feature:18
103
+ /^multiline string$/ # features/step_definitions/sample_steps.rb:50
104
+ And multiline string # features/background/multiline_args_background.feature:7
105
+ And multiline string # features/background/multiline_args_background.feature:7
106
+ And multiline string # features/background/multiline_args_background.feature:7
107
+ /^passing without a table$/ # features/step_definitions/sample_steps.rb:12
108
+ Given passing without a table # features/background/background_tagged_before_on_outline.feature:5
109
+ Given passing without a table # features/background/failing_background_after_success.feature:4
110
+ Given passing without a table # features/background/failing_background_after_success.feature:4
111
+ Given passing without a table # features/background/failing_background_after_success.feature:4
112
+ Given passing without a table # features/multiline_name.feature:6
113
+ Given passing without a table # features/multiline_name.feature:6
114
+ Given passing without a table # features/multiline_name.feature:11
115
+ Given passing without a table # features/search_sample.feature:4
116
+ Given passing without a table # features/search_sample.feature:4
117
+ Given passing without a table # features/search_sample.feature:7
118
+ Given passing without a table # features/search_sample.feature:4
119
+ /^passing$/ # features/step_definitions/sample_steps.rb:5
120
+ Given passing # features/sample.feature:12
121
+ /^table$/ # features/step_definitions/sample_steps.rb:46
122
+ Given table # features/background/multiline_args_background.feature:4
123
+ Given table # features/background/multiline_args_background.feature:4
124
+ Given table # features/background/multiline_args_background.feature:4
125
+ /^the multiline string should be$/ # features/step_definitions/sample_steps.rb:58
126
+ Then the multiline string should be # features/background/multiline_args_background.feature:17
127
+ Then the multiline string should be # features/background/multiline_args_background.feature:27
128
+ /^the table should be$/ # features/step_definitions/sample_steps.rb:54
129
+ Then the table should be # features/background/multiline_args_background.feature:14
130
+ Then the table should be # features/background/multiline_args_background.feature:24
131
+ /^unused$/ # features/step_definitions/sample_steps.rb:66
132
+ NOT MATCHED BY ANY STEPS
133
+
134
+ 43 scenarios (32 skipped, 10 undefined, 1 passed)
135
+ 131 steps (117 skipped, 14 undefined)
136
+
137
+ """
138
+
139
+ @mri186
140
+ Scenario: --format steps
141
+ When I run cucumber features --format stepdefs --dry-run
142
+ Then it should pass with
143
+ """
144
+ -------------------------------------UU-U--------------UUUUU---------U-------U--------------U-UU-------------------------------------------------UU
145
+
146
+ /^'(.+)' cukes$/ # features/step_definitions/sample_steps.rb:27
147
+ /^'(.+)' global cukes$/ # features/step_definitions/sample_steps.rb:35
148
+ /^I should have '(.+)' cukes$/ # features/step_definitions/sample_steps.rb:31
149
+ /^I should have '(.+)' global cukes$/ # features/step_definitions/sample_steps.rb:42
150
+ /^a step definition that calls an undefined step$/ # features/step_definitions/sample_steps.rb:19
151
+ /^another unused$/ # features/step_definitions/sample_steps.rb:69
152
+ NOT MATCHED BY ANY STEPS
153
+ /^call step "(.*)"$/ # features/step_definitions/sample_steps.rb:23
154
+ /^failing expectation$/ # features/step_definitions/sample_steps.rb:62
155
+ /^failing without a table$/ # features/step_definitions/sample_steps.rb:15
156
+ /^failing$/ # features/step_definitions/sample_steps.rb:8
157
+ /^multiline string$/ # features/step_definitions/sample_steps.rb:50
158
+ /^passing without a table$/ # features/step_definitions/sample_steps.rb:12
159
+ /^passing$/ # features/step_definitions/sample_steps.rb:5
160
+ /^table$/ # features/step_definitions/sample_steps.rb:46
161
+ /^the multiline string should be$/ # features/step_definitions/sample_steps.rb:58
162
+ /^the table should be$/ # features/step_definitions/sample_steps.rb:54
163
+ /^unused$/ # features/step_definitions/sample_steps.rb:66
164
+ NOT MATCHED BY ANY STEPS
165
+
166
+ 43 scenarios (32 skipped, 10 undefined, 1 passed)
167
+ 131 steps (117 skipped, 14 undefined)
168
+
169
+ """
@@ -11,6 +11,13 @@ module Cucumber
11
11
  attr_reader :name, :matched_cells, :status, :reported_exception
12
12
  attr_accessor :exception
13
13
 
14
+ class << self
15
+ SEVERITY = [:passed, :undefined, :pending, :skipped, :failed]
16
+ def worst_status(statuses)
17
+ SEVERITY[statuses.map{|status| SEVERITY.index(status)}.max]
18
+ end
19
+ end
20
+
14
21
  def initialize(step, name, multiline_arg, matched_cells)
15
22
  @step, @name, @multiline_arg, @matched_cells = step, name, multiline_arg, matched_cells
16
23
  status!(:skipped)
@@ -13,6 +13,7 @@ module Cucumber
13
13
  def matches?(source_tag_names, tag_names)
14
14
  exclude_tag_names, include_tag_names = tag_names.partition{|tag_name| exclude_tag?(tag_name)}
15
15
  exclude_tag_names.map!{|name| name[1..-1]}
16
+ check_at_sign_prefix(exclude_tag_names + include_tag_names)
16
17
  !excluded?(source_tag_names, exclude_tag_names) && included?(source_tag_names, include_tag_names)
17
18
  end
18
19
 
@@ -21,7 +22,11 @@ module Cucumber
21
22
  end
22
23
 
23
24
  private
24
-
25
+
26
+ def check_at_sign_prefix(tag_names)
27
+ tag_names.each{|tag_name| raise "Tag names must start with an @ sign. The following tag name didn't: #{tag_name}" unless tag_name[0..0] == '@'}
28
+ end
29
+
25
30
  def excluded?(source_tag_names, query_tag_names)
26
31
  source_tag_names.any? && (source_tag_names & query_tag_names).any?
27
32
  end