1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00
httparty/spec/spec_helper.rb

39 lines
824 B
Ruby
Raw Normal View History

2014-11-28 09:39:05 -05:00
require 'simplecov'
$:.push File.expand_path("../lib", __FILE__)
require "httparty"
2009-09-08 21:41:13 -04:00
require 'spec/autorun'
require 'fakeweb'
def file_fixture(filename)
open(File.join(File.dirname(__FILE__), 'fixtures', "#{filename.to_s}")).read
end
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
Spec::Runner.configure do |config|
config.include HTTParty::StubResponse
config.include HTTParty::SSLTestHelper
2012-04-15 22:51:39 -04:00
config.before(:suite) do
FakeWeb.allow_net_connect = false
end
2012-04-15 22:51:39 -04:00
config.after(:suite) do
FakeWeb.allow_net_connect = true
end
2009-11-09 22:09:03 -05:00
end
Spec::Matchers.define :use_ssl do
match do |connection|
connection.use_ssl?
end
end
Spec::Matchers.define :use_cert_store do |cert_store|
match do |connection|
connection.cert_store == cert_store
end
end