Sha256: a39bcbc35ef1e6ad1a0d89dace7eceb469e98da743bc8c2afd39383aa7dbcd47
Contents?: true
Size: 399 Bytes
Versions: 6
Compression:
Stored size: 399 Bytes
Contents
module StdoutHelpers def silence_stdout orig_stdout = $stdout $stdout = File.open("/dev/null", "w") yield ensure $stdout = orig_stdout end def capture_stdout orig_stdout = $stdout stdout_reader, $stdout = IO.pipe yield $stdout.close stdout_reader.read ensure $stdout = orig_stdout end end RSpec.configure do |c| c.include(StdoutHelpers) end
Version data entries
6 entries across 6 versions & 1 rubygems