cucumber 3.0.0.pre.2 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +32 -0
  3. data/.github/ISSUE_TEMPLATE.md +1 -1
  4. data/.github/PULL_REQUEST_TEMPLATE.md +1 -0
  5. data/.rubocop_todo.yml +1 -85
  6. data/.travis.yml +3 -2
  7. data/{History.md → CHANGELOG.md} +77 -13
  8. data/appveyor.yml +2 -1
  9. data/bin/cucumber +2 -1
  10. data/cucumber.gemspec +2 -2
  11. data/examples/i18n/ar/features/step_definitions/calculator_steps.rb +6 -1
  12. data/examples/i18n/bg/features/support/env.rb +6 -1
  13. data/examples/i18n/bg/lib/calculator.rb +2 -1
  14. data/examples/i18n/ca/features/step_definitions/calculator_steps.rb +6 -1
  15. data/examples/i18n/cs/features/step_definitions/calculator_steps.rb +6 -1
  16. data/examples/i18n/da/features/step_definitions/lommeregner_steps.rb +6 -1
  17. data/examples/i18n/de/features/step_definitions/calculator_steps.rb +6 -1
  18. data/examples/i18n/el/features/step_definitions/calculator_steps.rb +6 -1
  19. data/examples/i18n/en-lol/features/support/env.rb +6 -2
  20. data/examples/i18n/en/features/step_definitions/calculator_steps.rb +6 -1
  21. data/examples/i18n/eo/features/step_definitions/calculator_steps.rb +6 -1
  22. data/examples/i18n/es/features/step_definitions/calculador_steps.rb +6 -1
  23. data/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb +6 -1
  24. data/examples/i18n/fi/features/step_definitions/laskin_steps.rb +6 -1
  25. data/examples/i18n/fr/features/support/env.rb +6 -1
  26. data/examples/i18n/he/features/step_definitions/calculator_steps.rb +6 -1
  27. data/examples/i18n/hi/features/step_definitions/calculator_steps.rb +6 -1
  28. data/examples/i18n/ht/features/step_definitions/kalkilatris_steps.rb +6 -2
  29. data/examples/i18n/hu/features/step_definitions/calculator_steps.rb +6 -1
  30. data/examples/i18n/id/features/step_definitions/calculator_steps.rb +6 -1
  31. data/examples/i18n/it/features/step_definitions/calcolatrice_steps.rb +6 -1
  32. data/examples/i18n/ja/features/support/env.rb +6 -1
  33. data/examples/i18n/ko/features/step_definitions/calculator_steps.rb +6 -1
  34. data/examples/i18n/lt/features/step_definitions/calculator_steps.rb +6 -1
  35. data/examples/i18n/lv/features/step_definitions/calculator_steps.rb +6 -1
  36. data/examples/i18n/no/features/support/env.rb +6 -1
  37. data/examples/i18n/pl/features/step_definitions/calculator_steps.rb +6 -1
  38. data/examples/i18n/pl/features/support/env.rb +6 -1
  39. data/examples/i18n/pt/features/support/env.rb +6 -1
  40. data/examples/i18n/ro/features/step_definitions/calculator_steps.rb +6 -1
  41. data/examples/i18n/ru/features/support/env.rb +6 -1
  42. data/examples/i18n/ru/lib/calculator.rb +2 -1
  43. data/examples/i18n/sk/features/step_definitions/calculator_steps.rb +6 -1
  44. data/examples/i18n/sr-Cyrl/features/support/env.rb +6 -1
  45. data/examples/i18n/sr-Latn/features/step_definitions/calculator_steps.rb +6 -1
  46. data/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb +6 -1
  47. data/examples/i18n/tr/features/step_definitions/hesap_makinesi_adimlari.rb +6 -1
  48. data/examples/i18n/uk/features/support/env.rb +6 -1
  49. data/examples/i18n/uk/lib/calculator.rb +2 -1
  50. data/examples/i18n/uz/features/support/env.rb +6 -1
  51. data/examples/i18n/uz/lib/calculator.rb +2 -1
  52. data/examples/i18n/zh-CN/features/step_definitions/calculator_steps.rb +6 -1
  53. data/examples/i18n/zh-TW/features/step_definitions/calculator_steps.rb +6 -1
  54. data/examples/sinatra/features/support/env.rb +6 -1
  55. data/examples/tcl/features/support/env.rb +2 -1
  56. data/examples/watir/features/step_definitions/search_steps.rb +4 -3
  57. data/examples/watir/features/support/env.rb +5 -1
  58. data/features/docs/api/listen_for_events.feature +2 -2
  59. data/features/docs/cli/execute_with_tag_filter.feature +4 -2
  60. data/features/docs/defining_steps/ambiguous_steps.feature +89 -0
  61. data/features/docs/events/{test_case_starting_event.feature → test_case_started_event.feature} +3 -3
  62. data/features/docs/events/{test_run_starting_event.feature → test_run_started_event.feature} +5 -5
  63. data/features/docs/events/test_step_finished_event.feature +1 -1
  64. data/features/docs/events/{test_step_starting_event.feature → test_step_started_event.feature} +3 -3
  65. data/features/docs/extending_cucumber/custom_formatter.feature +5 -33
  66. data/features/docs/gherkin/outlines.feature +2 -4
  67. data/features/docs/writing_support_code/parameter_types.feature +12 -18
  68. data/features/lib/step_definitions/iso-8859-1_steps.rb +6 -3
  69. data/features/lib/support/fake_wire_server.rb +9 -1
  70. data/features/lib/support/parameter_types.rb +1 -4
  71. data/gem_tasks/fix_cr_lf.rake +17 -6
  72. data/lib/autotest/cucumber_mixin.rb +1 -1
  73. data/lib/cucumber/cli/configuration.rb +2 -2
  74. data/lib/cucumber/cli/options.rb +62 -41
  75. data/lib/cucumber/cli/profile_loader.rb +1 -1
  76. data/lib/cucumber/configuration.rb +3 -2
  77. data/lib/cucumber/deprecate.rb +2 -2
  78. data/lib/cucumber/events.rb +3 -3
  79. data/lib/cucumber/events/test_case_finished.rb +1 -1
  80. data/lib/cucumber/events/{test_case_starting.rb → test_case_started.rb} +1 -1
  81. data/lib/cucumber/events/{test_run_starting.rb → test_run_started.rb} +1 -1
  82. data/lib/cucumber/events/{test_step_starting.rb → test_step_started.rb} +1 -1
  83. data/lib/cucumber/filters.rb +1 -1
  84. data/lib/cucumber/filters/activate_steps.rb +6 -2
  85. data/lib/cucumber/filters/{broadcast_test_run_starting_event.rb → broadcast_test_run_started_event.rb} +2 -2
  86. data/lib/cucumber/formatter/console.rb +1 -1
  87. data/lib/cucumber/formatter/console_issues.rb +2 -2
  88. data/lib/cucumber/formatter/fail_fast.rb +1 -1
  89. data/lib/cucumber/formatter/html.rb +9 -10
  90. data/lib/cucumber/formatter/html_builder.rb +21 -11
  91. data/lib/cucumber/formatter/io.rb +1 -1
  92. data/lib/cucumber/formatter/json.rb +13 -12
  93. data/lib/cucumber/formatter/junit.rb +7 -7
  94. data/lib/cucumber/formatter/legacy_api/adapter.rb +30 -14
  95. data/lib/cucumber/formatter/legacy_api/ast.rb +10 -2
  96. data/lib/cucumber/formatter/progress.rb +2 -2
  97. data/lib/cucumber/formatter/rerun.rb +1 -1
  98. data/lib/cucumber/formatter/summary.rb +1 -1
  99. data/lib/cucumber/glue/dsl.rb +11 -25
  100. data/lib/cucumber/glue/proto_world.rb +0 -5
  101. data/lib/cucumber/hooks.rb +4 -4
  102. data/lib/cucumber/multiline_argument.rb +3 -11
  103. data/lib/cucumber/multiline_argument/data_table.rb +5 -3
  104. data/lib/cucumber/project_initializer.rb +1 -1
  105. data/lib/cucumber/rake/task.rb +8 -4
  106. data/lib/cucumber/runtime.rb +2 -2
  107. data/lib/cucumber/runtime/support_code.rb +1 -1
  108. data/lib/cucumber/runtime/user_interface.rb +5 -5
  109. data/lib/cucumber/step_match.rb +13 -0
  110. data/lib/cucumber/version +1 -1
  111. data/scripts/{update-history → update-changelog} +14 -11
  112. data/spec/cucumber/cli/configuration_spec.rb +13 -1
  113. data/spec/cucumber/cli/options_spec.rb +1 -1
  114. data/spec/cucumber/filters/activate_steps_spec.rb +4 -4
  115. data/spec/cucumber/formatter/fail_fast_spec.rb +1 -1
  116. data/spec/cucumber/formatter/html_spec.rb +1 -1
  117. data/spec/cucumber/formatter/json_spec.rb +26 -51
  118. data/spec/cucumber/formatter/junit_spec.rb +4 -4
  119. data/spec/cucumber/formatter/legacy_api/adapter_spec.rb +86 -98
  120. data/spec/cucumber/formatter/pretty_spec.rb +0 -13
  121. data/spec/cucumber/glue/snippet_spec.rb +2 -2
  122. data/spec/cucumber/hooks_spec.rb +2 -2
  123. data/spec/cucumber/multiline_argument/data_table_spec.rb +10 -5
  124. data/spec/cucumber/rake/forked_spec.rb +15 -11
  125. data/spec/cucumber/world/pending_spec.rb +1 -1
  126. data/spec/support/standard_step_actions.rb +1 -1
  127. metadata +25 -25
  128. data/features/docs/formatters/formatter_step_file_colon_line.feature +0 -44
