kosmas58-cucumber 0.2.2.1 → 0.2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. data/History.txt +57 -5
  2. data/Manifest.txt +21 -4
  3. data/bin/cucumber +1 -1
  4. data/config/hoe.rb +2 -2
  5. data/examples/i18n/Rakefile +6 -8
  6. data/examples/i18n/ar/features/step_definitons/calculator_steps.rb +1 -1
  7. data/examples/i18n/ar/lib/calculator.rb +1 -0
  8. data/examples/i18n/da/features/step_definitons/kalkulator_steps.rb +1 -1
  9. data/examples/i18n/de/features/step_definitons/calculator_steps.rb +1 -1
  10. data/examples/i18n/en/features/step_definitons/calculator_steps.rb +1 -1
  11. data/examples/i18n/es/features/step_definitons/calculador_steps.rb +1 -1
  12. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +1 -1
  13. data/examples/i18n/fi/features/step_definitons/laskin_steps.rb +1 -1
  14. data/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb +1 -1
  15. data/examples/i18n/id/features/step_definitons/calculator_steps.rb +1 -1
  16. data/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb +1 -1
  17. data/examples/i18n/ja/features/step_definitons/calculator_steps.rb +1 -1
  18. data/examples/i18n/ko/features/addition.feature +1 -1
  19. data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +1 -1
  20. data/examples/i18n/lt/features/step_definitons/calculator_steps.rb +1 -1
  21. data/examples/i18n/no/features/support/env.rb +1 -1
  22. data/examples/i18n/pt/features/step_definitions/calculadora_steps.rb +1 -1
  23. data/examples/i18n/ro/features/step_definitons/calculator_steps.rb +1 -1
  24. data/examples/i18n/ru/features/support/env.rb +1 -1
  25. data/examples/i18n/ru/features/support/world.rb +4 -3
  26. data/examples/i18n/se/features/step_definitons/kalkulator_steps.rb +1 -1
  27. data/examples/i18n/sk/Rakefile +6 -0
  28. data/examples/i18n/sk/features/addition.feature +16 -0
  29. data/examples/i18n/sk/features/division.feature +9 -0
  30. data/examples/i18n/sk/features/step_definitons/calculator_steps.rb +24 -0
  31. data/examples/i18n/sk/lib/calculator.rb +14 -0
  32. data/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb +1 -1
  33. data/examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb +1 -1
  34. data/examples/self_test/features/background/background_with_name.feature +7 -0
  35. data/examples/self_test/features/step_definitions/sample_steps.rb +8 -2
  36. data/examples/self_test/features/undefined_multiline_args.feature +12 -0
  37. data/examples/sinatra/features/support/env.rb +2 -6
  38. data/examples/test_unit/features/step_definitions/test_unit_steps.rb +1 -4
  39. data/examples/tickets/Rakefile +1 -1
  40. data/examples/tickets/features/246.feature +4 -0
  41. data/examples/tickets/features/270/back.feature +14 -0
  42. data/examples/tickets/features/270/back.steps.rb +14 -0
  43. data/examples/tickets/features/step_definitons/246_steps.rb +3 -0
  44. data/features/background.feature +21 -4
  45. data/features/cucumber_cli.feature +18 -5
  46. data/features/cucumber_cli_outlines.feature +5 -2
  47. data/features/snippet.feature +23 -0
  48. data/features/step_definitions/cucumber_steps.rb +6 -2
  49. data/features/usage.feature +5 -0
  50. data/gem_tasks/rspec.rake +3 -2
  51. data/lib/cucumber/ast/background.rb +3 -3
  52. data/lib/cucumber/ast/examples.rb +0 -12
  53. data/lib/cucumber/ast/feature.rb +2 -12
  54. data/lib/cucumber/ast/feature_element.rb +0 -8
  55. data/lib/cucumber/ast/features.rb +1 -1
  56. data/lib/cucumber/ast/outline_table.rb +14 -22
  57. data/lib/cucumber/ast/py_string.rb +6 -11
  58. data/lib/cucumber/ast/scenario.rb +1 -8
  59. data/lib/cucumber/ast/scenario_outline.rb +1 -11
  60. data/lib/cucumber/ast/step.rb +3 -9
  61. data/lib/cucumber/ast/step_collection.rb +0 -4
  62. data/lib/cucumber/ast/step_invocation.rb +5 -6
  63. data/lib/cucumber/ast/table.rb +26 -22
  64. data/lib/cucumber/ast/tags.rb +0 -8
  65. data/lib/cucumber/ast/visitor.rb +12 -25
  66. data/lib/cucumber/cli/configuration.rb +2 -2
  67. data/lib/cucumber/cli/main.rb +5 -2
  68. data/lib/cucumber/core_ext/instance_exec.rb +17 -4
  69. data/lib/cucumber/formatter/ansicolor.rb +10 -2
  70. data/lib/cucumber/formatter/console.rb +2 -1
  71. data/lib/cucumber/formatter/html.rb +21 -7
  72. data/lib/cucumber/formatter/pretty.rb +27 -20
  73. data/lib/cucumber/formatter/usage.rb +16 -0
  74. data/lib/cucumber/languages.yml +68 -7
  75. data/lib/cucumber/parser/feature.rb +238 -135
  76. data/lib/cucumber/parser/feature.tt +117 -22
  77. data/lib/cucumber/parser/i18n.tt +4 -0
  78. data/lib/cucumber/parser/table.rb +37 -25
  79. data/lib/cucumber/parser/table.tt +15 -3
  80. data/lib/cucumber/parser/treetop_ext.rb +48 -9
  81. data/lib/cucumber/parser.rb +2 -7
  82. data/lib/cucumber/step_definition.rb +13 -14
  83. data/lib/cucumber/step_mother.rb +93 -11
  84. data/lib/cucumber/version.rb +2 -2
  85. data/rails_generators/cucumber/templates/env.rb +1 -1
  86. data/rails_generators/cucumber/templates/paths.rb +15 -5
  87. data/rails_generators/cucumber/templates/webrat_steps.rb +8 -0
  88. data/spec/cucumber/ast/background_spec.rb +1 -0
  89. data/spec/cucumber/ast/feature_factory.rb +1 -1
  90. data/spec/cucumber/ast/feature_spec.rb +2 -2
  91. data/spec/cucumber/ast/scenario_spec.rb +0 -27
  92. data/spec/cucumber/ast/table_spec.rb +23 -2
  93. data/spec/cucumber/core_ext/proc_spec.rb +25 -8
  94. data/spec/cucumber/parser/feature_parser_spec.rb +43 -41
  95. data/spec/cucumber/step_definition_spec.rb +8 -0
  96. data/spec/cucumber/step_mother_spec.rb +48 -0
  97. data/spec/spec_helper.rb +2 -11
  98. metadata +17 -6
  99. data/examples/tickets/cucumber.yml +0 -3
  100. data/lib/cucumber/parser/basic.rb +0 -0
  101. data/spec/cucumber/ast/tags_spec.rb +0 -19
