2014-12-06 19:10:24 -05:00
|
|
|
require "simplecov"
|
|
|
|
SimpleCov.start
|
2014-02-08 23:02:18 -05:00
|
|
|
|
2014-12-06 19:10:24 -05:00
|
|
|
require "httparty"
|
2017-06-03 17:25:10 -04: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 06:49:34 -04:00
|
|
|
open(File.join(File.dirname(__FILE__), 'fixtures', "#{filename}")).read
|
2008-12-06 19:41:23 -05:00
|
|
|
end
|
|
|
|
|
2015-04-18 06:29:00 -04:00
|
|
|
Dir[File.expand_path(File.join(File.dirname(__FILE__), 'support', '**', '*.rb'))].each {|f| require f}
|
2008-12-22 14:30:31 -05:00
|
|
|
|
2014-12-06 19:10:24 -05: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 19:10:24 -05: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 20:48:53 -05:00
|
|
|
mocks.verify_partial_doubles = false
|
2012-09-07 12:36:01 -04:00
|
|
|
end
|
2013-08-01 04:32:25 -04:00
|
|
|
|
2014-12-06 19:10:24 -05: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 04:32:25 -04:00
|
|
|
end
|
2014-12-06 19:10:24 -05:00
|
|
|
|
|
|
|
config.profile_examples = 10
|
|
|
|
|
|
|
|
config.order = :random
|
|
|
|
|
|
|
|
Kernel.srand config.seed
|
2013-08-01 04:32:25 -04:00
|
|
|
end
|
2014-12-06 20:07:05 -05:00
|
|
|
|
|
|
|
RSpec::Matchers.define :use_ssl do
|
2015-04-17 19:36:09 -04:00
|
|
|
match(&:use_ssl?)
|
2014-12-06 20:07:05 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
RSpec::Matchers.define :use_cert_store do |cert_store|
|
|
|
|
match do |connection|
|
|
|
|
connection.cert_store == cert_store
|
|
|
|
end
|
|
|
|
end
|