@@ -10,11 +10,6 @@ module Cucumber
10
10
  # make sense in your domain. For more on that, see {Cucumber::Glue::Dsl#World}
11
11
  module ProtoWorld
12
12
 
13
- # Call a Transform with a string from another Transform definition
14
- def Transform(arg)
15
- super
16
- end
17
-
18
13
  # Run a single Gherkin step
19
14
  # @example Call another step
20
15
  # step "I am logged in"
@@ -19,7 +19,7 @@ module Cucumber
19
19
  end
20
20
 
21
21
  def after_step_hook(source, location, &block)
22
- raise ArgumentError unless source.last.kind_of?(Core::Ast::Step)
22
+ raise ArgumentError unless source.last.is_a?(Core::Ast::Step)
23
23
  build_hook_step(source, location, block, AfterStepHook, Core::Test::Action)
24
24
  end
25
25
 
@@ -43,7 +43,7 @@ module Cucumber
43
43
  @location = location
44
44
  end
45
45
 
46
- def name
46
+ def text
47
47
  'After hook'
48
48
  end
49
49
 
@@ -63,7 +63,7 @@ module Cucumber
63
63
  @location = location
64
64
  end
65
65
 
66
- def name
66
+ def text
67
67
  'Before hook'
68
68
  end
69
69
 
