cucumber 0.3.11 → 0.3.90

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. data/History.txt +101 -0
  2. data/Manifest.txt +14 -5
  3. data/config/hoe.rb +1 -2
  4. data/cucumber.yml +1 -0
  5. data/examples/i18n/ar/Rakefile +1 -1
  6. data/examples/i18n/ar/features/addition.feature +1 -0
  7. data/examples/i18n/bg/Rakefile +1 -1
  8. data/examples/i18n/bg/features/addition.feature +1 -0
  9. data/examples/i18n/bg/features/consecutive_calculations.feature +1 -0
  10. data/examples/i18n/bg/features/division.feature +1 -0
  11. data/examples/i18n/cat/Rakefile +1 -1
  12. data/examples/i18n/cat/features/suma.feature +1 -0
  13. data/examples/i18n/da/Rakefile +1 -1
  14. data/examples/i18n/da/features/summering.feature +1 -0
  15. data/examples/i18n/de/Rakefile +1 -1
  16. data/examples/i18n/de/features/addition.feature +1 -0
  17. data/examples/i18n/de/features/division.feature +1 -0
  18. data/examples/i18n/en-lol/features/stuffing.feature +1 -1
  19. data/examples/i18n/en/Rakefile +1 -1
  20. data/examples/i18n/en/features/addition.feature +1 -0
  21. data/examples/i18n/en/features/division.feature +1 -0
  22. data/examples/i18n/es/Rakefile +1 -1
  23. data/examples/i18n/es/features/adicion.feature +1 -0
  24. data/examples/i18n/et/Rakefile +1 -1
  25. data/examples/i18n/et/features/jagamine.feature +1 -0
  26. data/examples/i18n/et/features/liitmine.feature +1 -0
  27. data/examples/i18n/fi/Rakefile +1 -1
  28. data/examples/i18n/fi/features/jakolasku.feature +1 -0
  29. data/examples/i18n/fr/Rakefile +1 -1
  30. data/examples/i18n/fr/features/addition.feature +2 -1
  31. data/examples/i18n/he/Rakefile +1 -1
  32. data/examples/i18n/he/features/addition.feature +1 -0
  33. data/examples/i18n/he/features/division.feature +1 -0
  34. data/examples/i18n/hu/Rakefile +1 -1
  35. data/examples/i18n/hu/features/addition.feature +1 -0
  36. data/examples/i18n/hu/features/division.feature +1 -0
  37. data/examples/i18n/id/Rakefile +1 -1
  38. data/examples/i18n/id/features/addition.feature +1 -0
  39. data/examples/i18n/id/features/division.feature +1 -0
  40. data/examples/i18n/it/Rakefile +1 -1
  41. data/examples/i18n/it/features/somma.feature +1 -0
  42. data/examples/i18n/ja/Rakefile +1 -1
  43. data/examples/i18n/ja/features/addition.feature +1 -0
  44. data/examples/i18n/ja/features/division.feature +1 -0
  45. data/examples/i18n/ko/Rakefile +1 -1
  46. data/examples/i18n/ko/features/addition.feature +6 -5
  47. data/examples/i18n/ko/features/division.feature +1 -0
  48. data/examples/i18n/ko/features/step_definitons/calculator_steps.rb +1 -1
  49. data/examples/i18n/lt/Rakefile +1 -1
  50. data/examples/i18n/lt/features/addition.feature +1 -0
  51. data/examples/i18n/lt/features/division.feature +1 -0
  52. data/examples/i18n/lv/Rakefile +1 -1
  53. data/examples/i18n/lv/features/addition.feature +1 -0
  54. data/examples/i18n/lv/features/division.feature +1 -0
  55. data/examples/i18n/no/Rakefile +1 -1
  56. data/examples/i18n/no/features/step_definitons/kalkulator_steps.rb +1 -1
  57. data/examples/i18n/no/features/summering.feature +1 -0
  58. data/examples/i18n/pl/Rakefile +1 -1
  59. data/examples/i18n/pl/features/addition.feature +1 -0
  60. data/examples/i18n/pl/features/division.feature +1 -0
  61. data/examples/i18n/pt/Rakefile +1 -1
  62. data/examples/i18n/pt/features/adicao.feature +1 -0
  63. data/examples/i18n/ro/Rakefile +1 -1
  64. data/examples/i18n/ro/features/suma.feature +1 -0
  65. data/examples/i18n/ru/Rakefile +1 -1
  66. data/examples/i18n/ru/features/addition.feature +1 -0
  67. data/examples/i18n/ru/features/consecutive_calculations.feature +1 -0
  68. data/examples/i18n/ru/features/division.feature +1 -0
  69. data/examples/i18n/se/Rakefile +1 -1
  70. data/examples/i18n/se/features/summering.feature +1 -0
  71. data/examples/i18n/sk/Rakefile +1 -1
  72. data/examples/i18n/sk/features/addition.feature +1 -0
  73. data/examples/i18n/sk/features/division.feature +1 -0
  74. data/examples/i18n/zh-CN/features/addition.feature +1 -0
  75. data/examples/i18n/zh-TW/features/addition.feature +1 -0
  76. data/examples/i18n/zh-TW/features/division.feature +1 -0
  77. data/examples/self_test/features/support/env.rb +2 -1
  78. data/examples/sinatra/features/step_definitions/add_steps.rb +1 -1
  79. data/examples/sinatra/features/support/env.rb +13 -5
  80. data/examples/steps_library/features/step_definitions/steps_lib1.rb +8 -0
  81. data/examples/steps_library/features/step_definitions/steps_lib2.rb +8 -0
  82. data/examples/tickets/features/step_definitons/tickets_steps.rb +15 -0
  83. data/examples/tickets/features/table_diffing.feature +13 -0
  84. data/features/after_block_exceptions.feature +4 -1
  85. data/features/after_step_block_exceptions.feature +4 -1
  86. data/features/background.feature +6 -0
  87. data/features/bug_371.feature +32 -0
  88. data/features/cucumber_cli.feature +11 -1
  89. data/features/cucumber_cli_diff_disabled.feature +9 -2
  90. data/features/drb_server_integration.feature +28 -5
  91. data/features/expand.feature +2 -1
  92. data/features/html_formatter/a.html +129 -1614
  93. data/features/junit_formatter.feature +4 -4
  94. data/features/language_from_header.feature +30 -0
  95. data/features/rake_task.feature +28 -0
  96. data/features/step_definitions/cucumber_steps.rb +2 -2
  97. data/features/steps_formatter.feature +25 -0
  98. data/features/support/env.rb +13 -5
  99. data/features/table_diffing.feature +45 -0
  100. data/features/unicode_table.feature +35 -0
  101. data/features/work_in_progress.feature +3 -0
  102. data/gem_tasks/sass.rake +4 -0
  103. data/lib/cucumber.rb +0 -57
  104. data/lib/cucumber/ast/comment.rb +1 -1
  105. data/lib/cucumber/ast/feature.rb +2 -2
  106. data/lib/cucumber/ast/feature_element.rb +4 -0
  107. data/lib/cucumber/ast/outline_table.rb +2 -1
  108. data/lib/cucumber/ast/py_string.rb +0 -1
  109. data/lib/cucumber/ast/scenario.rb +5 -3
  110. data/lib/cucumber/ast/scenario_outline.rb +6 -1
  111. data/lib/cucumber/ast/step.rb +8 -1
  112. data/lib/cucumber/ast/step_invocation.rb +6 -1
  113. data/lib/cucumber/ast/table.rb +287 -49
  114. data/lib/cucumber/ast/visitor.rb +2 -1
  115. data/lib/cucumber/cli/configuration.rb +45 -28
  116. data/lib/cucumber/cli/drb_client.rb +8 -9
  117. data/lib/cucumber/cli/language_help_formatter.rb +9 -7
  118. data/lib/cucumber/cli/main.rb +8 -9
  119. data/lib/cucumber/feature_file.rb +53 -0
  120. data/lib/cucumber/filter.rb +50 -0
  121. data/lib/cucumber/formatter/console.rb +12 -0
  122. data/lib/cucumber/formatter/cucumber.css +106 -48
  123. data/lib/cucumber/formatter/cucumber.sass +121 -31
  124. data/lib/cucumber/formatter/html.rb +6 -5
  125. data/lib/cucumber/formatter/junit.rb +3 -6
  126. data/lib/cucumber/formatter/pretty.rb +22 -9
  127. data/lib/cucumber/formatter/profile.rb +1 -1
  128. data/lib/cucumber/formatter/progress.rb +1 -1
  129. data/lib/cucumber/formatter/steps.rb +49 -0
  130. data/lib/cucumber/languages.yml +3 -3
  131. data/lib/cucumber/parser.rb +1 -33
  132. data/lib/cucumber/parser/feature.rb +39 -16
  133. data/lib/cucumber/parser/feature.tt +1 -3
  134. data/lib/cucumber/parser/i18n.tt +30 -23
  135. data/lib/cucumber/parser/i18n/language.rb +83 -0
  136. data/lib/cucumber/parser/treetop_ext.rb +12 -83
  137. data/lib/cucumber/platform.rb +6 -0
  138. data/lib/cucumber/rake/task.rb +6 -0
  139. data/lib/cucumber/step_definition.rb +6 -0
  140. data/lib/cucumber/step_match.rb +1 -1
  141. data/lib/cucumber/step_mother.rb +3 -3
  142. data/lib/cucumber/version.rb +1 -1
  143. data/lib/cucumber/webrat/table_locator.rb +66 -0
  144. data/rails_generators/cucumber/templates/cucumber.rake +4 -0
  145. data/rails_generators/cucumber/templates/env.rb +1 -0
  146. data/rails_generators/cucumber/templates/spork_env.rb +1 -1
  147. data/rails_generators/cucumber/templates/webrat_steps.rb +17 -0
  148. data/rails_generators/feature/templates/feature.erb +1 -1
  149. data/rails_generators/feature/templates/steps.erb +2 -8
  150. data/spec/cucumber/ast/step_collection_spec.rb +5 -4
  151. data/spec/cucumber/ast/table_spec.rb +145 -0
  152. data/spec/cucumber/cli/configuration_spec.rb +55 -9
  153. data/spec/cucumber/cli/drb_client_spec.rb +5 -4
  154. data/spec/cucumber/cli/main_spec.rb +9 -12
  155. data/spec/cucumber/formatter/progress_spec.rb +2 -2
  156. data/spec/cucumber/parser/feature_parser_spec.rb +11 -9
  157. data/spec/cucumber/parser/table_parser_spec.rb +1 -1
  158. data/spec/spec_helper.rb +2 -1
  159. metadata +21 -20
  160. data/spec/cucumber/formatter/html/cucumber.css +0 -37
  161. data/spec/cucumber/formatter/html/cucumber.js +0 -13
  162. data/spec/cucumber/formatter/html/index.html +0 -45
  163. data/spec/cucumber/formatter/html/jquery-1.3.min.js +0 -19
  164. data/spec/cucumber/formatter/html/jquery.uitableedit.js +0 -100
