Sha256: 7f64e900e09fc04d27fda4a8bde79d89b1099a6725b5f9878e4f20bd8cc0866b
Contents?: true
Size: 408 Bytes
Versions: 20
Compression:
Stored size: 408 Bytes
Contents
# frozen_string_literal: true module Net # Override Net::hTTPResponse for create response with body class HTTPResponse def self.mock(body = {}) # construct clazz = self response = clazz.new('1.1', '200', 'OK') # inject response.instance_variable_set :@body, body # mockulate response.instance_eval 'def body; @body; end' response end end end
Version data entries
20 entries across 20 versions & 1 rubygems