Class: Apis::Adapter::RackTest

Inherits:
Abstract
  • Object
show all
Includes:
Rack::Test::Methods
Defined in:
lib/apis/adapter/rack_test.rb

Instance Attribute Summary collapse

Attributes inherited from Abstract

#uri

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

This class inherits a constructor from Apis::Adapter::Abstract

Instance Attribute Details

#appObject

Returns the value of attribute app.



8
9
10
# File 'lib/apis/adapter/rack_test.rb', line 8

def app
  @app
end

#last_headersObject (readonly)

Returns the value of attribute last_headers.



10
11
12
# File 'lib/apis/adapter/rack_test.rb', line 10

def last_headers
  @last_headers
end

#last_paramsObject (readonly)

Returns the value of attribute last_params.



10
11
12
# File 'lib/apis/adapter/rack_test.rb', line 10

def last_params
  @last_params
end

#last_pathObject (readonly)

Returns the value of attribute last_path.



10
11
12
# File 'lib/apis/adapter/rack_test.rb', line 10

def last_path
  @last_path
end

Instance Method Details

#run(method, path, params = {}, headers = {}) ⇒ Object



12
13
14
15
16
# File 'lib/apis/adapter/rack_test.rb', line 12

def run(method, path, params = {}, headers = {})
  @last_path, @last_params, @last_headers = path, params, headers
  send(method, path, params, headers)
  [last_response.status, last_response.headers, last_response.body]
end