1 $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
7 Faraday::Adapter.load_middleware(:test)
12 if app.kind_of?(Faraday::Adapter::Test)
13 app.stubs.verify_stubbed_calls
15 raise TypeError, "Expected test adapter"
21 module ConnectionHelpers
22 def stub_connection(&block)
23 stubs = Faraday::Adapter::Test::Stubs.new do |stub|
26 connection = Faraday.new do |builder|
27 builder.options.params_encoder = Faraday::FlatParamsEncoder
28 builder.adapter(:test, stubs)
35 def initialize(expected)
36 @expected = JSON.parse(expected)
39 @target = JSON.parse(target)
40 @target.eql?(@expected)
43 "expected #{@target.inspect} to be #{@expected}"
45 def negative_failure_message
46 "expected #{@target.inspect} not to be #{@expected}"
51 EqualsJson.new(expected)
55 RSpec.configure do |config|