@@ -13,7 +13,7 @@ Feature: JUnit output formatter
13
13
  """
14
14
 
15
15
  """
16
- And "examples/junit/tmp/TEST-One_passing_scenario__one_failing_scenario.xml" should contain XML
16
+ And "examples/junit/tmp/TEST-one_passing_one_failing.xml" should contain XML
17
17
  """
18
18
  <?xml version="1.0" encoding="UTF-8"?>
19
19
  <testsuite errors="0" tests="2" name="One passing scenario, one failing scenario" failures="1">
@@ -36,7 +36,7 @@ Feature: JUnit output formatter
36
36
  """
37
37
 
38
38
  """
39
- And "examples/junit/tmp/TEST-Pending_step.xml" should contain XML
39
+ And "examples/junit/tmp/TEST-pending.xml" should contain XML
40
40
  """
41
41
  <?xml version="1.0" encoding="UTF-8"?>
42
42
  <testsuite errors="0" tests="1" name="Pending step" failures="1">
@@ -56,8 +56,8 @@ Feature: JUnit output formatter
56
56
  """
57
57
 
58
58
  """
59
- And "examples/junit/tmp/TEST-One_passing_scenario__one_failing_scenario.xml" should exist
60
- And "examples/junit/tmp/TEST-Pending_step.xml" should exist
59
+ And "examples/junit/tmp/TEST-one_passing_one_failing.xml" should exist
60
+ And "examples/junit/tmp/TEST-pending.xml" should exist
61
61
 
