Sha256: 57cc012124cd9e0fe0064596ddf2aa78f9000fdb4f82879efdb1925c7c16204a
Contents?: true
Size: 588 Bytes
Versions: 9
Compression:
Stored size: 588 Bytes
Contents
# frozen_string_literal: true RSpec::Matchers.define :match_stdout do |check| @capture = nil match do |block| begin stdout_saved = $stdout $stdout = StringIO.new block.call ensure @capture = $stdout $stdout = stdout_saved end @capture.string.match check end failure_message do "expected to #{description}" end failure_message_when_negated do "expected not to #{description}" end description do "match [#{check}] on stdout [#{@capture.string}]" end def supports_block_expectations? true end end
Version data entries
9 entries across 9 versions & 1 rubygems