Sha256: f8ccb9a6e890befaafbb23e9465fa83f948b94a7a3651ead81d2975339e1757c
Contents?: true
Size: 581 Bytes
Versions: 38
Compression:
Stored size: 581 Bytes
Contents
module Rubix module ResponseSpecs def mock_response result={}, code=200 response = mock("Net::HTTPResponse") response.stub!(:body).and_return({"jsonrpc" => "2.0", "result" => result}.to_json) response.stub!(:code).and_return(code.to_s) Rubix::Response.new(response) end def mock_error message='', code=200 response = mock("Net::HTTPResponse") response.stub!(:body).and_return({"jsonrpc" => "2.0", "error" => message}.to_json) response.stub!(:code).and_return(code.to_s) Rubix::Response.new(response) end end end
Version data entries
38 entries across 38 versions & 1 rubygems