Sha256: d2205e185dfc8cc53add31ce4e7d2b118ccfbe75e5b3ee4a20b7f40225997fea

Contents?: true

Size: 1.71 KB

Versions: 62

Compression:

Stored size: 1.71 KB

Contents

require 'bundler/setup'
Bundler.setup

require 'simplecov'
SimpleCov.start

require 'bolognese'
require 'maremma'
require 'rspec'
require 'rack/test'
require 'webmock/rspec'
require 'rspec/xsd'
require 'nokogiri'
require 'vcr'

RSpec.configure do |config|
  config.order = :random
  config.include RSpec::XSD
  config.include WebMock::API
  config.include Rack::Test::Methods
  config.expect_with :rspec do |c|
    c.syntax = :expect
  end

  config.before do
    ARGV.replace []
  end

  config.before(:suite) do
    ::NameDetector = GenderDetector.new
  end
end

def fixture_path
  File.expand_path("../fixtures", __FILE__) + '/'
end

# This code was adapted from Thor, available under MIT-LICENSE
# Copyright (c) 2008 Yehuda Katz, Eric Hodel, et al.
def capture(stream)
  begin
    stream = stream.to_s
    eval "$#{stream} = StringIO.new"
    yield
    result = eval("$#{stream}").string
  ensure
    eval("$#{stream} = #{stream.upcase}")
  end

  result
end

def capture_stdout(&block)
  original_stdout = $stdout
  $stdout = fake = StringIO.new
  begin
    yield
  ensure
    $stdout = original_stdout
  end
  fake.string
end

def capture_stderr(&block)
  original_stderr = $stderr
  $stderr = fake = StringIO.new
  begin
    yield
  ensure
    $stderr = original_stderr
  end
  fake.string
end

# This code was adapted from Ruby on Rails, available under MIT-LICENSE
# Copyright (c) 2004-2013 David Heinemeier Hansson
def silence_warnings
  old_verbose, $VERBOSE = $VERBOSE, nil
  yield
ensure
  $VERBOSE = old_verbose
end

alias silence capture

VCR.configure do |c|
  c.cassette_library_dir = "spec/fixtures/vcr_cassettes"
  c.hook_into :webmock
  c.ignore_localhost = true
  c.ignore_hosts 'codeclimate.com'
  c.configure_rspec_metadata!
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
bolognese-0.9.99 spec/spec_helper.rb
bolognese-0.9.98 spec/spec_helper.rb
bolognese-0.9.97 spec/spec_helper.rb
bolognese-0.9.96 spec/spec_helper.rb
bolognese-0.9.95 spec/spec_helper.rb
bolognese-0.9.94 spec/spec_helper.rb
bolognese-0.9.93 spec/spec_helper.rb
bolognese-0.9.92 spec/spec_helper.rb
bolognese-0.9.91 spec/spec_helper.rb
bolognese-0.9.89 spec/spec_helper.rb
bolognese-0.9.88 spec/spec_helper.rb
bolognese-0.9.87 spec/spec_helper.rb
bolognese-0.9.86 spec/spec_helper.rb
bolognese-0.9.85 spec/spec_helper.rb
bolognese-0.9.84 spec/spec_helper.rb
bolognese-0.9.83 spec/spec_helper.rb
bolognese-0.9.82 spec/spec_helper.rb
bolognese-0.9.81 spec/spec_helper.rb
bolognese-0.9.80 spec/spec_helper.rb
bolognese-0.9.79 spec/spec_helper.rb