62
62
  Scenario: show correct error message if no --out is passed
63
63
  When I run cucumber --format junit features
@@ -0,0 +1,30 @@
1
+ Feature: Language from header
2
+ In order to simplify command line and
3
+ settings in IDEs, Cucumber should pick
4
+ up parser language from a header.
5
+
6
+ Scenario: LOLCAT
7
+ Given a standard Cucumber project directory structure
8
+ And a file named "features/lolcat.feature" with:
9
+ """
10
+ # language: en-lol
11
+ OH HAI: STUFFING
12
+ B4: HUNGRY
13
+ MISHUN: CUKES
14
+ DEN KTHXBAI
15
+ """
16
+ When I run cucumber -i features/lolcat.feature
17
+ Then it should pass with
18
+ """
19
+ # language: en-lol
20
+ OH HAI: STUFFING
21
+
22
+ B4: HUNGRY # features/lolcat.feature:3
23
+
24
+ MISHUN: CUKES # features/lolcat.feature:4
25
+ DEN KTHXBAI # features/lolcat.feature:5
26
+
27
+ 1 scenario (1 undefined)
28
+ 1 step (1 undefined)
29
+
30
+ """
@@ -148,3 +148,31 @@ Feature: Rake task
148
148
  """
149
149
  * features/support/dont_require_me.rb
150
150
  """
