Class: SterlingApi::RemoteActions::MockResponse
- Defined in:
- lib/sterling_api/remote_actions.rb
Overview
for use in tests
options:
:ret_val the Net::HTTP return value
pass true for Net::HTTPSuccess, Net::HTTPRedirection
pass false for all others
:body the body 'returned' by the supposed Net::HTTP request
Instance Attribute Summary
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ MockResponse
constructor
A new instance of MockResponse.
Methods inherited from Response
Constructor Details
#initialize(options = {}) ⇒ MockResponse
Returns a new instance of MockResponse.
47 48 49 50 51 |
# File 'lib/sterling_api/remote_actions.rb', line 47 def initialize(={}) Struct.new('MockHttpResponse', :body) unless defined?(Struct::MockHttpResponse) mock_http_response = Struct::MockHttpResponse.new([:body]) super([:ret_val], mock_http_response) end |