@@ -0,0 +1,14 @@
1
+ require 'spec/expectations'
2
+
3
+ Given /^plop$/ do
4
+ raise "Only one plop!" if @plop
5
+ @plop = true
6
+ end
7
+
8
+ When /^I barp$/ do
9
+ @plop.should == true
10
+ end
11
+
12
+ When /^I wibble$/ do
13
+ @plop.should == true
14
+ end
@@ -0,0 +1,3 @@
1
+ Given /^no ([a-z]+(?: [a-z]+)*) exists in the system$/ do |resource|
2
+ resource.should == "public holiday"
3
+ end
@@ -16,7 +16,7 @@ Feature: backgrounds
16
16
  Then I should have '10' cukes
17
17
 
18
18
  1 scenario
19
- 3 passed steps
19
+ 2 passed steps
20
20
 
21
21
  """
22
22
 
@@ -64,7 +64,7 @@ Feature: backgrounds
64
64
  | 10 |
65
65
 
66
66
  2 scenarios
67
- 5 passed steps
67
+ 4 passed steps
68
68
 
69
69
  """
70
70
 
@@ -123,7 +123,7 @@ Feature: backgrounds
123
123
 
124
124
  2 scenarios
125
125
  1 failed step
126
- 4 skipped steps
126
+ 3 skipped steps
127
127
 