151
+
152
+ Scenario: feature files with spaces
153
+ Given a file named "features/spaces are nasty.feature" with:
154
+ """
155
+ Feature: The futures green
156
+
157
+ Scenario: Orange
158
+ Given this is missing
159
+ """
160
+ And a file named "Rakefile" with:
161
+ """
162
+ $LOAD_PATH.unshift(CUCUMBER_LIB)
163
+ require 'cucumber/rake/task'
164
+
165
+ Cucumber::Rake::Task.new(:features) do |t|
166
+ t.cucumber_opts = %w{--quiet --no-color}
167
+ end
168
+ """
169
+ When I run rake features
170
+ Then it should pass
171
+ And the output should contain
172
+ """
173
+ Feature: The futures green
174
+
175
+ Scenario: Orange
176
+ Given this is missing
177
+
178
+ """
@@ -31,8 +31,8 @@ Given /^the following profiles? (?:are|is) defined:$/ do |profiles|
31
31
  create_file('cucumber.yml', profiles)
32
32
  end
33
33
 
34
- Given /^I am running "([^\"]*)" in the background$/ do |command|
35
- run_in_background command
34
+ Given /^I am running spork in the background$/ do
35
+ run_spork_in_background
36
36
  end
37
37
 
38
38
  Given /^I am not running (?:.*) in the background$/ do
@@ -0,0 +1,25 @@
1
+ Feature: --formatter steps option - Steps Formatter
2
+ In order to easily see which steps are already defined,
3
+ specially when using 3rd party steps libraries,
4
+ Cucumber should show the available steps in a user-friendly format
5
+
6
+ Background:
7
+ Given I am in steps_library
8
+
9
+ Scenario: Printing steps
10
+ When I run cucumber -f steps features
11
+ Then it should pass with
12
+ """
13
+ features/step_definitions/steps_lib1.rb
14
+ /^I defined a first step$/ # features/step_definitions/steps_lib1.rb:1
15
+ /^I define a second step$/ # features/step_definitions/steps_lib1.rb:4
16
+ /^I should also have a third step$/ # features/step_definitions/steps_lib1.rb:7
17
+
18
+ features/step_definitions/steps_lib2.rb
19
+ /^I defined a step 4$/ # features/step_definitions/steps_lib2.rb:1
20
+ /^I create a step 5$/ # features/step_definitions/steps_lib2.rb:4
21
+ /^I should be too tired for step 6$/ # features/step_definitions/steps_lib2.rb:7
22
+
23
+ 6 step definition(s) in 2 source file(s).
24
+
25
+ """
@@ -4,7 +4,7 @@ require 'spec/expectations'
4
4
  require 'fileutils'
