cucumber 11.1.1 → 12.0.0

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/cucumber/cli/configuration.rb +0 -6
  4. data/lib/cucumber/cli/options.rb +0 -16
  5. data/lib/cucumber/configuration.rb +5 -5
  6. data/lib/cucumber/errors.rb +43 -23
  7. data/lib/cucumber/events/attach_called.rb +12 -3
  8. data/lib/cucumber/events/envelope.rb +2 -2
  9. data/lib/cucumber/events/gherkin_source_parsed.rb +1 -3
  10. data/lib/cucumber/events/gherkin_source_read.rb +1 -1
  11. data/lib/cucumber/events/hook_test_step_created.rb +1 -3
  12. data/lib/cucumber/events/step_activated.rb +1 -1
  13. data/lib/cucumber/events/step_definition_registered.rb +1 -3
  14. data/lib/cucumber/events/test_case_created.rb +1 -1
  15. data/lib/cucumber/events/test_case_finished.rb +1 -1
  16. data/lib/cucumber/events/test_case_ready.rb +1 -1
  17. data/lib/cucumber/events/test_case_started.rb +1 -3
  18. data/lib/cucumber/events/test_run_finished.rb +1 -1
  19. data/lib/cucumber/events/test_run_hook_finished.rb +1 -1
  20. data/lib/cucumber/events/test_run_hook_started.rb +1 -3
  21. data/lib/cucumber/events/test_run_started.rb +1 -3
  22. data/lib/cucumber/events/test_step_created.rb +1 -3
  23. data/lib/cucumber/events/test_step_finished.rb +1 -3
  24. data/lib/cucumber/events/test_step_started.rb +1 -3
  25. data/lib/cucumber/events/undefined_parameter_type.rb +1 -1
  26. data/lib/cucumber/events.rb +6 -2
  27. data/lib/cucumber/filters/retry.rb +7 -22
  28. data/lib/cucumber/formatter/console_counts.rb +5 -3
  29. data/lib/cucumber/formatter/console_issues.rb +3 -3
  30. data/lib/cucumber/formatter/fail_fast.rb +2 -2
  31. data/lib/cucumber/formatter/html.rb +6 -4
  32. data/lib/cucumber/formatter/junit.rb +3 -3
  33. data/lib/cucumber/formatter/message_builder.rb +25 -139
  34. data/lib/cucumber/formatter/pretty.rb +1 -1
  35. data/lib/cucumber/formatter/rerun.rb +13 -41
  36. data/lib/cucumber/glue/hook.rb +0 -1
  37. data/lib/cucumber/glue/multiple_world.rb +26 -0
  38. data/lib/cucumber/glue/nil_world.rb +12 -0
  39. data/lib/cucumber/glue/registry_and_more.rb +15 -32
  40. data/lib/cucumber/multiline_argument/data_table.rb +5 -7
  41. data/lib/cucumber/retry_policy.rb +27 -0
  42. data/lib/cucumber/rspec/doubles.rb +1 -7
  43. data/lib/cucumber/runtime/meta_message_builder.rb +1 -1
  44. data/lib/cucumber/runtime/user_interface.rb +13 -0
  45. data/lib/cucumber/runtime.rb +26 -47
  46. metadata +51 -25
  47. data/lib/cucumber/events/base.rb +0 -25
  48. data/lib/cucumber/query.rb +0 -273
  49. data/lib/cucumber/repository.rb +0 -136
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 859f6f5538d072ccaff43df1dc5e3b2f0a35ea3f755a35aedd2af1e9586e8b8e
4
- data.tar.gz: 023a90d837722c080abc31d0e31621498225986eabe82e11231779819c47e7f2
3
+ metadata.gz: 1afa805afc19084236a0c669140643f73d58830be94b68ce95101093ee1ac094
4
+ data.tar.gz: e0000b36b86fc3a28dd727b11fb3b449996d0219d4bcc17bacfad8a4d5fcdc56
5
5
  SHA512:
