Sha256: 805f060779fdd5edd6e98e6443fcc44ef993b35a5f39979bb9b1ad33f2a2c465
Contents?: true
Size: 586 Bytes
Versions: 72
Compression:
Stored size: 586 Bytes
Contents
RSpec::Matchers.define :exit_with do |expected| supports_block_expectations match do |block| actual = nil begin block.call rescue SystemExit => e actual = e.status end actual and actual == expected end failure_message do |actual| "expected exit with code #{expected} but " + (actual.nil? ? " exit was not called" : "we exited with #{actual} instead") end failure_message_when_negated do |actual| "expected that exit would not be called with #{expected}" end description do "expect exit with #{expected}" end end
Version data entries
72 entries across 72 versions & 2 rubygems