5
5
  require 'forwardable'
6
6
  begin
7
- require 'spork'
7
+ gem "spork", ">= 0.5.1" # Ensure correct spork version number to avoid false-negatives.
8
8
  rescue Gem::LoadError => ex
9
9
  warn "WARNING: #{ex.message} You need to have the spork gem installed to run the DRb feature properly!"
10
10
  end
@@ -70,22 +70,30 @@ class CucumberWorld
70
70
  stderr_file.close
71
71
  in_current_dir do
72
72
  @last_stdout = `#{command} 2> #{stderr_file.path}`
73
+ mode = Cucumber::RUBY_1_9 ? {:external_encoding=>"UTF-8"} : 'r'
74
+ IO.popen("#{command} 2> #{stderr_file.path}", mode) do |io|
75
+ @last_stdout = io.read
76
+ end
77
+
73
78
  @last_exit_status = $?.exitstatus
74
79
  end
75
80
  @last_stderr = IO.read(stderr_file.path)
76
81
  end
77
82
 
78
- def run_in_background(command)
83
+ def run_spork_in_background
79
84
  pid = fork
80
85
  in_current_dir do
81
86
  if pid
82
87
  background_jobs << pid
83
88
  else
84
- #STDOUT.close
85
- #STDERR.close
86
- exec command
89
+ # STDOUT.close
90
+ # STDERR.close
91
+ spork = `which spork`.strip
92
+ cmd = "#{Cucumber::RUBY_BINARY} -I #{Cucumber::LIBDIR} #{spork} cuc"
93
+ exec cmd
87
94
  end
88
95
  end
96
+ sleep 0.2
89
97
  end
90
98
 
91
99
  def terminate_background_jobs
@@ -0,0 +1,45 @@
1
+ Feature: Table diffing
2
+ In order to more easily compare data in tables
3
+ step definition writers should be able to diff
4
+ a table with expected data and see the diff inline
5
+
6
+ Scenario: Extra row
7
+ Given a standard Cucumber project directory structure
8
+ And a file named "features/tables.feature" with:
9
+ """
10
+ Feature: Tables
11
+ Scenario: Extra row
12
+ Then the table should be:
13
+ | x | y |
14
+ | a | b |
15
+ """
16
+ And a file named "features/step_definitions/table_steps.rb" with:
17
+ """
18
+ Then /the table should be:/ do |expected|
19
+ expected.diff!(table(%{
20
+ | x | y |
21
+ | a | c |
22
+ }))
23
+ end
24
+ """
25
+ When I run cucumber -i features/tables.feature
26
+ Then it should fail with
27
+ """
28
+ Feature: Tables
29
+
30
+ Scenario: Extra row # features/tables.feature:2
31
+ Then the table should be: # features/step_definitions/table_steps.rb:1
32
+ | x | y |
33
+ | a | b |
34
+ | a | c |
35
+ Tables were not identical (RuntimeError)
36
+ ./features/step_definitions/table_steps.rb:2:in `/the table should be:/'
37
+ features/tables.feature:3:in `Then the table should be:'
38
+
39
+ Failing Scenarios:
40
+ cucumber features/tables.feature:2 # Scenario: Extra row
41
+
42
+ 1 scenario (1 failed)
43
+ 1 step (1 failed)
44
+
45
+ """
@@ -0,0 +1,35 @@
1
+ Feature: Unicode in tables
2
+ In order to please the whole world,
3
+ unicode characters in tables should be
4
+ properly aligned
5
+
6
+ Scenario: All sorts of weird stuff
7
+ Given a standard Cucumber project directory structure
8
+ And a file named "features/unicode.feature" with:
9
+ """
10
+ Feature: Featuring unicode
11
+
12
+ Scenario: So what, whatever
13
+ Given passing
14
+ | Brüno | abc |
15
+ | Bruno | æøå |
16
+ """
17
+ And a file named "features/env.rb" with:
18
+ """
19
+ $KCODE='u'
20
+ """
21
+ When I run cucumber -q --dry-run features/unicode.feature
22
+ Then it should pass with
23
+ """
24
+ Feature: Featuring unicode
25
+
26
+ Scenario: So what, whatever
27
+ Given passing
28
+ | Brüno | abc |
29
+ | Bruno | æøå |
30
+
31
+ 1 scenario (1 undefined)
32
+ 1 step (1 undefined)
33
+
34
+ """
35
+
@@ -62,6 +62,9 @@ Feature: Cucumber --work-in-progress switch
62
62
  I fail (RuntimeError)