6
- metadata.gz: ff9685e425c6adf6150d85218d2e1cf13e418800917cdcdf4a68f2a51b1a267a8d47735b38b5aced3b6e22a91346d081fa2412e9fd3de2f8b1c40b5411c802a4
7
- data.tar.gz: 5af3d569e9e0ce0ced379d414c961f1fa94bd96f54e0c41dcac9b09a507c504c6e4701d2a162e326bfcfd30a4f40ae6bcdeeed8ecc45e18f1925408a78dd9f46
6
+ metadata.gz: 40f7f93918b8de9376adca4c9a0d8b78f365f629d7244116a5247b795b64b3b9c592515f4dc93eab7f6a700610facc0b745ad06360833a36b4bb99fcc7080727
7
+ data.tar.gz: bdfe41db58fc69daea12ccc35f5b52e8623ca590db609e85228eb6c34f772516de59a51e11cd5ac8d6426de3dbabd3df05966a3df58cd9f46fbc4342b59a26e5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 11.1.1
1
+ 12.0.0
@@ -27,8 +27,6 @@ module Cucumber
27
27
  @args = args
28
28
  @options.parse!(args)
29
29
  arrange_formats
30
- raise("You can't use both --strict and --wip") if strict.strict? && wip?
31
-
32
30
  set_environment_variables
33
31
  end
34
32
 
@@ -44,10 +42,6 @@ module Cucumber
44
42
  Integer(@options[:seed] || rand(0xFFFF))
45
43
  end
46
44
 
47
- def strict
48
- @options[:strict]
49
- end
50
-
51
45
  def wip?
52
46
  @options[:wip]
53
47
  end
@@ -132,10 +132,6 @@ module Cucumber
132
132
  opts.on('-q', '--quiet', 'Alias for --no-snippets --no-source --no-duration --publish-quiet.') { shut_up }
133
133
  opts.on('--no-duration', "Don't print the duration at the end of the summary") { set_option :duration, false }
134
134
  opts.on('-b', '--backtrace', 'Show full backtrace for all errors.') { Cucumber.use_full_backtrace = true }
135
- opts.on('-S', '--[no-]strict', *strict_msg) { |setting| set_strict(setting) }
136
- opts.on('--[no-]strict-undefined', 'Fail if there are any undefined results.') { |setting| set_strict(setting, :undefined) }
137
- opts.on('--[no-]strict-pending', 'Fail if there are any pending results.') { |setting| set_strict(setting, :pending) }
138
- opts.on('--[no-]strict-flaky', 'Fail if there are any flaky results.') { |setting| set_strict(setting, :flaky) }
139
135
  opts.on('-w', '--wip', 'Fail if there are any passing scenarios.') { set_option :wip }
140
136
  opts.on('-v', '--verbose', 'Show the files and features loaded.') { set_option :verbose }
141
137
  opts.on('-g', '--guess', 'Guess best match for Ambiguous steps.') { set_option :guess }
@@ -289,13 +285,6 @@ module Cucumber
289
285
  ]
290
286
  end
291
287
 
292
- def strict_msg
293
- [
294
- 'Fail if there are any strict affected results ',
295
- '(that is undefined, pending or flaky results).'
296
- ]
297
- end
298
-
299
288
  def parse_formats(value)
300
289
  formatter, *formatter_options = value.split(',')
301
290
  options_hash = Hash[formatter_options.map { |string| string.split('=') }]
@@ -467,10 +456,6 @@ module Cucumber
467
456
  @options[:duration] = false
468
457
  end
469
458
 
470
- def set_strict(setting, type = nil)
471
- @options[:strict].set_strict(setting, type)
472
- end
473
-
474
459
  def stdout_formats
475
460
  @options[:formats].select { |_, _, output| output == @out_stream }
476
461
  end
@@ -528,7 +513,6 @@ module Cucumber
528
513
  @options[:source] &= other_options[:source]
529
514
  @options[:snippets] &= other_options[:snippets]
530
515
  @options[:duration] &= other_options[:duration]
531
- @options[:strict] = other_options[:strict].merge!(@options[:strict])
532
516
  @options[:dry_run] |= other_options[:dry_run]
533
517
 
534
518
  @profiles += other_options.profiles
@@ -6,6 +6,7 @@ require 'cucumber/events'
6
6
  require 'cucumber/messages'
7
7
  require 'cucumber/core/event_bus'
8
8
  require 'cucumber/core/test/result'
9
+ require 'cucumber/retry_policy'
9
10
  require 'forwardable'
10
11
  require 'cucumber'
11
12
 