@@ -83,7 +83,7 @@ module Cucumber
83
83
  @location = location
84
84
  end
85
85
 
86
- def name
86
+ def text
87
87
  'AfterStep hook'
88
88
  end
89
89
 
@@ -11,14 +11,14 @@ module Cucumber
11
11
  builder.wrap(node)
12
12
  end
13
13
 
14
- def from(argument, location=nil)
14
+ def from(argument, location=nil, content_type=nil)
15
15
  location ||= Core::Ast::Location.of_caller
16
16
  case argument
17
17
  when String
18
- doc_string(argument, 'text/plain', location)
18
+ builder.doc_string(Core::Ast::DocString.new(argument, content_type, location))
19
19
  when Array
20
20
  location = location.on_line(argument.first.line..argument.last.line)
21
- data_table(argument.map{ |row| row.cells }, location)
21
+ builder.data_table(argument.map{ |row| row.cells }, location)
22
22
  when DataTable, DocString, None
23
23
  argument
24
24
  when nil
@@ -28,14 +28,6 @@ module Cucumber
28
28
  end
29
29
  end
30
30
 
31
- def doc_string(argument, content_type, location)
32
- builder.doc_string(Core::Ast::DocString.new(argument, content_type, location))
33
- end
34
-
35
- def data_table(data, location)
36
- builder.data_table(Core::Ast::DataTable.new(data, location))
37
- end
38
-
39
31
  private
40
32
 
41
33
  def builder
@@ -82,7 +82,7 @@ module Cucumber
82
82
  # @param header_mappings [Hash] see map_headers!
83
83
  # @param header_conversion_proc [Proc] see map_headers!
