Module: Rapidash::TestClient

Defined in:
lib/rapidash/test_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#jsonObject (readonly)

Returns the value of attribute json.



27
28
29
# File 'lib/rapidash/test_client.rb', line 27

def json
  @json
end

#responsesObject (readonly)

Returns the value of attribute responses.



27
28
29
# File 'lib/rapidash/test_client.rb', line 27

def responses
  @responses
end

#stubsObject (readonly)

Returns the value of attribute stubs.



27
28
29
# File 'lib/rapidash/test_client.rb', line 27

def stubs
  @stubs
end

Instance Method Details

#initialize(responses, options = {}) ⇒ Object



29
30
31
32
33
# File 'lib/rapidash/test_client.rb', line 29

def initialize(responses, options = {})
  @json = options[:json] || false
  @responses = responses
  build_stubs
end

#request(verb, url, options = {}) ⇒ Object



35
36
37
# File 'lib/rapidash/test_client.rb', line 35

def request(verb, url, options = {})
  connection.send(verb, url, options).body
end