128
128
  """
129
129
 
@@ -217,5 +217,22 @@ Feature: backgrounds
217
217
 
218
218
  """
219
219
 
220
- #@josephwilk
220
+ Scenario: background with name
221
+ When I run cucumber -q features/background/background_with_name.feature --require features
222
+ Then it should pass with
223
+ """
224
+ Feature: background with name
225
+
226
+ Background: I'm a background and I'm ok
227
+ Given '10' cukes
228
+
229
+ Scenario: example
230
+ Then I should have '10' cukes
231
+
232
+ 1 scenario
233
+ 2 passed steps
234
+
235
+ """
236
+
237
+ @josephwilk
221
238
  Scenario: run a scenario showing explicit background steps --explicit-background
@@ -229,15 +229,28 @@ Feature: Cucumber command line
229
229
  hello
230
230
  \"\"\"
231
231
 
232
- 12 scenarios
232
+ Feature: undefined multiline args
233
+
234
+ Scenario: pystring
235
+ Given a pystring
236
+ \"\"\"
237
+ example
238
+ \"\"\"
239
+
240
+ Scenario: table
241
+ Given a table
242
+ | table |
243
+ | example |
244
+
245
+ 14 scenarios
233
246
  12 skipped steps
234
- 7 undefined steps
247
+ 9 undefined steps
235
248
 
236
249
  """
237
250
 
238
251
  Scenario: Multiple formatters and outputs
239
252
  When I run cucumber --format progress --out tmp/progress.txt --format pretty --out tmp/pretty.txt --dry-run features/lots_of_undefined.feature
240
- And examples/self_test/tmp/progress.txt should contain
253
+ And "examples/self_test/tmp/progress.txt" should contain
241
254
  """
242
255
  UUUUU
243
256
 
@@ -245,7 +258,7 @@ Feature: Cucumber command line
245
258
  5 undefined steps
246
259
 
247
260
  """
248
- And examples/self_test/tmp/pretty.txt should match
261
+ And "examples/self_test/tmp/pretty.txt" should match
249
262
  """
250
263
  Feature: Lots of undefined
251
264
 
@@ -362,7 +375,7 @@ Feature: Cucumber command line
362
375
 
363
376
  Scenario: Reformat files with --autoformat
364
377
  When I run cucumber --autoformat tmp/formatted features
365
- Then examples/self_test/tmp/formatted/features/sample.feature should contain
378
+ Then "examples/self_test/tmp/formatted/features/sample.feature" should contain
366
379
  """
367
380
  @one
368
381
  Feature: Sample
@@ -41,7 +41,7 @@ Feature: Cucumber command line
41
41
  Feature: Outline Sample
42
42
 
43
43
  Scenario Outline: Test state # features/outline_sample.feature:5
44
- Given <state> without a table # features/step_definitions/sample_steps.rb:12
44
+ Given <state> without a table # features/step_definitions/sample_steps.rb:15
45
45
  Given <other_state> without a table # features/step_definitions/sample_steps.rb:12
46
46
 
47
47
  Examples: Rainbow colours
@@ -58,11 +58,14 @@ Feature: Cucumber command line
58
58
 
59
59
  """
60
60
 
61
+ # There are 10 characters in the progress, but only 8 reported steps. Needs investigation.
62
+ # Looks like we're outputting too many characters.
63
+ @buggy
61
64
  Scenario: Run all with progress formatter
62
65
  When I run cucumber -q --format progress features/outline_sample.feature
63
66
  Then it should fail with
