pikesley/curacao

View on GitHub
lib/curacao/matcher/exit_with_status.rb

Summary

Maintainability
A
0 mins
Test Coverage
RSpec::Matchers.define :exit_with_status do |expected|
  match do |actual|
    expect { actual.call }.to raise_error(SystemExit)

    begin
      actual.call
    rescue SystemExit => e
      expect(e.status).to eq expected
    end
  end

  supports_block_expectations
end