84
84
  def initialize(data, conversion_procs = NULL_CONVERSIONS.dup, header_mappings = {}, header_conversion_proc = nil)
85
- raise ArgumentError, 'data must be a Core::Ast::DataTable' unless data.kind_of? Core::Ast::DataTable
85
+ raise ArgumentError, 'data must be a Core::Ast::DataTable' unless data.is_a? Core::Ast::DataTable
86
86
  ast_table = data
87
87
  # Verify that it's square
88
88
  ast_table.transpose
@@ -159,8 +159,10 @@ module Cucumber
159
159
  # [{:foo => '2', :bar => '3', :foo_bar => '5'}, {:foo => '7', :bar => '9', :foo_bar => '16'}]
160
160
  #
161
161
  def symbolic_hashes
162
- @header_conversion_proc = lambda { |h| symbolize_key(h) }
163
- @symbolic_hashes ||= build_hashes
162
+ @symbolic_hashes ||=
163
+ self.hashes.map do |string_hash|
164
+ Hash[string_hash.map{ |a,b| [symbolize_key(a), b] }]
165
+ end
164
166
  end
165
167
 
166
168
  # Converts this table into a Hash where the first column is
@@ -27,7 +27,7 @@ module Cucumber
27
27
  :touch
28
28
  end
29
29
 
30
- report_exists(file_name) || return if File.exists?(file_name)
30
+ report_exists(file_name) || return if File.exist?(file_name)
31
31
 
32
32
  report_creating(file_name)
33
33
  FileUtils.send file_type, file_name
@@ -81,11 +81,15 @@ module Cucumber
81
81
 
82
82
  def cmd
83
83
  if use_bundler
84
- [ Cucumber::RUBY_BINARY, '-S', 'bundle', 'exec', 'cucumber', @cucumber_opts,
85
- @feature_files ].flatten
84
+ [
85
+ Cucumber::RUBY_BINARY,'-S', 'bundle', 'exec', 'cucumber',
86
+ @cucumber_opts, @feature_files
87
+ ].flatten
86
88
  else
87
- [ Cucumber::RUBY_BINARY, '-I', load_path, quoted_binary(@cucumber_bin),
88
- @cucumber_opts, @feature_files ].flatten
89
+ [
90
+ Cucumber::RUBY_BINARY, '-I', load_path,
91
+ quoted_binary(@cucumber_bin), @cucumber_opts, @feature_files
92
+ ].flatten
89
93
  end
90
94
  end
91
95
 
@@ -229,7 +229,7 @@ module Cucumber
229
229
  if @configuration.wip?
230
230
  summary_report.test_cases.total_passed > 0
231
231
  else
232
- !summary_report.ok?(@configuration.strict?)
232
+ !summary_report.ok?(@configuration.strict)
233
233
  end
234
234
  end
235
235
  public :failure?
@@ -256,7 +256,7 @@ module Cucumber
256
256
  filters << Filters::ApplyBeforeHooks.new(@support_code)
257
257
  filters << Filters::ApplyAfterHooks.new(@support_code)
258
258
  filters << Filters::ApplyAroundHooks.new(@support_code)
259
- filters << Filters::BroadcastTestRunStartingEvent.new(@configuration)
259
+ filters << Filters::BroadcastTestRunStartedEvent.new(@configuration)
260
260
  filters << Filters::Quit.new
261
261
  filters << Filters::Retry.new(@configuration)
262
262
  # need to do this last so it becomes the first test step
@@ -34,7 +34,7 @@ module Cucumber
34
34
 
35
35
  if argument
36
36
  if argument[:type] == :DocString
37
- MultilineArgument.doc_string(argument[:content], argument[:content_type], location)
37
+ MultilineArgument.from(argument[:content], location, argument[:content_type])
38
38
  else
39
39
  MultilineArgument::DataTable.from(argument[:rows].map { |row| row[:cells].map { |cell| cell[:value] } })
40
40
  end
@@ -33,11 +33,11 @@ module Cucumber
33
33
  STDOUT.flush
34
34
  puts(question)
35
35
 
36
- if(Cucumber::JRUBY)
37
- answer = jruby_gets(timeout_seconds)
38
- else
39
- answer = mri_gets(timeout_seconds)
40
- end
36
+ answer = if(Cucumber::JRUBY)
37
+ jruby_gets(timeout_seconds)
38
+ else
39
+ mri_gets(timeout_seconds)
40
+ end
41
41
 
