1 $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
11 SimpleCov.formatter = Coveralls::SimpleCov::Formatter
14 # SimpleCov missing, so just run specs with no coverage.
17 Faraday::Adapter.load_middleware(:test)
22 if app.kind_of?(Faraday::Adapter::Test)
23 app.stubs.verify_stubbed_calls
25 raise TypeError, "Expected test adapter"
31 module ConnectionHelpers
32 def stub_connection(&block)
33 stubs = Faraday::Adapter::Test::Stubs.new do |stub|
36 connection = Faraday.new do |builder|
37 builder.options.params_encoder = Faraday::FlatParamsEncoder
38 builder.adapter(:test, stubs)
45 def initialize(expected)
46 @expected = JSON.parse(expected)
49 @target = JSON.parse(target)
50 @target.eql?(@expected)
53 "expected #{@target.inspect} to be #{@expected}"
55 def negative_failure_message
56 "expected #{@target.inspect} not to be #{@expected}"
61 EqualsJson.new(expected)
65 RSpec.configure do |config|