cucumber 3.0.0.pre.2 → 3.0.0

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 +2 -2
  7. data/{History.md → CHANGELOG.md} +69 -13
  8. data/appveyor.yml +2 -1
  9. data/bin/cucumber +2 -1
  10. data/cucumber.gemspec +1 -1
  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 +1 -23
  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 +7 -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
@@ -22,19 +22,6 @@ module Cucumber
22
22
  run_defined_feature
23
23
  end
24
24
 
25
- describe 'with a scenario with no steps' do
26
- define_feature <<-FEATURE
27
- Feature: Banana party
28
-
29
- Scenario: Monkey eats banana
30
- FEATURE
31
-
32
- it 'outputs the scenario name' do
33
- expect(@out.string).to include 'Scenario: Monkey eats banana'
34
- end
35
- end
36
-
37
-
38
25
  describe 'with a scenario' do
39
26
  define_feature <<-FEATURE
40
27
  Feature: Banana party
@@ -148,7 +148,7 @@ module Cucumber
148
148
  'veg',
149
149
  /(cuke|banana)s?/,
150
150
  Object,
151
- ->(s) { s},
151
+ ->(s) { s },
152
152
  true,
153
153
  false
154
154
  ))
@@ -156,7 +156,7 @@ module Cucumber
156
156
  'cucumis',
157
157
  /(bella|cuke)s?/,
158
158
  Object,
159
- ->(s) { s},
159
+ ->(s) { s },
160
160
  true,
161
161
  false
162
162
  ))
@@ -2,8 +2,8 @@
2
2
  require 'cucumber/hooks'
3
3
  module Cucumber::Hooks
4
4
  shared_examples_for 'a source node' do
5
- it 'responds to name' do
6
- expect( subject.name ).to be_a(String)
5
+ it 'responds to text' do
6
+ expect( subject.text ).to be_a(String)
7
7
  end
8
8
 
9
9
  it 'responds to location' do
@@ -53,6 +53,11 @@ module Cucumber
53
53
  expect{@table.symbolic_hashes}.to_not raise_error
54
54
  end
55
55
 
56
+ it 'should not interfere with use of #hashes' do
57
+ @table.symbolic_hashes
58
+ expect{@table.hashes}.to_not raise_error
59
+ end
60
+
56
61
  end
57
62
 
58
63
  describe '#map_column!' do
@@ -457,7 +462,7 @@ module Cucumber
457
462
  ])
458
463
  t2 = DataTable.from([
459
464
  %w(name male lastname swedish),
460
- ['aslak', true, 'hellesøy', false]
465
+ ['aslak', true, 'hellesøy', false]
461
466
  ])
462
467
  expect { t1.diff!(t2) }.to raise_error(DataTable::Different) do |error|
