Sha256: cf4386388ab5e0ab69e514621b946d744373f5ed951758e07927059a595d6312
Contents?: true
Size: 653 Bytes
Versions: 10
Compression:
Stored size: 653 Bytes
Contents
module Picky class TestClient < Client attr_reader :request # # # Example: # Picky::TestClient.new(BookSearch, :path => '/books') # def initialize rack_app, options = {} super options @request = Rack::MockRequest.new rack_app end # Wraps the search method to always extend the result with Convenience. # def search query, params = {} super.extend Convenience end # Backend method that we override to not send a real search. # def send_search params = {} params = defaultize params request.get("#{self.path}?#{params.to_query}").body end end end
Version data entries
10 entries across 10 versions & 1 rubygems