@@ -23,7 +24,6 @@ module Cucumber
23
24
  {
24
25
  autoload_code_paths: %w[features/support features/step_definitions],
25
26
  filters: [],
26
- strict: Cucumber::Core::Test::Result::StrictConfiguration.new,
27
27
  require: [],
28
28
  dry_run: false,
29
29
  fail_fast: false,
@@ -114,10 +114,6 @@ module Cucumber
114
114
  @options[:guess]
115
115
  end
116
116
 
117
- def strict
118
- @options[:strict]
119
- end
120
-
121
117
  def wip?
122
118
  @options[:wip]
123
119
  end
@@ -285,6 +281,10 @@ module Cucumber
285
281
  @id_generator ||= Cucumber::Messages::Helpers::IdGenerator::UUID.new
286
282
  end
287
283
 
284
+ def retry_policy
285
+ @retry_policy ||= RetryPolicy.new(retry_attempts, retry_total_tests)
286
+ end
287
+
288
288
  def test_run_started_id
289
289
  @test_run_started_id ||= id_generator.new_id
290
290
  end
@@ -3,6 +3,49 @@
3
3
  require 'cucumber/core/test/result'
4
4
 
5
5
  module Cucumber
6
+ # Raised when a step matches 2 or more StepDefinitions
7
+ class Ambiguous < StandardError
8
+ def initialize(step_name, step_definitions, used_guess)
9
+ # TODO: [LH] - Just use a heredoc here to fix this up
10
+ message = String.new
11
+ message << "Ambiguous match of \"#{step_name}\":\n\n"
12
+ message << step_definitions.map(&:backtrace_line).join("\n")
13
+ message << "\n\n"
14
+ message << "You can run again with --guess to make Cucumber be more smart about it\n" unless used_guess
15
+ super(message)
16
+ end
17
+ end
18
+
19
+ class FeatureFolderNotFoundException < RuntimeError
20
+ def initialize(path)
21
+ @path = path
22
+ super
23
+ end
24
+
25
+ def message
26
+ "No such file or directory - #{@path}"
27
+ end
28
+ end
29
+
30
+ class FileNotFoundException < RuntimeError
31
+ attr_reader :path
32
+
33
+ def initialize(original_exception, path)
34
+ @path = path
35
+ super(original_exception)
36
+ end
37
+ end
38
+
39
+ # Raised when a StepDefinition's block invokes World#pending
40
+ class Pending < Core::Test::Result::Pending
41
+ end
42
+
43
+ class TagExcess < StandardError
44
+ def initialize(messages)
45
+ super(messages.join("\n"))
46
+ end
47
+ end
48
+
6
49
  # Raised when there is no matching StepDefinition for a step.
7
50
  class Undefined < Core::Test::Result::Undefined
8
51
  def self.from(result, step_name)
@@ -27,27 +70,4 @@ module Cucumber
27
70
  super %(Undefined dynamic step: "#{step_name}")
28
71
  end
29
72
  end
30
-
31
- # Raised when a StepDefinition's block invokes World#pending
32
- class Pending < Core::Test::Result::Pending
33
- end
34
-
35
- # Raised when a step matches 2 or more StepDefinitions
36
- class Ambiguous < StandardError
37
- def initialize(step_name, step_definitions, used_guess)
38
- # TODO: [LH] - Just use a heredoc here to fix this up
39
- message = String.new
40
- message << "Ambiguous match of \"#{step_name}\":\n\n"
41
- message << step_definitions.map(&:backtrace_line).join("\n")
42
- message << "\n\n"
43
- message << "You can run again with --guess to make Cucumber be more smart about it\n" unless used_guess
44
- super(message)
45
- end
46
- end
47
-
48
- class TagExcess < StandardError
49
- def initialize(messages)
50
- super(messages.join("\n"))
51
- end
52
- end
53
73
  end
@@ -1,11 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'cucumber/core/events'
4
-
5
3
  module Cucumber
6
4
  module Events
7
5
  # Fired when attach is called in a step definition
8
- class AttachCalled < Core::Event.new(:src, :media_type, :filename)
6
+ class AttachCalled < Core::Event::Base
9
7
  # The attachment body
10
8
  attr_reader :src
11
9
 
@@ -14,6 +12,17 @@ module Cucumber
14
12
 
15
13
  # An optional filename
16
14
  attr_reader :filename
15
+
16
+ def self.event_id
17
+ :attach_called
18
+ end
19
+
20
+ def initialize(src, media_type, filename)
21
+ @src = src
22
+ @media_type = media_type
23
+ @filename = filename
24
+ super()
25
+ end
17
26
  end
18
27
  end
19
28
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base'
3
+ require 'cucumber/core/event/base'
4
4
 
5
5
  module Cucumber
6
6
  module Events
7
- class Envelope < Base
7
+ class Envelope < Core::Event::Base
8
8
  attr_reader :envelope
9
9
 
10
10
  def self.event_id
@@ -1,11 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base'
4
-
5
3
  module Cucumber
6
4
  module Events
7
5
  # Fired after we've parsed the contents of a feature file
8
- class GherkinSourceParsed < Base
6
+ class GherkinSourceParsed < Core::Event::Base
9
7
  # # The Gherkin Ast
10
8
  attr_reader :gherkin_document
11
9
 
@@ -3,7 +3,7 @@
3
3
  module Cucumber
4
4
  module Events
5
5
  # Fired after we've read in the contents of a feature file
6
- class GherkinSourceRead < Base
6
+ class GherkinSourceRead < Core::Event::Base
7
7
  # The path to the file
8
8
  attr_reader :path
9
9
 
@@ -1,11 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base'
4
-
5
3
  module Cucumber
6
4
  module Events
7
5
  # Event fired when a step is created from a hook
8
- class HookTestStepCreated < Base
6
+ class HookTestStepCreated < Core::Event::Base
9
7
  attr_reader :test_step, :hook
10
8
 
11
9
  def self.event_id
@@ -3,7 +3,7 @@
3
3
  module Cucumber
4
4
  module Events
5
5
  # Event fired when a step is activated
6
- class StepActivated < Base
6
+ class StepActivated < Core::Event::Base
7
7
  # The test step that was matched.
8
8
  # @return [Cucumber::Core::Test::Step]
9
9
  attr_reader :test_step
@@ -1,11 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base'
4
-
5
3
  module Cucumber
6
4
  module Events
7
5
  # Event fired after each step definition has been registered
8
- class StepDefinitionRegistered < Base
6
+ class StepDefinitionRegistered < Core::Event::Base
9
7
  # The step definition that was just registered.
10
8
  # @return [RbSupport::RbStepDefinition]
11
9
  attr_reader :step_definition
@@ -3,7 +3,7 @@
3
3
  module Cucumber
4
4
  module Events
5
5
  # Event fired when a Test::Case is created from a Pickle
6
- class TestCaseCreated < Base
6
+ class TestCaseCreated < Core::Event::Base
7
7
  attr_reader :test_case, :pickle
8
8
 
9
9
  def self.event_id
@@ -3,7 +3,7 @@
3
3
  module Cucumber
4
4
  module Events
5
5
  # Event fired when a Test::Case is created from a Pickle
6
- class TestCaseFinished < Base
6
+ class TestCaseFinished < Core::Event::Base
7
7
  # @return [Cucumber::Core::Test::Case] that was executed
8
8
  attr_reader :test_case
9
9
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Cucumber
4
4
  module Events
5
- class TestCaseReady < Base
5
+ class TestCaseReady < Core::Event::Base
6
6
  attr_reader :test_case
7
7
 
8
8
  def self.event_id
@@ -1,11 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base'
4
-
5
3
  module Cucumber
6
4
  module Events
7
5
  # Signals that a {Cucumber::Core::Test::Case} is about to be executed
8
- class TestCaseStarted < Base
6
+ class TestCaseStarted < Core::Event::Base
9
7
  # @return [Cucumber::Core::Test::Case] the test case to be executed
10
8
  attr_reader :test_case
11
9
 
@@ -3,7 +3,7 @@
3
3
  module Cucumber
4
4
  module Events
5
5
  # Event fired after all test cases have finished executing
6
- class TestRunFinished < Base
6
+ class TestRunFinished < Core::Event::Base
7
7
  attr_reader :success
8
8
 
9
9
  def self.event_id
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Cucumber
4
4
  module Events
5
- class TestRunHookFinished < Base
5
+ class TestRunHookFinished < Core::Event::Base
6
6
  attr_reader :hook, :test_result
7
7
 
8
8
  def self.event_id
@@ -1,10 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'cucumber/core/events'
4
-
5
3
  module Cucumber
6
4
  module Events
7
- class TestRunHookStarted < Base
5
+ class TestRunHookStarted < Core::Event::Base
8
6
  attr_reader :hook
9
7
 
10
8
  def self.event_id
@@ -1,12 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base'
4
-
5
3
  module Cucumber
6
4
  module Events
7
5
  # Event fired once all test cases have been filtered before
8
6
  # the first one is executed.
9
- class TestRunStarted < Base
7
+ class TestRunStarted < Core::Event::Base
10
8
  # @return [Array<Cucumber::Core::Test::Case>] the test cases to be executed
11
9
  attr_reader :test_cases
12
10
 
@@ -1,11 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base'
4
-
5
3
  module Cucumber
6
4
  module Events
7
5
  # Event fired when a TestStep is created from a PickleStep
8
- class TestStepCreated < Base
6
+ class TestStepCreated < Core::Event::Base
9
7
  attr_reader :test_step, :pickle_step
10
8
 
11
9
  def self.event_id
@@ -1,11 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base'
4
-
5
3
  module Cucumber
6
4
  module Events
7
5
  # Signals that a {Cucumber::Core::Test::Step} has finished executing
8
- class TestStepFinished < Base
6
+ class TestStepFinished < Core::Event::Base
9
7
  # @return [Cucumber::Core::Test::Step] the test step that was executed
10
8
  attr_reader :test_step
11
9
 
@@ -1,11 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'base'
4
-
5
3
  module Cucumber
6
4
  module Events
7
5
  # Signals that a {Cucumber::Core::Test::Step} is about to be executed
8
- class TestStepStarted < Base
6
+ class TestStepStarted < Core::Event::Base
9
7
  # @return [Cucumber::Core::Test::Step] the test step to be executed
10
8
  attr_reader :test_step
11
9
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Cucumber
4
4
  module Events
5
- class UndefinedParameterType < Base
5
+ class UndefinedParameterType < Core::Event::Base
6
6
  attr_reader :type_name, :expression
7
7
 
8
8
  def self.event_id
@@ -1,6 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- Dir["#{File.dirname(__FILE__)}/events/*.rb"].map(&method(:require))
3
+ require 'cucumber/core/event/base'
4
+
5
+ Dir[File.join(__dir__, 'events', '*.rb')].each do |file|
6
+ require_relative File.join('events', File.basename(file))
7
+ end
4
8
 
5
9
  module Cucumber
6
10
  # Events tell you what's happening while Cucumber runs your features.
@@ -23,7 +27,7 @@ module Cucumber
23
27
  end
24
28
 
25
29
  def self.registry
26
- Core::Events.build_registry(
30
+ Core::EventBus.build_registry(
27
31
  AttachCalled,
28
32
  GherkinSourceParsed,
29
33
  GherkinSourceRead,
@@ -7,16 +7,11 @@ require 'cucumber/events'
7
7
  module Cucumber
8
8
  module Filters
9
9
  class Retry < Core::Filter.new(:configuration)
10
- def initialize(*_args)
11
- super
12
- @total_permanently_failed = 0
13
- end
14
-
15
10
  def test_case(test_case)
16
11
  configuration.on_event(:test_case_finished) do |event|
17
- next unless retry_required?(test_case, event)
12
+ next unless event.test_case == test_case
13
+ next unless retry?(test_case, event.result)
18
14
 
19
- test_case_counts[test_case] += 1
20
15
  test_case.describe_to(receiver)
21
16
  end
22
17
 
@@ -25,27 +20,17 @@ module Cucumber
25
20
 
26
21
  private
27
22
 
28
- def retry_required?(test_case, event)
29
- return false unless event.test_case == test_case
30
-
31
- return false unless event.result.failed?
32
-
33
- return false if @total_permanently_failed >= configuration.retry_total_tests
34
-
35
- retry_required = test_case_counts[test_case] < configuration.retry_attempts
36
- if retry_required
37
- # retry test
23
+ def retry?(test_case, result)
24
+ if retry_policy.will_be_retried?(test_case, result)
25
+ retry_policy.record_retry(test_case)
38
26
  true
39
27
  else
40
- # test failed after max. attempts
41
- @total_permanently_failed += 1
28
+ retry_policy.record_permanent_failure if result.failed?
42
29
  false
43
30
  end
44
31
  end
45
32
 
46
- def test_case_counts
47
- @test_case_counts ||= Hash.new { |h, k| h[k] = 0 }
48
- end
33
+ def retry_policy = configuration.retry_policy
49
34
  end
50
35
  end
51
36
  end
@@ -31,9 +31,11 @@ module Cucumber
31
31
  end
32
32
 
33
33
  def status_counts(summary)
34
- counts = Core::Test::Result::TYPES.map { |status| [status, summary.total(status)] }
35
- counts = counts.select { |_status, count| count.positive? }
36
- counts = counts.map { |status, count| format_string("#{count} #{status}", status) }
34
+ counts =
35
+ Cucumber::Core::Test::Result::BooleanMethods::TYPES
36
+ .map { |status| [status, summary.total(status)] }
37
+ .select { |_status, count| count.positive? }
38
+ .map { |status, count| format_string("#{count} #{status}", status) }
37
39
  "(#{counts.join(', ')})" if counts.any?
38
40
  end
39
41
  end
@@ -15,9 +15,9 @@ module Cucumber
15
15
  @config.on_event(:test_case_finished) do |event|
16
16
  if event.test_case != @previous_test_case
17
17
  @previous_test_case = event.test_case
18
- @issues[event.result.to_sym] << event.test_case unless event.result.ok?(strict: @config.strict)
18
+ @issues[event.result.to_sym] << event.test_case unless event.result.ok?
19
19
  elsif event.result.passed?
20
- @issues[:flaky] << event.test_case unless Core::Test::Result::Flaky.ok?(strict: @config.strict.strict?(:flaky))
20
+ @issues[:flaky] << event.test_case unless Core::Test::Result::Flaky.ok?
21
21
  @issues[:failed].delete(event.test_case)
22
22
  end
23
23
  end
@@ -25,7 +25,7 @@ module Cucumber
25
25
  end
26
26
 
27
27
  def to_s
28
- test_case_result = @issues.empty? ? [] : Core::Test::Result::TYPES.map { |type| scenario_listing(type, @issues[type]) }
28
+ test_case_result = @issues.empty? ? [] : Cucumber::Core::Test::Result::BooleanMethods::TYPES.map { |type| scenario_listing(type, @issues[type]) }
29
29
  global_hooks_result = @global_hooks_summary.ok? ? [] : @global_hooks_summary.exception_listing
30
30
  [test_case_result + global_hooks_result].flatten.join("\n")
31
31
  end
@@ -8,10 +8,10 @@ module Cucumber
8
8
  class FailFast
9
9
  def initialize(configuration)
10
10
  @previous_test_case = nil
11
- configuration.on_event :test_case_finished do |event|
11
+ configuration.on_event(:test_case_finished) do |event|
12
12
  if event.test_case != @previous_test_case
13
13
  @previous_test_case = event.test_case
14
- Cucumber.wants_to_quit = true unless event.result.ok?(strict: configuration.strict)
14
+ Cucumber.wants_to_quit = true unless event.result.ok?
15
15
  elsif event.result.passed?
16
16
  Cucumber.wants_to_quit = false
17
17
  end
@@ -2,20 +2,22 @@
2
2
 
3
3
  require 'cucumber/html_formatter'
4
4
 
5
- require_relative 'message_builder'
5
+ require_relative 'io'
6
6
 
7
7
  module Cucumber
8
8
  module Formatter
9
- class HTML < MessageBuilder
9
+ class HTML
10
+ include Io
11
+
10
12
  def initialize(config)
13
+ @config = config
11
14
  @io = ensure_io(config.out_stream, config.error_stream)
12
15
  @html_formatter = Cucumber::HTMLFormatter::Formatter.new(@io)
13
16
  @html_formatter.write_pre_message
14
- super(config)
17
+ config.on_event :envelope, &method(:on_envelope)
15
18
  end
16
19
 
17
20
  def on_envelope(event)
18
- super(event)
19
21
  envelope = event.envelope
20
22
  @html_formatter.write_message(envelope)
21
23
  # TODO: Move this conditional logic into the HTML formatter proper
@@ -53,7 +53,7 @@ module Cucumber
53
53
  def on_test_step_finished(event)
54
54
  return if @failing_test_step
55
55
 
56
- @failing_test_step = event.test_step unless event.result.ok?(strict: @config.strict)
56
+ @failing_test_step = event.test_step unless event.result.ok?
57
57
  end
58
58
 
59
59
  def on_test_case_finished(event)
@@ -109,7 +109,7 @@ module Cucumber
109
109
  scenario_source = @ast_lookup.scenario_source(test_case)
110
110
  keyword = scenario_source.type == :Scenario ? scenario_source.scenario.keyword : scenario_source.scenario_outline.keyword
111
111
  output = "#{keyword}: #{scenario}\n\n"
112
- return output if result.ok?(strict: @config.strict)
112
+ return output if result.ok?
113
113
 
114
114
  if scenario_source.type == :Scenario
115
115
  if @failing_test_step
@@ -138,7 +138,7 @@ module Cucumber
138
138
  testcase_attributes = get_testcase_attributes(classname, name, duration, filename)
139
139
 
140
140
  @current_feature_data[:builder].testcase(testcase_attributes) do
141
- if !result.passed? && result.ok?(strict: @config.strict)
141
+ if !result.passed? && result.ok?
142
142
  @current_feature_data[:builder].skipped
143
143
  @current_feature_data[:skipped] += 1
144
144
  elsif !result.passed?