Sha256: 5ddf0c40c0c01dda98e8db8acacf491d6905385bc276d847a8f7cce076f4266b
Contents?: true
Size: 975 Bytes
Versions: 18
Compression:
Stored size: 975 Bytes
Contents
require 'httpi/adapter/httpclient' # Proxy adapter. Records all requests and passes them to HTTPClient class AdapterForTest < HTTPI::Adapter::Base register :adapter_for_test def initialize(request) @@requests ||= [] @@requests.push request @request = request @worker = HTTPI::Adapter::HTTPClient.new(request) end def client @worker.client end def request(method) @@methods ||= [] @@methods.push method @worker.request(method) end end # Fake adapter with request recording. # Takes path from url and returns fixture WSDL with that name. class FakeAdapterForTest < HTTPI::Adapter::Base register :fake_adapter_for_test def initialize(request) @@requests ||= [] @@requests.push request @request = request end attr_reader :client def request(method) @@methods ||= [] @@methods.push method target = @request.url.path.to_sym HTTPI::Response.new(200, {}, Fixture.wsdl(target)) end end
Version data entries
18 entries across 18 versions & 2 rubygems