Sha256: 1fab2d9e830c4132e604942c9ffe710526c12c0237c7215792e7a2e2ab411398
Contents?: true
Size: 441 Bytes
Versions: 175
Compression:
Stored size: 441 Bytes
Contents
require 'mspec/guards/guard' # Some specs, notably those for Readline, will block under certain # circumstances when run as background or subprocesses. Use this guard for # such specs. class BackgroundGuard < SpecGuard def match? MSpec.mode? :background end end class Object def process_is_foreground g = BackgroundGuard.new g.name = :process_is_foreground yield if g.yield? true ensure g.unregister end end
Version data entries
175 entries across 151 versions & 4 rubygems