64
67
  """
65
- ----U-..F---..
68
+ --U-..F-..
66
69
 
67
70
  (::) failed steps (::)
68
71
 
@@ -0,0 +1,23 @@
1
+ Feature: Snippets
2
+ In order to help speed up writing step definitions
3
+ As a feature editor
4
+ I want snippet suggestions for undefined step definitions
5
+
6
+ Scenario: Snippet for undefined step with a pystring
7
+ When I run cucumber features/undefined_multiline_args.feature:3 -n
8
+ Then the output should contain
9
+ """
10
+ Given /^a pystring$/ do |string|
11
+ # string is a Cucumber::Ast::PyString
12
+ pending
13
+ end
14
+ """
15
+ Scenario: Snippet for undefined step with a step table
16
+ When I run cucumber features/undefined_multiline_args.feature:9 -n
17
+ Then the output should contain
18
+ """
19
+ Given /^a table$/ do |table|
20
+ # table is a Cucumber::Ast::Table
21
+ pending
22
+ end
23
+ """
@@ -21,10 +21,14 @@ Then /^it should (fail|pass) with$/ do |success, output|
21
21
  end
22
22
  end
23
23
 
24
- Then /^(.*) should contain$/ do |file, text|
24
+ Then /^the output should contain$/ do |text|
25
+ @out.should include(text)
26
+ end
27
+
28
+ Then /^"(.*)" should contain$/ do |file, text|
25
29
  IO.read(file).should == text
26
30
  end
27
31
 
28
- Then /^(.*) should match$/ do |file, text|
32
+ Then /^"(.*)" should match$/ do |file, text|
29
33
  IO.read(file).should =~ Regexp.new(text)
30
34
  end
@@ -19,6 +19,7 @@ Feature: Cucumber command line
19
19
  /^call step "(.*)"$/ # features/step_definitions/sample_steps.rb:23
20
20
  Given call step "a step definition that calls an undefined step" # features/call_undefined_step_from_step_def.feature:7
21
21
  /^'(.+)' cukes$/ # features/step_definitions/sample_steps.rb:27
22
+ Given '10' cukes # features/background/background_with_name.feature:4
22
23
  And '10' cukes # features/background/failing_background.feature:5
23
24
  Given '10' cukes # features/background/passing_background.feature:4
24
25
  Given '10' cukes # features/background/scenario_outline_passing_background.feature:4
@@ -72,6 +73,7 @@ Feature: Cucumber command line
72
73
  Given '2' cukes # features/tons_of_cukes.feature:51
73
74
  Given '2' cukes # features/tons_of_cukes.feature:52
74
75
  /^I should have '(.+)' cukes$/ # features/step_definitions/sample_steps.rb:31
76
+ Then I should have '10' cukes # features/background/background_with_name.feature:7
75
77
  Then I should have '10' cukes # features/background/failing_background.feature:8
76
78
  Then I should have '10' cukes # features/background/failing_background.feature:11
77
79
  Then I should have '10' cukes # features/background/passing_background.feature:7
@@ -103,6 +105,9 @@ Feature: Cucumber command line
103
105
  Given failing expectation # features/failing_expectation.feature:4
104
106
  /^failing$/ # features/step_definitions/sample_steps.rb:8
105
107
  Given failing # features/sample.feature:16
108
+ (::) UNUSED (::)
109
+ /^unused$/ # features/step_definitions/sample_steps.rb:66
110
+ /^another unused$/ # features/step_definitions/sample_steps.rb:69
106
111
 
107
112
  """
108
113
 
data/gem_tasks/rspec.rake CHANGED
@@ -29,9 +29,10 @@ if require_spec
29
29
 
30
30
  desc "Run the Cucumber specs"
31
31
  Spec::Rake::SpecTask.new do |t|
32
- t.spec_opts = ['--options', "spec/spec.opts"]
33
- t.spec_files = FileList['spec/**/*_spec.rb']
32
+ t.spec_opts = ['--options', "specs/spec.opts"]
33
+ t.spec_files = FileList['specs/**/*_spec.rb']
34
34
  t.rcov = ENV['RCOV']
35
35
  t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/}
36
+ t.verbose = true
36
37
  end
37
38
  end
@@ -6,8 +6,8 @@ module Cucumber
6
6
  include FeatureElement
7
7
  attr_writer :feature
8
8
 
9
- def initialize(comment, line, keyword, steps)
10
- @comment, @line, @keyword, @steps = comment, line, keyword, StepCollection.new(steps)
9
+ def initialize(comment, line, keyword, name, steps)
10
+ @comment, @line, @keyword, @name, @steps = comment, line, keyword, name, StepCollection.new(steps)
11
11
  attach_steps(steps)
12
12
  @step_invocations = @steps.step_invocations(true)
13
13
  end
@@ -23,7 +23,7 @@ module Cucumber
23
23
 
24
24
  def accept(visitor)
25
25
  visitor.visit_comment(@comment)