463
468
  expect(error.table.to_s(indent: 14, color: false)).to eq %{
@@ -476,7 +481,7 @@ module Cucumber
476
481
  t1.map_column!('male') { |m| m == 'true' }
477
482
  t2 = DataTable.from([
478
483
  %w(name male),
479
- ['aslak', true]
484
+ ['aslak', true]
480
485
  ])
481
486
  t1.diff!(t2)
482
487
  expect( t1.to_s(:indent => 12, :color => false) ).to eq %{
@@ -488,7 +493,7 @@ module Cucumber
488
493
  it 'should allow column mapping of argument before diffing' do
489
494
  t1 = DataTable.from([
490
495
  %w(name male),
491
- ['aslak', true]
496
+ ['aslak', true]
492
497
  ])
493
498
  t1.map_column!('male') {
494
499
  'true'
@@ -513,7 +518,7 @@ module Cucumber
513
518
  t1.map_column!('male') { |m| m == 'true' }
514
519
  t2 = DataTable.from([
515
520
  %w(name male),
516
- ['aslak', true]
521
+ ['aslak', true]
517
522
  ])
518
523
  t1.diff!(t2)
519
524
  expect( t1.to_s(:indent => 12, :color => false) ).to eq %{
@@ -529,7 +534,7 @@ module Cucumber
529
534
  ])
530
535
  t2 = DataTable.from([
531
536
  %w(X Y),
532
- [2, 1]
537
+ [2, 1]
533
538
  ])
534
539
  expect { t1.diff!(t2) }.to raise_error(DataTable::Different) do |error|
535
540
  expect(error.table.to_s(indent: 14, color: false)).to eq %{
@@ -22,12 +22,14 @@ module Cucumber
22
22
  end
23
23
 
24
24
  it 'uses bundle exec to find cucumber and libraries' do
25
- expect(subject.cmd).to eq [Cucumber::RUBY_BINARY,
26
- '-S',
27
- 'bundle',
28
- 'exec',
29
- 'cucumber',
30
- '--cuke-option'] + feature_files
25
+ expect(subject.cmd).to eq [
26
+ Cucumber::RUBY_BINARY,
27
+ '-S',
28
+ 'bundle',
29
+ 'exec',
30
+ 'cucumber',
31
+ '--cuke-option'
32
+ ] + feature_files
31
33
  end
32
34
  end
33
35
 
@@ -42,11 +44,13 @@ module Cucumber
42
44
  end
43
45
 
44
46
  it 'uses well known cucumber location and specified libraries' do
45
- expect(subject.cmd).to eq [Cucumber::RUBY_BINARY,
46
- '-I',
47
- '"lib"',
48
- "\"#{Cucumber::BINARY}\"",
49
- '--cuke-option'] + feature_files
47
+ expect(subject.cmd).to eq [
48
+ Cucumber::RUBY_BINARY,
49
+ '-I',
50
+ '"lib"',
51
+ "\"#{Cucumber::BINARY}\"",
52
+ '--cuke-option'
53
+ ] + feature_files
50
54
  end
51
55
  end
52
56
  end
@@ -40,7 +40,7 @@ module Cucumber
40
40
  it 'raises a Pending if a supplied block starts working' do
41
41
  expect(-> {
42
42
  @world.pending 'TODO' do
43
- # success!
43
+ # success!
44
44
  end
45
45
  }).to raise_error(Cucumber::Pending, /TODO/)
46
46
  end
@@ -3,7 +3,7 @@
3
3
  class StandardStepActions < Cucumber::Core::Filter.new
4
4
  def test_case(test_case)
5
5
  test_steps = test_case.test_steps.map do |step|
6
- case step.name
6
+ case step.text
7
7
  when /fail/
8
8
  step.with_action { raise Failure }
9
9
  when /pass/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre.2
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aslak Hellesøy
@@ -10,22 +10,22 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-07-26 00:00:00.000000000 Z
13
+ date: 2017-09-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: cucumber-core
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - '='
19
+ - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: 3.0.0.pre.2
21
+ version: 3.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - '='
26
+ - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: 3.0.0.pre.2
28
+ version: 3.0.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: builder
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -377,6 +377,7 @@ extra_rdoc_files: []
377
377
  files:
378
378
  - ".coveralls.yml"
379
379
  - ".cucumberproignore"
380
+ - ".gitattributes"
380
381
  - ".github/ISSUE_TEMPLATE.md"
381
382
  - ".github/PULL_REQUEST_TEMPLATE.md"
382
383
  - ".rspec"
@@ -385,9 +386,9 @@ files:
385
386
  - ".ruby-gemset"
386
387
  - ".travis.yml"
387
388
  - ".yardopts"
389
+ - CHANGELOG.md
388
390
  - CONTRIBUTING.md
389
391
  - Gemfile
390
- - History.md
391
392
  - LICENSE
392
393
  - README.md
393
394
  - Rakefile
@@ -642,6 +643,7 @@ files:
642
643
  - features/docs/cli/showing_differences.feature
643
644
  - features/docs/cli/specifying_multiple_formatters.feature
644
645
  - features/docs/cli/strict_mode.feature
646
+ - features/docs/defining_steps/ambiguous_steps.feature
645
647
  - features/docs/defining_steps/nested_steps.feature
646
648
  - features/docs/defining_steps/nested_steps_i18n.feature
647
649
  - features/docs/defining_steps/nested_steps_with_second_arg.feature
@@ -654,11 +656,11 @@ files:
654
656
  - features/docs/events/step_activated_event.feature
655
657
  - features/docs/events/step_definition_registered_event.feature
656
658
  - features/docs/events/test_case_finished_event.feature
657
- - features/docs/events/test_case_starting_event.feature
659
+ - features/docs/events/test_case_started_event.feature
658
660
  - features/docs/events/test_run_finished_event.feature
659
- - features/docs/events/test_run_starting_event.feature
661
+ - features/docs/events/test_run_started_event.feature
660
662
  - features/docs/events/test_step_finished_event.feature
661
- - features/docs/events/test_step_starting_event.feature
663
+ - features/docs/events/test_step_started_event.feature
662
664
  - features/docs/exception_in_after_hook.feature
663
665
  - features/docs/exception_in_after_step_hook.feature
664
666
  - features/docs/exception_in_around_hook.feature
@@ -666,7 +668,6 @@ files:
666
668
  - features/docs/extending_cucumber/custom_filter.feature
667
669
  - features/docs/extending_cucumber/custom_formatter.feature
668
670
  - features/docs/formatters/api_methods.feature
669
- - features/docs/formatters/formatter_step_file_colon_line.feature
670
671
  - features/docs/formatters/html_formatter.feature
671
672
  - features/docs/formatters/json_formatter.feature
672
673
  - features/docs/formatters/junit_formatter.feature
@@ -751,11 +752,11 @@ files:
751
752
  - lib/cucumber/events/step_activated.rb
752
753
  - lib/cucumber/events/step_definition_registered.rb
753
754
  - lib/cucumber/events/test_case_finished.rb
754
- - lib/cucumber/events/test_case_starting.rb
755
+ - lib/cucumber/events/test_case_started.rb
755
756
  - lib/cucumber/events/test_run_finished.rb
756
- - lib/cucumber/events/test_run_starting.rb
757
+ - lib/cucumber/events/test_run_started.rb
757
758
  - lib/cucumber/events/test_step_finished.rb
758
- - lib/cucumber/events/test_step_starting.rb
759
+ - lib/cucumber/events/test_step_started.rb
759
760
  - lib/cucumber/file_specs.rb
760
761
  - lib/cucumber/filters.rb
761
762
  - lib/cucumber/filters/activate_steps.rb
@@ -763,7 +764,7 @@ files:
763
764
  - lib/cucumber/filters/apply_after_step_hooks.rb
764
765
  - lib/cucumber/filters/apply_around_hooks.rb
765
766
  - lib/cucumber/filters/apply_before_hooks.rb
766
- - lib/cucumber/filters/broadcast_test_run_starting_event.rb
767
+ - lib/cucumber/filters/broadcast_test_run_started_event.rb
767
768
  - lib/cucumber/filters/gated_receiver.rb
768
769
  - lib/cucumber/filters/prepare_world.rb
769
770
  - lib/cucumber/filters/quit.rb
@@ -848,7 +849,7 @@ files:
848
849
  - lib/cucumber/version
849
850
  - lib/simplecov_setup.rb
850
851
  - scripts/invite-collaborator
851
- - scripts/update-history
852
+ - scripts/update-changelog
852
853
  - spec/cucumber/cli/configuration_spec.rb
853
854
  - spec/cucumber/cli/main_spec.rb
854
855
  - spec/cucumber/cli/options_spec.rb
@@ -914,15 +915,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
914
915
  version: 1.9.3
915
916
  required_rubygems_version: !ruby/object:Gem::Requirement
916
917
  requirements:
917
- - - ">"
918
+ - - ">="
918
919
  - !ruby/object:Gem::Version
919
- version: 1.3.1
920
+ version: '0'
920
921
  requirements: []
921
922
  rubyforge_project:
922
- rubygems_version: 2.6.8
923
+ rubygems_version: 2.5.1
923
924
  signing_key:
924
925
  specification_version: 4
925
- summary: cucumber-3.0.0.pre.2
926
+ summary: cucumber-3.0.0
926
927
  test_files:
927
928
  - features/docs/api/list_step_defs_as_json.feature
928
929
  - features/docs/api/listen_for_events.feature
@@ -943,6 +944,7 @@ test_files:
943
944
  - features/docs/cli/showing_differences.feature
944
945
  - features/docs/cli/specifying_multiple_formatters.feature
945
946
  - features/docs/cli/strict_mode.feature
947
+ - features/docs/defining_steps/ambiguous_steps.feature
946
948
  - features/docs/defining_steps/nested_steps.feature
947
949
  - features/docs/defining_steps/nested_steps_i18n.feature
948
950
  - features/docs/defining_steps/nested_steps_with_second_arg.feature
@@ -955,11 +957,11 @@ test_files:
955
957
  - features/docs/events/step_activated_event.feature
956
958
  - features/docs/events/step_definition_registered_event.feature
957
959
  - features/docs/events/test_case_finished_event.feature
958
- - features/docs/events/test_case_starting_event.feature
960
+ - features/docs/events/test_case_started_event.feature
959
961
  - features/docs/events/test_run_finished_event.feature
960
- - features/docs/events/test_run_starting_event.feature
962
+ - features/docs/events/test_run_started_event.feature
961
963
  - features/docs/events/test_step_finished_event.feature
962
- - features/docs/events/test_step_starting_event.feature
964
+ - features/docs/events/test_step_started_event.feature
963
965
  - features/docs/exception_in_after_hook.feature
964
966
  - features/docs/exception_in_after_step_hook.feature
965
967
  - features/docs/exception_in_around_hook.feature
@@ -967,7 +969,6 @@ test_files:
967
969
  - features/docs/extending_cucumber/custom_filter.feature
968
970
  - features/docs/extending_cucumber/custom_formatter.feature
969
971
  - features/docs/formatters/api_methods.feature
970
- - features/docs/formatters/formatter_step_file_colon_line.feature
971
972
  - features/docs/formatters/html_formatter.feature
972
973
  - features/docs/formatters/json_formatter.feature
973
974
  - features/docs/formatters/junit_formatter.feature
@@ -1065,4 +1066,3 @@ test_files:
1065
1066
  - spec/cucumber/world/pending_spec.rb
1066
1067
  - spec/spec_helper.rb
1067
1068
  - spec/support/standard_step_actions.rb
1068
- has_rdoc:
@@ -1,44 +0,0 @@
1
- Feature: Formatter API: Step file path and line number (Issue #179)
2
- To all reporter to understand location of current executing step let's fetch this information
3
- from step/step_invocation and pass to reporters
4
-
5
- Scenario: my own formatter
6
- Given a file named "features/f.feature" with:
7
- """
8
- Feature: I'll use my own
9
- because I'm worth it
10
- Scenario: just print step current line and feature file name
11
- Given step at line 4
12
- Given step at line 5
13
- """
14
- And a file named "features/step_definitions/steps.rb" with:
15
- """
16
- Given(/^step at line (.*)$/) {|line| }
17
- """
18
- And a file named "features/support/jb/formatter.rb" with:
19
- """
20
- module Jb
21
- class Formatter
22
- def initialize(runtime, io, options)
23
- @io = io
24
- end
25
-
26
- def before_step_result(keyword, step_match, multiline_arg, status, exception, source_indent, background, file_colon_line)
27
- @io.puts "step result event: #{file_colon_line}"
28
- end
29
-
30
- def step_name(keyword, step_match, status, source_indent, background, file_colon_line)
31
- @io.puts "step name event: #{file_colon_line}"
32
- end
33
- end
34
- end
35
- """
36
- When I run `cucumber features/f.feature --format Jb::Formatter`
37
- Then it should pass with exactly:
38
- """
39
- step result event: features/f.feature:4
40
- step name event: features/f.feature:4
41
- step result event: features/f.feature:5
42
- step name event: features/f.feature:5
43
-
44
- """