Sha256: 6a569e42124fe700ae1403697d75cb41786df7c70922fa6d73cb3419360e5ea4
Contents?: true
Size: 604 Bytes
Versions: 67
Compression:
Stored size: 604 Bytes
Contents
require 'multi_json' def raw_fixture(which, status = 200, _as_json = false, headers = {}) object = Object.new allow(object).to receive(:status) { status } allow(object).to receive(:headers) { headers } allow(object).to receive(:to_s) { File.read File.dirname(__FILE__) + "/../fixtures/json_responses/#{which}.json" } allow(object).to receive(:body) { object.to_s } allow(object).to receive(:[]) { |key| object.headers[key] } object end def json_fixture(which, _as_json = false) MultiJson.load( File.read File.dirname(__FILE__) + "/../fixtures/json_responses/#{which}.json" ) end
Version data entries
67 entries across 67 versions & 2 rubygems