63
63
  ./features/step_definitions/steps.rb:2:in `/^a failing step$/'
64
64
  features/wip.feature:4:in `Given a failing step'
65
+
66
+ Failing Scenarios:
67
+ cucumber features/wip.feature:3 # Scenario: Failing
65
68
 
66
69
  1 scenario (1 failed)
67
70
  1 step (1 failed)
@@ -0,0 +1,4 @@
1
+ desc 'Generate the css for the html formatter from sass'
2
+ task :sass do
3
+ sh 'sass -t expanded lib/cucumber/formatter/cucumber.sass > lib/cucumber/formatter/cucumber.css'
4
+ end
@@ -9,60 +9,3 @@ require 'cucumber/step_mother'
9
9
  require 'cucumber/cli/main'
10
10
  require 'cucumber/broadcaster'
11
11
  require 'cucumber/core_ext/exception'
12
-
13
- module Cucumber
14
- KEYWORD_KEYS = %w{name native encoding feature background scenario scenario_outline examples given when then but}
15
-
16
- class << self
17
- # The currently active language
18
- attr_reader :lang
19
-
20
- def load_language(lang) #:nodoc:
21
- return if @lang
22
- @lang = lang
23
- alias_step_definitions(lang)
24
- Parser.load_parser(keyword_hash)
25
- end
26
-
27
- def language_incomplete?(lang=@lang)
28
- KEYWORD_KEYS.detect{|key| keyword_hash(lang)[key].nil?}
29
- end
30
-
31
- # File mode that accounts for Ruby platform and current language
32
- def file_mode(m)
33
- Cucumber::RUBY_1_9 ? "#{m}:#{keyword_hash['encoding']}" : m
34
- end
35
-
36
- # Returns a Hash of the currently active
37
- # language, or for a specific language if +lang+ is
38
- # specified.
39
- def keyword_hash(lang=@lang)
40
- LANGUAGES[lang]
41
- end
42
-
43
- def scenario_keyword
44
- keyword_hash['scenario'].split('|')[0] + ':'
45
- end
46
-
47
- def alias_step_definitions(lang) #:nodoc:
48
- keywords = %w{given when then and but}.map{|keyword| keyword_hash(lang)[keyword].split('|')}
49
- alias_steps(keywords.flatten)
50
- end
51
-
52
- # Sets up additional method aliases for Given, When and Then.
53
- # This does *not* affect how feature files are parsed. If you
54
- # want to create aliases in the parser, you have to do this in
55
- # languages.yml. For example:
56
- #
57
- # and: And|With
58
- def alias_steps(keywords)
59
- keywords.each do |adverb|
60
- StepMother.alias_adverb(adverb)
61
- World.alias_adverb(adverb)
62
- end
63
- end
64
- end
65
-
66
- # Make sure we always have English aliases
67
- alias_step_definitions('en')
68
- end
@@ -17,7 +17,7 @@ module Cucumber
17
17
  end
18
18
 
19
19
  def accept(visitor)
20
- @value.split("\n").each do |line|
20
+ @value.strip.split("\n").each do |line|
21
21
  visitor.visit_comment_line(line.strip)
22
22
  end
23
23
  end