42
42
  raise("Waited for input for #{timeout_seconds} seconds, then timed out.") unless answer
43
43
  puts(answer)
@@ -140,4 +140,17 @@ module Cucumber
140
140
  return test_step
141
141
  end
142
142
  end
143
+
144
+ class AmbiguousStepMatch
145
+
146
+ def initialize(error)
147
+ @error = error
148
+ end
149
+
150
+ def activate(test_step)
151
+ return test_step.with_action { raise @error }
152
+ end
153
+
154
+ end
155
+
143
156
  end
@@ -1 +1 @@
1
- 3.0.0.pre.2
1
+ 3.0.1
@@ -11,7 +11,10 @@ class PullRequest
11
11
 
12
12
  def entry
13
13
  pr = gh.pull_request('cucumber/cucumber-ruby', num)
14
- "#{pr['title']} ([##{num}(#{pr['url']}) @#{pr['user']['login']})"
14
+ username = pr['user']['login']
15
+ url = pr['html_url']
16
+ title = pr['title']
17
+ "#{title} ([##{num}](#{url}) [@#{username}](https://github.com/#{username}))"
15
18
  end
16
19
 
17
20
  def labels
@@ -32,12 +35,12 @@ class PullRequest
32
35
  end
33
36
  end
34
37
 
35
- class HistoryFile
38
+ class Changelog
36
39
  def self.open(path, &block)
37
- full_path = File.expand_path(File.dirname(__FILE__) + '/' + path + '/History.md')
38
- history = new(File.read(full_path))
39
- history.instance_exec(&block)
40
- File.write(full_path, history.body)
40
+ full_path = File.expand_path(File.dirname(__FILE__) + '/' + path + '/CHANGELOG.md')
41
+ log = new(File.read(full_path))
42
+ log.instance_exec(&block)
43
+ File.write(full_path, log.body)
41
44
  end
42
45
 
43
46
  attr_reader :lines
@@ -49,16 +52,16 @@ class HistoryFile
49
52
  def insert(label, entry)
50
53
  section_index = lines.index { |line| line.strip == heading_for(label) }
51
54
  unless section_index
52
- raise("Unable to find matching heading in History.md for '#{label}' (#{heading_for(label)})")
55
+ raise("Unable to find matching heading in CHANGELOG.md for '#{label}' (#{heading_for(label)})")
53
56
  end
54
57
  lines.insert(section_index + 2, "* #{entry}\n")
55
58
  end
56
59
 
57
60
  def heading_for(label)
58
61
  text = {
59
- 'type: new feature' => 'New Features',
60
- 'type: bug' => 'Bugfixes',
61
- 'type: refactoring / developer experience' => 'Refactoring / Developer Experience'
62
+ 'type: new feature' => 'Added',
63
+ 'type: bug' => 'Fixed',
64
+ 'type: refactoring / developer experience' => 'Changed'
62
65
  }.fetch(label)
63
66
  "### #{text}"
64
67
  end
@@ -75,7 +78,7 @@ begin
75
78
  gh = Octokit::Client.new(access_token: token)
76
79
  pr = PullRequest.new(gh, num)
77
80
 
78
- HistoryFile.open('..') do
81
+ Changelog.open('..') do
79
82
  insert(pr.type_label, pr.entry)
80
83
  end
81
84
  rescue StandardError => error
@@ -71,7 +71,19 @@ module Cli
71
71
 
72
72
  config.parse!(%w{--profile bongo})
73
73
 
74
- expect(config.options[:strict]).to be true
74
+ expect(config.options[:strict].strict?(:undefined)).to be true
75
+ expect(config.options[:strict].strict?(:pending)).to be true
76
+ expect(config.options[:strict].strict?(:flaky)).to be true
77
+ end
78
+
79
+ it 'allows --strict from a profile to be selectively overridden' do
80
+ given_cucumber_yml_defined_as({'bongo' => '--strict'})
81
+
82
+ config.parse!(%w{--profile bongo --no-strict-flaky})
83
+
84
+ expect(config.options[:strict].strict?(:undefined)).to be true
85
+ expect(config.options[:strict].strict?(:pending)).to be true
86
+ expect(config.options[:strict].strict?(:flaky)).to be false
75
87
  end
76
88
 
