diff --git a/features/configuration/run_all_when_everything_filtered.feature b/features/configuration/run_all_when_everything_filtered.feature index 64f6219ae..6de90e62b 100644 --- a/features/configuration/run_all_when_everything_filtered.feature +++ b/features/configuration/run_all_when_everything_filtered.feature @@ -62,7 +62,7 @@ Feature: Using `run_all_when_everything_filtered` """ When I run `rspec spec/example_spec.rb --tag some_tag` Then the output should contain "1 example, 0 failures" - And the output should contain "Run options: include {:some_tag=>true}" + And the output should contain in either hash syntax "Run options: include {:some_tag=>true}" Scenario: When the `run_all_when_everything_filtered` option is turned on, all the specs are run when the tag has no matches Given a file named "spec/example_spec.rb" with: @@ -78,5 +78,5 @@ Feature: Using `run_all_when_everything_filtered` """ When I run `rspec spec/example_spec.rb --tag some_tag` Then the output should contain "2 examples, 0 failures" - And the output should contain "All examples were filtered out; ignoring {:some_tag=>true}" + And the output should contain in either hash syntax "All examples were filtered out; ignoring {:some_tag=>true}" diff --git a/features/step_definitions/additional_cli_steps.rb b/features/step_definitions/additional_cli_steps.rb index 89eb10b59..866340b51 100644 --- a/features/step_definitions/additional_cli_steps.rb +++ b/features/step_definitions/additional_cli_steps.rb @@ -11,6 +11,14 @@ end end +Then /^the output should contain in either hash syntax "(.*)"$/ do |string| + if RUBY_VERSION.to_f > 3.3 + step "the output should contain \"#{string.gsub(/:(\w+)=>/, '\1: ')}\"" + else + step "the output should contain \"#{string}\"" + end +end + Then /^the output should contain all of these:$/ do |table| table.raw.flatten.each do |string| expect(all_output).to include(string)