Sha256: d98693aac678079ff61ebad921ffdeff769039d666bd81cbe099e3aff39439a3
Contents?: true
Size: 644 Bytes
Versions: 4
Compression:
Stored size: 644 Bytes
Contents
module Net remove_const "HTTP" class Request < Struct.new(:host, :port, :query, :post_data, :headers) def post(query, post, headers = {}) self.query = query self.post_data = post self.headers = headers end end class Net::HTTP def self.start(host, port) request = Request.new request.host = host request.port = port @pings ||= [] @pings << request yield request end def self.pings @pings end def self.next_response=(mock_response) @@response = mock_response end def self.get_response(*args) @@response end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
typo-3.99.0 | test/mocks/test/http_mock.rb |
typo-3.99.3 | test/mocks/test/http_mock.rb |
typo-3.99.1 | test/mocks/test/http_mock.rb |
typo-3.99.2 | test/mocks/test/http_mock.rb |