77
89
  it 'parses ERB syntax in the cucumber.yml file' do
@@ -310,7 +310,7 @@ module Cucumber
310
310
  <% $cucumber_yml_read_count += 1 %>
311
311
  default: --format pretty
312
312
  END
313
- )
313
+ )
314
314
  options = Options.new(output_stream, error_stream, :default_profile => 'default')
315
315
  options.parse!(%w(-f progress))
316
316
 
@@ -27,7 +27,7 @@ describe Cucumber::Filters::ActivateSteps do
27
27
 
28
28
  it 'activates each step' do
29
29
  expect(step_match).to receive(:activate) do |test_step|
30
- expect(test_step.name).to eq 'a passing step'
30
+ expect(test_step.text).to eq 'a passing step'
31
31
  end
32
32
  compile [doc], receiver, [filter]
33
33
  end
@@ -35,7 +35,7 @@ describe Cucumber::Filters::ActivateSteps do
35
35
  it 'notifies with a StepActivated event' do
36
36
  expect(configuration).to receive(:notify) do |message, test_step, step_match|
37
37
  expect(message).to eq :step_activated
38
- expect(test_step.name).to eq 'a passing step'
38
+ expect(test_step.text).to eq 'a passing step'
39
39
  expect(step_match).to eq step_match
40
40
  end
41
41
  compile [doc], receiver, [filter]
@@ -60,7 +60,7 @@ describe Cucumber::Filters::ActivateSteps do
60
60
 
61
61
  it 'activates each step' do
62
62
  expect(step_match).to receive(:activate) do |test_step|
63
- expect(test_step.name).to eq 'a passing step'
63
+ expect(test_step.text).to eq 'a passing step'
64
64
  end
65
65
  compile [doc], receiver, [filter]
66
66
  end
@@ -115,7 +115,7 @@ describe Cucumber::Filters::ActivateSteps do
115
115
  it 'notifies with a StepActivated event' do
116
116
  expect(configuration).to receive(:notify) do |message, test_step, step_match|
117
117
  expect(message).to eq :step_activated
118
- expect(test_step.name).to eq 'a passing step'
118
+ expect(test_step.text).to eq 'a passing step'
119
119
  expect(step_match).to eq step_match
120
120
  end
121
121
  compile [doc], receiver, [filter]
@@ -75,7 +75,7 @@ module Cucumber::Formatter
75
75
  end
76
76
 
77
77
  context 'in strict mode' do
78
- let(:configuration) { Cucumber::Configuration.new strict: true }
78
+ let(:configuration) { Cucumber::Configuration.new strict: Cucumber::Core::Test::Result::StrictConfiguration.new([:undefined]) }
79
79
 
80
80
  it 'sets Cucumber.wants_to_quit' do
81
81
  execute [@gherkin], [StandardStepActions.new], configuration.event_bus
@@ -355,7 +355,7 @@ module Cucumber
355
355
 
356
356
  describe 'with a step that embeds a text' do
357
357
  define_steps do
358
- Given(/log/) { embed('log.txt', 'text/plain') }
358
+ Given(/log/) { embed('log.txt', 'text/plain', 'foo') }
359
359
  end
360
360
 
361
361
  define_feature(<<-FEATURE)
@@ -18,31 +18,6 @@ module Cucumber
18
18
  run_defined_feature
19
19
  end
20
20
 
21
- describe 'with a scenario with no steps' do
22
- define_feature <<-FEATURE
23
- Feature: Banana party
24
-
25
- Scenario: Monkey eats bananas
26
- FEATURE
27
-
28
- it 'outputs the json data' do
29
- expect(load_normalised_json(@out)).to eq MultiJson.load(%{
30
- [{"id": "banana-party",
31
- "uri": "spec.feature",
32
- "keyword": "Feature",
33
- "name": "Banana party",
34
- "line": 1,
35
- "description": "",
36
- "elements":
37
- [{"id": "banana-party;monkey-eats-bananas",
38
- "keyword": "Scenario",
39
- "name": "Monkey eats bananas",
40
- "line": 3,
41
- "description": "",
42
- "type": "scenario"}]}]})
43
- end
44
- end
45
-
46
21
  describe 'with a scenario with an undefined step' do
47
22
  define_feature <<-FEATURE
48
23
  Feature: Banana party
