Skip to content

Commit

Permalink
Add support for RSpec <= 3.9 in exit_status method
Browse files Browse the repository at this point in the history
  • Loading branch information
natevick committed Feb 16, 2024
1 parent 58123f2 commit 53809af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/selective/ruby/rspec/runner_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ def base_test_path
end

def exit_status
rspec_runner.exit_code(::RSpec.world.reporter.failed_examples.none?)
if Gem::Version.new(::RSpec::Core::Version::STRING) >= Gem::Version.new("3.9")
rspec_runner.exit_code(::RSpec.world.reporter.failed_examples.none?)
else
return ::RSpec.world.reporter.exit_early(rspec_runner.configuration.failure_exit_code) if ::RSpec.world.wants_to_quit

::RSpec.world.reporter.failed_examples.any? ? 1 : 0
end
end

def finish
Expand Down

0 comments on commit 53809af

Please sign in to comment.