Sha256: 12b694325d67d76d9eed8ad49faaf6c6aea04fe4c10d31100c50ece1a319231c
Contents?: true
Size: 1.87 KB
Versions: 42
Compression:
Stored size: 1.87 KB
Contents
# frozen_string_literal: true require 'bundler/setup' Bundler.setup require 'simplecov' require 'simplecov_json_formatter' SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter SimpleCov.start require 'commonmeta' 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', __dir__)}/" 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 original_stdout = $stdout $stdout = fake = StringIO.new begin yield ensure $stdout = original_stdout end fake.string end def capture_stderr 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.default_cassette_options = { record: :new_episodes } c.allow_http_connections_when_no_cassette = true c.configure_rspec_metadata! end
Version data entries
42 entries across 42 versions & 1 rubygems