Sha256: eb81fcbbab711833d2d923302d4843a41e407306fc136971b81e70ef170c6fa5
Contents?: true
Size: 367 Bytes
Versions: 175
Compression:
Stored size: 367 Bytes
Contents
require 'mspec/guards/guard' # If a spec depends on STDOUT being a tty, use this guard. For specs that may # block if run as a background process, see BackgroundGuard. class TTYGuard < SpecGuard def match? STDOUT.tty? end end class Object def with_tty g = TTYGuard.new g.name = :with_tty yield if g.yield? ensure g.unregister end end
Version data entries
175 entries across 151 versions & 4 rubygems