diff --git a/cucumber.gemspec b/cucumber.gemspec index 9d680a3a4..cd97804cd 100644 --- a/cucumber.gemspec +++ b/cucumber.gemspec @@ -22,17 +22,17 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 2.7' s.required_rubygems_version = '>= 3.0.1' - s.add_dependency 'builder', '~> 3.2', '>= 3.2.4' - s.add_dependency 'cucumber-ci-environment', '~> 9.2', '>= 9.2.0' - s.add_dependency 'cucumber-core', '~> 12.0' + s.add_dependency 'builder', '~> 3.2' + s.add_dependency 'cucumber-ci-environment', '> 9', '< 11' + s.add_dependency 'cucumber-core', '> 13', '< 14' s.add_dependency 'cucumber-cucumber-expressions', '~> 17.0' - s.add_dependency 'cucumber-gherkin', '> 24', '< 27' + s.add_dependency 'cucumber-gherkin', '> 24', '< 28' s.add_dependency 'cucumber-html-formatter', '> 20.3', '< 22' s.add_dependency 'cucumber-messages', '> 19', '< 25' s.add_dependency 'diff-lcs', '~> 1.5' - s.add_dependency 'mini_mime', '~> 1.1', '>= 1.1.5' - s.add_dependency 'multi_test', '~> 1.1', '>= 1.1.0' - s.add_dependency 'sys-uname', '~> 1.2', '>= 1.2.3' + s.add_dependency 'mini_mime', '~> 1.1' + s.add_dependency 'multi_test', '~> 1.1' + s.add_dependency 'sys-uname', '~> 1.2' s.add_development_dependency 'cucumber-compatibility-kit', '~> 15.0' # Only needed whilst we are testing the formatters. Can be removed once we remove tests for those diff --git a/lib/cucumber/formatter/console_issues.rb b/lib/cucumber/formatter/console_issues.rb index e3bc914a9..e93fee892 100644 --- a/lib/cucumber/formatter/console_issues.rb +++ b/lib/cucumber/formatter/console_issues.rb @@ -14,9 +14,9 @@ def initialize(config, ast_lookup = AstLookup.new(config)) @config.on_event(:test_case_finished) do |event| if event.test_case != @previous_test_case @previous_test_case = event.test_case - @issues[event.result.to_sym] << event.test_case unless event.result.ok?(@config.strict) + @issues[event.result.to_sym] << event.test_case unless event.result.ok?(strict: @config.strict) elsif event.result.passed? - @issues[:flaky] << event.test_case unless Core::Test::Result::Flaky.ok?(@config.strict.strict?(:flaky)) + @issues[:flaky] << event.test_case unless Core::Test::Result::Flaky.ok?(strict: @config.strict.strict?(:flaky)) @issues[:failed].delete(event.test_case) end end diff --git a/lib/cucumber/formatter/fail_fast.rb b/lib/cucumber/formatter/fail_fast.rb index e0a875115..3ebac8acf 100644 --- a/lib/cucumber/formatter/fail_fast.rb +++ b/lib/cucumber/formatter/fail_fast.rb @@ -12,7 +12,7 @@ def initialize(configuration) test_case, result = *event.attributes if test_case != @previous_test_case @previous_test_case = event.test_case - Cucumber.wants_to_quit = true unless result.ok?(configuration.strict) + Cucumber.wants_to_quit = true unless result.ok?(strict: configuration.strict) elsif result.passed? Cucumber.wants_to_quit = false end diff --git a/lib/cucumber/formatter/junit.rb b/lib/cucumber/formatter/junit.rb index 8e41d0d0f..e457383df 100644 --- a/lib/cucumber/formatter/junit.rb +++ b/lib/cucumber/formatter/junit.rb @@ -54,7 +54,7 @@ def on_test_step_finished(event) test_step, result = *event.attributes return if @failing_test_step - @failing_test_step = test_step unless result.ok?(@config.strict) + @failing_test_step = test_step unless result.ok?(strict: @config.strict) end def on_test_case_finished(event) @@ -111,7 +111,7 @@ def create_output_string(test_case, scenario, result, row_name) scenario_source = @ast_lookup.scenario_source(test_case) keyword = scenario_source.type == :Scenario ? scenario_source.scenario.keyword : scenario_source.scenario_outline.keyword output = "#{keyword}: #{scenario}\n\n" - return output if result.ok?(@config.strict) + return output if result.ok?(strict: @config.strict) if scenario_source.type == :Scenario if @failing_test_step @@ -140,7 +140,7 @@ def build_testcase(result, scenario_designation, output) testcase_attributes = get_testcase_attributes(classname, name, duration, filename) @current_feature_data[:builder].testcase(testcase_attributes) do - if !result.passed? && result.ok?(@config.strict) + if !result.passed? && result.ok?(strict: @config.strict) @current_feature_data[:builder].skipped @current_feature_data[:skipped] += 1 elsif !result.passed? diff --git a/lib/cucumber/formatter/pretty.rb b/lib/cucumber/formatter/pretty.rb index 69e60a10d..97ba8d796 100644 --- a/lib/cucumber/formatter/pretty.rb +++ b/lib/cucumber/formatter/pretty.rb @@ -153,7 +153,7 @@ def attach(src, media_type, filename) private def find_exception_to_be_printed(result) - return nil if result.ok?(options[:strict]) + return nil if result.ok?(strict: options[:strict]) result = result.with_filtered_backtrace(Cucumber::Formatter::BacktraceFilter) exception = result.failed? ? result.exception : result diff --git a/lib/cucumber/formatter/rerun.rb b/lib/cucumber/formatter/rerun.rb index 7a22e6ff5..5ee5080c4 100644 --- a/lib/cucumber/formatter/rerun.rb +++ b/lib/cucumber/formatter/rerun.rb @@ -14,7 +14,7 @@ def initialize(config) config.on_event :test_case_finished do |event| test_case, result = *event.attributes if @config.strict.strict?(:flaky) - next if result.ok?(@config.strict) + next if result.ok?(strict: @config.strict) add_to_failures(test_case) else @@ -22,11 +22,11 @@ def initialize(config) if @latest_failed_test_case != test_case add_to_failures(@latest_failed_test_case) @latest_failed_test_case = nil - elsif result.ok?(@config.strict) + elsif result.ok?(strict: @config.strict) @latest_failed_test_case = nil end end - @latest_failed_test_case = test_case unless result.ok?(@config.strict) + @latest_failed_test_case = test_case unless result.ok?(strict: @config.strict) end end config.on_event :test_run_finished do diff --git a/lib/cucumber/runtime.rb b/lib/cucumber/runtime.rb index 49884f65e..80bd2e956 100644 --- a/lib/cucumber/runtime.rb +++ b/lib/cucumber/runtime.rb @@ -114,7 +114,7 @@ def failure? if @configuration.wip? summary_report.test_cases.total_passed.positive? else - !summary_report.ok?(@configuration.strict) + !summary_report.ok?(strict: @configuration.strict) end end diff --git a/spec/cucumber/filters/retry_spec.rb b/spec/cucumber/filters/retry_spec.rb index cfa05c979..bc71d1809 100644 --- a/spec/cucumber/filters/retry_spec.rb +++ b/spec/cucumber/filters/retry_spec.rb @@ -15,7 +15,7 @@ let(:configuration) { Cucumber::Configuration.new(retry: 2, retry_total: retry_total) } let(:retry_total) { Float::INFINITY } - let(:test_case) { Cucumber::Core::Test::Case.new(double, double, [double('test steps')], double, [], double) } + let(:test_case) { Cucumber::Core::Test::Case.new(double, double, [double('test steps')], double, double, [], double) } let(:receiver) { double('receiver').as_null_object } let(:filter) { described_class.new(configuration, receiver) } let(:fail) { Cucumber::Events::AfterTestCase.new(test_case, double('result', failed?: true, ok?: false)) } @@ -106,10 +106,10 @@ context 'with too many failing tests' do let(:retry_total) { 1 } let(:always_failing_test_case1) do - Cucumber::Core::Test::Case.new(double, double, [double('test steps')], 'test.rb:1', [], double) + Cucumber::Core::Test::Case.new(double, double, [double('test steps')], 'test.rb:1', nil, [], double) end let(:always_failing_test_case2) do - Cucumber::Core::Test::Case.new(double, double, [double('test steps')], 'test.rb:9', [], double) + Cucumber::Core::Test::Case.new(double, double, [double('test steps')], 'test.rb:9', nil, [], double) end it 'stops retrying tests' do diff --git a/spec/cucumber/formatter/pretty_spec.rb b/spec/cucumber/formatter/pretty_spec.rb index 1b21adc7b..dd840e8c7 100644 --- a/spec/cucumber/formatter/pretty_spec.rb +++ b/spec/cucumber/formatter/pretty_spec.rb @@ -342,7 +342,7 @@ module Formatter Given('this step passes') {} end - it 'displays hook output appropriately ' do + it 'displays hook output appropriately' do expect(@out.string).to include <<~OUTPUT Feature: diff --git a/spec/cucumber/glue/proto_world_spec.rb b/spec/cucumber/glue/proto_world_spec.rb index 9db64c5ea..c9f37b073 100644 --- a/spec/cucumber/glue/proto_world_spec.rb +++ b/spec/cucumber/glue/proto_world_spec.rb @@ -132,7 +132,7 @@ module Glue extend Cucumber::Formatter::SpecHelperDsl include Cucumber::Formatter::SpecHelper - before(:each) do + before do Cucumber::Term::ANSIColor.coloring = false @out = StringIO.new @formatter = Cucumber::Formatter::Pretty.new(actual_runtime.configuration.with_options(out_stream: @out, source: false)) @@ -140,7 +140,7 @@ module Glue end describe 'when attaching data with null byte' do - define_feature <<-FEATURE + define_feature <<~FEATURE Feature: Banana party Scenario: Monkey eats banana @@ -154,11 +154,11 @@ module Glue end it 'does not report an error' do - expect(@out.string).not_to include 'Error' + expect(@out.string).not_to include('Error') end it 'properly attaches the data' do - expect(@out.string).to include "'\x00'attachement" + expect(@out.string).to include("'\x00'attachement") end end end