26
- visitor.visit_background_name(@keyword, "", file_colon_line(@line), source_indent(text_length))
26
+ visitor.visit_background_name(@keyword, @name, file_colon_line(@line), source_indent(text_length))
27
27
  visitor.step_mother.before_and_after(self)
28
28
  visitor.visit_steps(@step_invocations)
29
29
  @failed = @step_invocations.detect{|step_invocation| step_invocation.exception}
@@ -10,26 +10,14 @@ module Cucumber
10
10
  visitor.visit_outline_table(@outline_table)
11
11
  end
12
12
 
13
- def descend?(visitor)
14
- @outline_table.descend?(visitor)
15
- end
16
-
17
13
  def skip_invoke!
18
14
  @outline_table.skip_invoke!
19
15
  end
20
16
 
21
- def matches_scenario_names?(scenario_names)
22
- scenario_names.detect{|name| name == @name}
23
- end
24
-
25
17
  def each_example_row(&proc)
26
18
  @outline_table.cells_rows[1..-1].each(&proc)
27
19
  end
28
20
 
29
- def matches_lines?(lines)
30
- lines.index(@line) || @outline_table.matches_lines?(lines)
31
- end
32
-
33
21
  def to_sexp
34
22
  [:examples, @keyword, @name, @outline_table.to_sexp]
35
23
  end
@@ -3,11 +3,10 @@ module Cucumber
3
3
  # Represents the root node of a parsed feature.
4
4
  class Feature
5
5
  attr_accessor :file
6
- attr_writer :features, :lines
6
+ attr_writer :features
7
7
 
8
8
  def initialize(background, comment, tags, name, feature_elements)
9
9
  @background, @comment, @tags, @name, @feature_elements = background, comment, tags, name, feature_elements
10
- @lines = []
11
10
 
12
11
  @feature_elements.each do |feature_element|
13
12
  feature_element.feature = self
@@ -15,24 +14,15 @@ module Cucumber
15
14
  end
16
15
 
17
16
  def accept(visitor)
18
- visitor.current_feature_lines = @lines
19
17
  visitor.visit_comment(@comment)
20
18
  visitor.visit_tags(@tags)
21
19
  visitor.visit_feature_name(@name)
22
20
  visitor.visit_background(@background) if @background
23
21
  @feature_elements.each do |feature_element|
24
- visitor.visit_feature_element(feature_element) if feature_element.descend?(visitor)
22
+ visitor.visit_feature_element(feature_element)
25
23
  end
26
24
  end
27
25
 
28
- def descend?(visitor)
29
- @feature_elements.detect{ |feature_element| feature_element.descend?(visitor) }
30
- end
31
-
32
- def has_tags?(tags)
33
- @tags.has_tags?(tags)
34
- end
35
-
36
26
  def next_feature_element(feature_element, &proc)
37
27
  index = @feature_elements.index(feature_element)
38
28
  next_one = @feature_elements[index+1]
@@ -12,14 +12,6 @@ module Cucumber
12
12
  @keyword.jlength + @name.jlength
13
13
  end
14
14
 
15
- def matches_lines?(lines)
16
- lines.index(@line) || @steps.matches_lines?(lines) || @tags.matches_lines?(lines)
17
- end
18
-
19
- def has_tags?(tags)
20
- @tags.has_tags?(tags) || @feature.has_tags?(tags)
21
- end
22
-
23
15
  def matches_scenario_names?(scenario_names)
24
16
  scenario_names.detect{|name| name == @name}
25
17
  end
@@ -18,7 +18,7 @@ module Cucumber
18
18
 
19
19
  def accept(visitor)
20
20
  @features.each do |feature|
21
- visitor.visit_feature(feature) if feature.descend?(visitor)
21
+ visitor.visit_feature(feature)
22
22
  end
23
23
  end
24
24
  end
@@ -5,45 +5,37 @@ module Cucumber
5
5
  super(raw)
6
6
  @scenario_outline = scenario_outline
7
7
  @cells_class = ExampleCells
8
-
9
- cells_rows.each do |cells|
10
- cells.create_step_invocations!(scenario_outline)
11
- end
8
+ create_step_invocations_for_example_rows!(scenario_outline)
12
9
  end
13
10
 
14
11
  def accept(visitor)
