2011-04-16 14:43:20 -04:00
|
|
|
$:.push File.expand_path("../lib", __FILE__)
|
|
|
|
require "httparty"
|
|
|
|
|
2009-09-08 21:41:13 -04:00
|
|
|
require 'spec/autorun'
|
2009-08-22 21:14:32 -04:00
|
|
|
require 'fakeweb'
|
|
|
|
|
2008-12-06 19:41:23 -05:00
|
|
|
def file_fixture(filename)
|
|
|
|
open(File.join(File.dirname(__FILE__), 'fixtures', "#{filename.to_s}")).read
|
|
|
|
end
|
|
|
|
|
2010-01-29 15:20:15 -05:00
|
|
|
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
|
2008-12-22 14:30:31 -05:00
|
|
|
|
2010-01-29 15:20:15 -05:00
|
|
|
Spec::Runner.configure do |config|
|
|
|
|
config.include HTTParty::StubResponse
|
2010-07-08 22:21:38 -04:00
|
|
|
config.include HTTParty::SSLTestHelper
|
2012-04-15 22:51:39 -04:00
|
|
|
|
2010-05-13 21:48:42 -04:00
|
|
|
config.before(:suite) do
|
|
|
|
FakeWeb.allow_net_connect = false
|
|
|
|
end
|
2012-04-15 22:51:39 -04:00
|
|
|
|
2010-05-13 21:48:42 -04:00
|
|
|
config.after(:suite) do
|
|
|
|
FakeWeb.allow_net_connect = true
|
|
|
|
end
|
2009-11-09 22:09:03 -05:00
|
|
|
end
|
2012-09-07 12:36:01 -04:00
|
|
|
|
|
|
|
Spec::Matchers.define :use_ssl do
|
|
|
|
match do |connection|
|
|
|
|
connection.use_ssl?
|
|
|
|
end
|
|
|
|
end
|
2013-08-01 04:32:25 -04:00
|
|
|
|
|
|
|
Spec::Matchers.define :use_cert_store do |cert_store|
|
|
|
|
match do |connection|
|
|
|
|
connection.cert_store == cert_store
|
|
|
|
end
|
|
|
|
end
|