@@ -106,7 +81,7 @@ module Cucumber
106
81
  [{"keyword": "Given ",
107
82
  "name": "there are bananas",
108
83
  "line": 4,
109
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:87"},
84
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:62"},
110
85
  "result": {"status": "passed",
111
86
  "duration": 1}}]}]}]})
112
87
  end
@@ -143,9 +118,9 @@ module Cucumber
143
118
  [{"keyword": "Given ",
144
119
  "name": "there are bananas",
145
120
  "line": 4,
146
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:124"},
121
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:99"},
147
122
  "result": {"status": "failed",
148
- "error_message": "no bananas (RuntimeError)\\n./spec/cucumber/formatter/json_spec.rb:124:in `/^there are bananas$/'\\nspec.feature:4:in `Given there are bananas'",
123
+ "error_message": "no bananas (RuntimeError)\\n./spec/cucumber/formatter/json_spec.rb:99:in `/^there are bananas$/'\\nspec.feature:4:in `Given there are bananas'",
149
124
  "duration": 1}}]}]}]})
150
125
  end
151
126
  end
@@ -181,9 +156,9 @@ module Cucumber
181
156
  [{"keyword": "Given ",
182
157
  "name": "there are bananas",
183
158
  "line": 4,
184
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:162"},
159
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:137"},
185
160
  "result": {"status": "pending",
186
- "error_message": "TODO (Cucumber::Pending)\\n./spec/cucumber/formatter/json_spec.rb:162:in `/^there are bananas$/'\\nspec.feature:4:in `Given there are bananas'",
161
+ "error_message": "TODO (Cucumber::Pending)\\n./spec/cucumber/formatter/json_spec.rb:137:in `/^there are bananas$/'\\nspec.feature:4:in `Given there are bananas'",
187
162
  "duration": 1}}]}]}]})
188
163
  end
189
164
  end
@@ -223,7 +198,7 @@ module Cucumber
223
198
  [{"keyword": "Given ",
224
199
  "name": "there are bananas",
225
200
  "line": 8,
226
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:204"},
201
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:179"},
227
202
  "result": {"status": "passed",
228
203
  "duration": 1}}]}]}]})
229
204
  end
@@ -277,7 +252,7 @@ module Cucumber
277
252
  [{"keyword": "Given ",
278
253
  "name": "there are bananas",
279
254
  "line": 6,
280
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:252"},
255
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:227"},
281
256
  "result": {"status": "passed",
282
257
  "duration": 1}}]},
283
258
  {"id": "banana-party;monkey-eats-bananas;fruit-table;2",
@@ -296,7 +271,7 @@ module Cucumber
296
271
  [{"keyword": "Given ",
297
272
  "name": "there are bananas",
298
273
  "line": 15,
299
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:252"},
274
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:227"},
300
275
  "result": {"status": "passed",
301
276
  "duration": 1}}]}]}]})
302
277
  end
@@ -355,7 +330,7 @@ module Cucumber
355
330
  [{"keyword": "Given ",
356
331
  "name": "there are bananas",
357
332
  "line": 6,
358
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:332"},
333
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:307"},
359
334
  "result": {"status": "passed",
360
335
  "duration": 1}}]},
361
336
  {"id": "banana-party;monkey-eats-bananas",
@@ -372,7 +347,7 @@ module Cucumber
372
347
  "line": 11,
373
348
  "comments": [{"value": "#step comment1",
374
349
  "line": 10}],
375
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:333"},
350
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:308"},
376
351
  "result": {"status": "passed",
377
352
  "duration": 1}}]},
378
353
  {"keyword": "Background",
@@ -386,7 +361,7 @@ module Cucumber
386
361
  [{"keyword": "Given ",
387
362
  "name": "there are bananas",
388
363
  "line": 6,
389
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:332"},
364
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:307"},
390
365
  "result": {"status": "passed",
391
366
  "duration": 1}}]},
392
367
  {"id": "banana-party;monkey-eats-bananas;fruit-table;2",
@@ -407,7 +382,7 @@ module Cucumber
407
382
  "line": 22,
408
383
  "comments": [{"value": "#step comment2",
409
384
  "line": 15}],
410
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:333"},
385
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:308"},
411
386
  "result": {"status": "passed",
412
387
  "duration": 1}}]}]}]})
413
388
  end
