Sha256: 2ad0d0df3ecf55868c0c7681449738528b5c7674e88bd9ec1d9137d2d8c73a96
Contents?: true
Size: 670 Bytes
Versions: 13
Compression:
Stored size: 670 Bytes
Contents
# frozen_string_literal: true module Spout module Helpers # Silences output for tests module Quietly # From Rails: http://apidock.com/rails/v3.2.13/Kernel/silence_stream def silence_stream(stream) old_stream = stream.dup stream.reopen(/mswin|mingw/ =~ RbConfig::CONFIG["host_os"] ? "NUL:" : "/dev/null") stream.sync = true yield ensure stream.reopen(old_stream) end # From Rails: http://apidock.com/rails/v3.2.13/Kernel/quietly def quietly silence_stream(STDOUT) do silence_stream(STDERR) do yield end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems