lib/savon/mock/expectation.rb in savon-2.15.1 vs lib/savon/mock/expectation.rb in savon-3.0.0.rc1
- old
+ new
@@ -1,7 +1,7 @@
# frozen_string_literal: true
-require "httpi"
+require "faraday"
module Savon
class MockExpectation
def initialize(operation_name)
@@ -39,12 +39,12 @@
def response!
unless @response
raise ExpectationError, "This expectation was not set up with a response."
end
-
- HTTPI::Response.new(@response[:code], @response[:headers], @response[:body])
+ env = Faraday::Env.from(status: @response[:code], response_headers: @response[:headers], response_body: @response[:body])
+ Faraday::Response.new(env)
end
private
def verify_operation_name!
@@ -73,9 +73,9 @@
return false if (msg_expected.nil? || msg_real.nil?) # If both are nil has returned true
msg_expected.each do |key, expected_value|
next if (expected_value == :any && msg_real.include?(key))
return false if expected_value != msg_real[key]
end
- return true
+ true
end
end
end