15
12
  cells_rows.each_with_index do |row, n|
16
- if n == 0 || matches?(visitor, row)
17
- visitor.visit_table_row(row)
18
- end
13
+ visitor.visit_table_row(row)
19
14
  end
20
15
  nil
21
16
  end
22
17
 
23
- def descend?(visitor)
24
- cells_rows.detect{|cells_row| cells_row.descend?(visitor)}
25
- end
26
-
27
- def matches?(visitor, cells)
28
- @scenario_outline.matches_tags_and_name?(visitor) &&
29
- (visitor.matches_lines?(cells) || visitor.matches_lines?(@scenario_outline))
30
- end
31
-
32
18
  def skip_invoke!
33
- cells_rows.each do |cells|
19
+ example_rows.each do |cells|
34
20
  cells.skip_invoke!
35
21
  end
36
22
  end
37
23
 
24
+ def create_step_invocations_for_example_rows!(scenario_outline)
25
+ example_rows.each do |cells|
26
+ cells.create_step_invocations!(scenario_outline)
27
+ end
28
+ end
29
+
30
+ def example_rows
31
+ cells_rows[1..-1]
32
+ end
33
+
38
34
  class ExampleCells < Cells
39
35
  def create_step_invocations!(scenario_outline)
40
36
  @step_invocations = scenario_outline.step_invocations(self)
41
37
  end
42
38
 
43
- def descend?(visitor)
44
- @table.matches?(visitor, self)
45
- end
46
-
47
39
  def skip_invoke!
48
40
  @step_invocations.each do |step_invocation|
49
41
  step_invocation.skip_invoke!
@@ -53,7 +45,7 @@ module Cucumber
53
45
  def accept(visitor)
54
46
  if header?
55
47
  @cells.each do |cell|
56
- cell.status = :skipped
48
+ cell.status = :skipped_param
57
49
  visitor.visit_table_cell(cell)
58
50
  end
59
51
  else
@@ -17,26 +17,22 @@ module Cucumber
17
17
  # Note how the indentation from the source is stripped away.
18
18
  #
19
19
  class PyString
20
+
21
+ def self.default_arg_name
22
+ "string"
23
+ end
24
+
20
25
  def initialize(start_line, end_line, string, quotes_indent)
21
26
  @start_line, @end_line = start_line, end_line
