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

Version Path
rhodes-5.5.18 lib/extensions/mspec/mspec/guards/background.rb
rhodes-5.5.17 lib/extensions/mspec/mspec/guards/background.rb
rhodes-5.5.15 lib/extensions/mspec/mspec/guards/background.rb
rhodes-5.5.0.22 lib/extensions/mspec/mspec/guards/background.rb
rhodes-5.5.2 lib/extensions/mspec/mspec/guards/background.rb
rhodes-5.5.0.7 lib/extensions/mspec/mspec/guards/background.rb
rhodes-5.5.0.3 lib/extensions/mspec/mspec/guards/background.rb
rhodes-5.5.0 lib/extensions/mspec/mspec/guards/background.rb
tauplatform-1.0.3 lib/extensions/mspec/mspec/guards/background.rb
mspec-1.9.1 lib/mspec/guards/background.rb
mspec-1.9.0 lib/mspec/guards/background.rb
tauplatform-1.0.2 lib/extensions/mspec/mspec/guards/background.rb
tauplatform-1.0.1 lib/extensions/mspec/mspec/guards/background.rb
mspec-1.8.0 lib/mspec/guards/background.rb
mspec-1.7.0 lib/mspec/guards/background.rb
mspec-1.6.0 lib/mspec/guards/background.rb
mspec-1.5.21 lib/mspec/guards/background.rb
mspec-1.5.20 lib/mspec/guards/background.rb
mspec-1.5.19 lib/mspec/guards/background.rb
mspec-1.5.18 lib/mspec/guards/background.rb