2014-12-06 16:10:24 -08:00
|
|
|
require "simplecov"
|
|
|
|
SimpleCov.start
|
2014-02-09 01:02:18 -03:00
|
|
|
|
2014-12-06 16:10:24 -08:00
|
|
|
require "httparty"
|
2017-06-03 22:25:10 +01:00
|
|
|
require 'webmock/rspec'
|
2009-08-22 21:14:32 -04:00
|
|
|
|
2008-12-06 19:41:23 -05:00
|
|
|
def file_fixture(filename)
|
2015-04-18 12:49:34 +02:00
|
|
|
open(File.join(File.dirname(__FILE__), 'fixtures', "#{filename}")).read
|
2008-12-06 19:41:23 -05:00
|
|
|
end
|
|
|
|
|
2015-04-18 12:29:00 +02:00
|
|
|
Dir[File.expand_path(File.join(File.dirname(__FILE__), 'support', '**', '*.rb'))].each {|f| require f}
|
2008-12-23 03:30:31 +08:00
|
|
|
|
2014-12-06 16:10:24 -08:00
|
|
|
RSpec.configure do |config|
|
2010-01-29 15:20:15 -05:00
|
|
|
config.include HTTParty::StubResponse
|
2010-07-08 22:21:38 -04:00
|
|
|
config.include HTTParty::SSLTestHelper
|
2012-04-15 22:51:39 -04:00
|
|
|
|
2014-12-06 16:10:24 -08:00
|
|
|
config.expect_with :rspec do |expectations|
|
|
|
|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
|
|
end
|
|
|
|
|
|
|
|
config.mock_with :rspec do |mocks|
|
2014-12-06 17:48:53 -08:00
|
|
|
mocks.verify_partial_doubles = false
|
2012-09-07 12:36:01 -04:00
|
|
|
end
|
2013-08-01 01:32:25 -07:00
|
|
|
|
2014-12-06 16:10:24 -08:00
|
|
|
config.filter_run :focus
|
|
|
|
config.run_all_when_everything_filtered = true
|
|
|
|
|
|
|
|
config.disable_monkey_patching!
|
|
|
|
|
|
|
|
config.warnings = true
|
|
|
|
|
|
|
|
if config.files_to_run.one?
|
|
|
|
config.default_formatter = 'doc'
|
2013-08-01 01:32:25 -07:00
|
|
|
end
|
2014-12-06 16:10:24 -08:00
|
|
|
|
|
|
|
config.profile_examples = 10
|
|
|
|
|
|
|
|
config.order = :random
|
|
|
|
|
|
|
|
Kernel.srand config.seed
|
2013-08-01 01:32:25 -07:00
|
|
|
end
|
2014-12-06 17:07:05 -08:00
|
|
|
|
|
|
|
RSpec::Matchers.define :use_ssl do
|
2015-04-18 01:36:09 +02:00
|
|
|
match(&:use_ssl?)
|
2014-12-06 17:07:05 -08:00
|
|
|
end
|
|
|
|
|
|
|
|
RSpec::Matchers.define :use_cert_store do |cert_store|
|
|
|
|
match do |connection|
|
|
|
|
connection.cert_store == cert_store
|
|
|
|
end
|
|
|
|
end
|