@@ -2,12 +2,12 @@ module Cucumber
2
2
  module Ast
3
3
  # Represents the root node of a parsed feature.
4
4
  class Feature
5
- attr_accessor :file
5
+ attr_accessor :file, :language
6
6
  attr_writer :features
7
7
  attr_reader :name
8
8
 
9
9
  def initialize(background, comment, tags, name, feature_elements)
10
- @background, @comment, @tags, @name, @feature_elements = background, comment, tags, name, feature_elements
10
+ @background, @comment, @tags, @name, @feature_elements = background, comment, tags, name.strip, feature_elements
11
11
 
12
12
  background.feature = self if background
13
13
  @feature_elements.each do |feature_element|
@@ -49,5 +49,9 @@ module Cucumber
49
49
  def accept_hook?(hook)
50
50
  @tags.accept_hook?(hook) || @feature.accept_hook?(hook)
51
51
  end
52
+
53
+ def language
54
+ @feature.language
55
+ end
52
56
  end
53
57
  end
@@ -44,7 +44,8 @@ module Cucumber
44
44
  end
45
45
 
46
46
  class ExampleRow < Cells
47
-
47
+ attr_reader :scenario_outline # https://rspec.lighthouseapp.com/projects/16211/tickets/342
48
+
48
49
  def create_step_invocations!(scenario_outline)
49
50
  @scenario_outline = scenario_outline
50
51
  @step_invocations = scenario_outline.step_invocations(self)
@@ -17,7 +17,6 @@ module Cucumber
17
17
  # Note how the indentation from the source is stripped away.
18
18
  #
19
19
  class PyString
20
-
21
20
  def self.default_arg_name
22
21
  "string"
23
22
  end
@@ -25,12 +25,14 @@ module Cucumber
25
25
  visitor.visit_tags(@tags)
26
26
  visitor.visit_scenario_name(@keyword, @name, file_colon_line(@line), source_indent(first_line_length))
27
27
 
28
- skip = @background && @background.failed?
29
- skip_invoke! if skip
30
- visitor.step_mother.before_and_after(self, skip) do
28
+ background_failed = @background && @background.failed?
29
+ skip_invoke! if background_failed
30
+ skip_hooks = background_failed || @executed
31
+ visitor.step_mother.before_and_after(self, skip_hooks) do
31
32
  visitor.visit_steps(@steps)
32
33
  end
33
34
  visitor.visit_exception(@exception, :failed) if @exception
35
+ @executed = true
34
36
  end
35
37
 
36
38
  # Returns true if one or more steps failed
@@ -69,7 +69,12 @@ module Cucumber
69
69
  end
70
70
 
71
71
  def visit_scenario_name(visitor, row)
72
- visitor.visit_scenario_name(Cucumber.scenario_keyword, row.name, file_colon_line(row.line), source_indent(first_line_length))
72
+ visitor.visit_scenario_name(
73
+ @feature.language.scenario_keyword,
74
+ row.name,
75
+ file_colon_line(row.line),
76
+ source_indent(first_line_length)
77
+ )
73
78
  end
74
79
 
75
80
  def to_sexp
@@ -74,6 +74,10 @@ module Cucumber
74
74
  @file_colon_line ||= @feature_element.file_colon_line(@line) unless @feature_element.nil?
75
75
  end
76
76
 
77
+ def language
78
+ @feature_element.language
79
+ end
80
+
77
81
  def dom_id
78
82
  @dom_id ||= file_colon_line.gsub(/\//, '_').gsub(/\./, '_').gsub(/:/, '_')
79
83
  end
@@ -81,8 +85,11 @@ module Cucumber
81
85
  private
82
86
 
83
87
  def matched_cells(cells)
88
+ col_index = 0
84
89
  cells.select do |cell|
85
- delimited = delimited(cell.header_cell.value)
90
+ header_cell = cell.table.header_cell(col_index)
91
+ col_index += 1
92
+ delimited = delimited(header_cell.value)
86
93
  @name.index(delimited) || (@multiline_arg && @multiline_arg.has_text?(delimited))
87
94
  end
88
95
  end