@@ -450,7 +425,7 @@ module Cucumber
450
425
  "doc_string": {"value": "the doc string",
451
426
  "content_type": "",
452
427
  "line": 5},
453
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:428"},
428
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:403"},
454
429
  "result": {"status": "passed",
455
430
  "duration": 1}}]}]}]})
456
431
  end
@@ -488,7 +463,7 @@ module Cucumber
488
463
  "name": "there are bananas",
489
464
  "line": 4,
490
465
  "output": ["from step"],
491
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:468"},
466
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:443"},
492
467
  "result": {"status": "passed",
493
468
  "duration": 1}}]}]}]})
494
469
  end
@@ -600,7 +575,7 @@ module Cucumber
600
575
  "line": 4,
601
576
  "embeddings": [{"mime_type": "mime-type",
602
577
  "data": "YWJj"}],
603
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:578"},
578
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:553"},
604
579
  "result": {"status": "passed",
605
580
  "duration": 1}}]}]}]})
606
581
  end
@@ -645,7 +620,7 @@ module Cucumber
645
620
  "line": 4,
646
621
  "embeddings": [{"mime_type": "image/png",
647
622
  "data": "Zm9v"}],
648
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:618"},
623
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:593"},
649
624
  "result": {"status": "passed",
650
625
  "duration": 1}}]}]}]})
651
626
  end
@@ -686,31 +661,31 @@ module Cucumber
686
661
  "description": "",
687
662
  "type": "scenario",
688
663
  "before":
689
- [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:663"},
664
+ [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:638"},
690
665
  "result": {"status": "passed",
691
666
  "duration": 1}},
692
- {"match": {"location": "spec/cucumber/formatter/json_spec.rb:664"},
667
+ {"match": {"location": "spec/cucumber/formatter/json_spec.rb:639"},
693
668
  "result": {"status": "passed",
694
669
  "duration": 1}}],
695
670
  "steps":
696
671
  [{"keyword": "Given ",
697
672
  "name": "there are bananas",
698
673
  "line": 4,
699
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:670"},
674
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:645"},
700
675
  "result": {"status": "passed",
701
676
  "duration": 1},
702
677
  "after":
703
- [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:667"},
678
+ [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:642"},
704
679
  "result": {"status": "passed",
705
680
  "duration": 1}},
706
- {"match": {"location": "spec/cucumber/formatter/json_spec.rb:668"},
681
+ {"match": {"location": "spec/cucumber/formatter/json_spec.rb:643"},
707
682
  "result": {"status": "passed",
708
683
  "duration": 1}}]}],
709
684
  "after":
710
- [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:666"},
685
+ [{"match": {"location": "spec/cucumber/formatter/json_spec.rb:641"},
711
686
  "result": {"status": "passed",
712
687
  "duration": 1}},
713
- {"match": {"location": "spec/cucumber/formatter/json_spec.rb:665"},
688
+ {"match": {"location": "spec/cucumber/formatter/json_spec.rb:640"},
714
689
  "result": {"status": "passed",
715
690
  "duration": 1}}]}]}]})
716
691
  end
@@ -748,13 +723,13 @@ module Cucumber
748
723
  [{"keyword": "Given ",
749
724
  "name": "there are bananas",
750
725
  "line": 4,
751
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:729"},
726
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:704"},
752
727
  "result": {"status": "passed",
753
728
  "duration": 1}}],
754
729
  "around":
755
730
  [{"match": {"location": "unknown_hook_location:1"},
756
731
  "result": {"status": "failed",
757
- "error_message": "error (RuntimeError)\\n./spec/cucumber/formatter/json_spec.rb:728:in `Around'",
732
+ "error_message": "error (RuntimeError)\\n./spec/cucumber/formatter/json_spec.rb:703:in `Around'",
758
733
  "duration": 1}}]}]}]})
759
734
  end
760
735
  end
@@ -795,7 +770,7 @@ module Cucumber
795
770
  "rows":
796
771
  [{"cells": ["aa", "bb"]},
797
772
  {"cells": ["cc", "dd"]}],
798
- "match": {"location": "spec/cucumber/formatter/json_spec.rb:773"},
773
+ "match": {"location": "spec/cucumber/formatter/json_spec.rb:748"},
799
774
  "result": {"status": "passed",
800
775
  "duration": 1}}]}]}]})
801
776
  end