22
27
  @string, @quotes_indent = string.gsub(/\\"/, '"'), quotes_indent
23
- @status = :passed
24
- end
25
-
26
- def status=(status)
27
- @status = status
28
28
  end
29
29
 
30
30
  def to_s
31
31
  @string.indent(-@quotes_indent)
32
32
  end
33
33
 
34
- def matches_lines?(lines)
35
- lines.detect{|l| l >= @start_line && l <= @end_line}
36
- end
37
-
38
34
  def accept(visitor)
39
- visitor.visit_py_string(to_s, @status)
35
+ visitor.visit_py_string(to_s)
40
36
  end
41
37
 
42
38
  def arguments_replaced(arguments) #:nodoc:
@@ -52,7 +48,6 @@ module Cucumber
52
48
  def to_sexp #:nodoc:
53
49
  [:py_string, to_s]
54
50
  end
55
-
56
51
  end
57
52
  end
58
53
  end
@@ -8,7 +8,7 @@ module Cucumber
8
8
  def initialize(background, comment, tags, line, keyword, name, steps)
9
9
  @background, @comment, @tags, @line, @keyword, @name = background, comment, tags, line, keyword, name
10
10
  attach_steps(steps)
11
-
11
+
12
12
  step_invocations = steps.map{|step| step.step_invocation}
13
13
  if @background
14
14
  @steps = @background.step_collection(step_invocations)
@@ -22,13 +22,6 @@ module Cucumber
22
22
  @background.feature = feature if @background
23
23
  end
24
24
 
25
- def descend?(visitor)
26
- visitor.matches_lines?(self) &&
27
- visitor.included_by_tags?(self) &&
28
- !visitor.excluded_by_tags?(self) &&
29
- visitor.matches_scenario_names?(self)
30
- end
31
-
32
25
  def accept(visitor)
33
26
  visitor.visit_comment(@comment)
34
27
  visitor.visit_tags(@tags)
@@ -30,16 +30,6 @@ module Cucumber
30
30
  @background.feature = feature if @background
31
31
  end
32
32
 
33
- def descend?(visitor)
34
- @examples_array.detect { |examples| examples.descend?(visitor) }
35
- end
36
-
37
- def matches_tags_and_name?(visitor)
38
- visitor.included_by_tags?(self) &&
39
- !visitor.excluded_by_tags?(self) &&
40
- visitor.matches_scenario_names?(self)
41
- end
42
-
43
33
  def accept(visitor)
44
34
  visitor.visit_comment(@comment)
45
35
  visitor.visit_tags(@tags)
@@ -48,7 +38,7 @@ module Cucumber
48
38
 
49
39
  skip_invoke! if @background && @background.failed?
50
40
  @examples_array.each do |examples|
51
- visitor.visit_examples(examples) if examples.descend?(visitor)
41
+ visitor.visit_examples(examples)
52
42
  end
53
43
  end
54
44
 
@@ -33,13 +33,11 @@ module Cucumber
33
33
  def accept(visitor)
34
34
  # The only time a Step is visited is when it is in a ScenarioOutline.
35
35
  # Otherwise it's always StepInvocation that gest visited instead.
36
- visit_step_details(visitor, first_match(visitor), @multiline_arg, :skipped, nil, nil)
36
+ visit_step_result(visitor, first_match(visitor), @multiline_arg, :skipped, nil, nil)
37
37
  end
38
38
 
39
- def visit_step_details(visitor, step_match, multiline_arg, status, exception, background)
40
- visitor.visit_step_name(@keyword, step_match, status, source_indent, background)
41
- visitor.visit_multiline_arg(@multiline_arg) if @multiline_arg
42
- visitor.visit_exception(exception, status) if exception
39
+ def visit_step_result(visitor, step_match, multiline_arg, status, exception, background)
40
+ visitor.visit_step_result(@keyword, step_match, @multiline_arg, status, exception, source_indent, background)
43
41
  end
44
42
 
45
43
  def first_match(visitor)
@@ -58,10 +56,6 @@ module Cucumber
58
56
  [:step, @line, @keyword, @name, (@multiline_arg.nil? ? nil : @multiline_arg.to_sexp)].compact
59
57
  end
60
58
 
61
- def matches_lines?(lines)
62
- lines.index(@line) || (@multiline_arg && @multiline_arg.matches_lines?(lines))
63
- end
64
-
65
59
  def source_indent
66
60
  @feature_element.source_indent(text_length)
67
61
  end
@@ -41,10 +41,6 @@ module Cucumber
41
41
  @steps[i-1]
42
42
  end
43
43
 
44
- def matches_lines?(lines)
45
- @steps.detect {|step| step.matches_lines?(lines)}
46
- end
47
-
48
44
  def empty?
49
45
  @steps.empty?
50
46
  end
@@ -20,7 +20,7 @@ module Cucumber
20
20
 
21
21
  def accept(visitor)
22
22
  invoke(visitor.step_mother, visitor.options)
23
- @step.visit_step_details(visitor, @step_match, @multiline_arg, @status, @exception, @background)
23
+ @step.visit_step_result(visitor, @step_match, @multiline_arg, @status, @exception, @background)
24
24
  end
25
25
 
26
26
  def invoke(step_mother, options)
@@ -68,7 +68,6 @@ module Cucumber
68
68
 
69
69
  def status!(status)
70
70
  @status = status
71
- @multiline_arg.status = status if @multiline_arg
72
71
  @matched_cells.each do |cell|
73
72
  cell.status = status
74
73
  end
@@ -86,10 +85,6 @@ module Cucumber
86
85
  end
87
86
  end
88
87
 
89
- def matches_lines?(lines)
90
- @step.matches_lines?(lines)
91
- end
92
-
93
88
  def text_length
94
89
  @step.text_length
95
90
  end
@@ -98,6 +93,10 @@ module Cucumber
98
93
  @step.keyword
99
94
  end
100
95
 
96
+ def multiline_arg
97
+ @step.multiline_arg
98
+ end
99
+
101
100
  def file_colon_line
102
101
  @step.file_colon_line
103
102
  end