Sha256: ee7237003cd67ad6e3a7e1b643d0e74cdce6cd8d9a6be1bf4ff936635b894fcc

Contents?: true

Size: 879 Bytes

Versions: 9

Compression:

Stored size: 879 Bytes

Contents

if ENV["ALL_TESTS"]
  require 'simplecov'
  SimpleCov.start do
    track_files "lib/dply/**/*.rb"
  end
end

RSpec.configure do |config|
  config.exclude_pattern = "**/integration/*_spec.rb" if not ENV["ALL_TESTS"]
end

$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)

def silence_warnings(&block)
  warn_level = $VERBOSE
  $VERBOSE = nil
  yield
ensure
  $VERBOSE = warn_level
end

def suppress_output(&block)
  orig_stdout = $stdout.clone
  orig_stderr = $stderr.clone
  $stdout.reopen("/dev/null", "a+")
  $stderr.reopen("/dev/null", "a+")
  yield
ensure
  $stdout.reopen orig_stdout
  $stderr.reopen orig_stderr
end

def system!(command, quiet: true)
  if quiet
    retval = system command, [:out, :err] => "/dev/null"
  else
    retval = system command
  end
  raise "error in #{command}" if not retval
end

silence_warnings do
  require_relative 'webserver'
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dply-0.3.8 spec/spec_helper.rb
dply-0.3.7 spec/spec_helper.rb
dply-0.3.6 spec/spec_helper.rb
dply-0.3.5 spec/spec_helper.rb
dply-0.3.4 spec/spec_helper.rb
dply-0.3.3 spec/spec_helper.rb
dply-0.3.2 spec/spec_helper.rb
dply-0.3.1 spec/spec_helper.rb
dply-0.3.0 spec/spec_helper.rb