Class: Skink::RackTestClient
- Inherits:
-
Client::Base
show all
- Includes:
- Rack::Test::Methods
- Defined in:
- lib/skink/rack_test_client/rack_test_client.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
#connect, #method_missing, #options, #patch, #trace
#normalize_header_name
Constructor Details
Returns a new instance of RackTestClient.
13
14
15
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 13
def initialize(rack_app)
@app = rack_app
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Skink::Client::Base
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
11
12
13
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 11
def app
@app
end
|
#last_response ⇒ Object
Returns the value of attribute last_response.
11
12
13
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 11
def last_response
@last_response
end
|
Instance Method Details
#delete(path) ⇒ Object
45
46
47
48
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 45
def delete(path)
resp = super path
@last_response = RackTestResponse.new resp
end
|
#get(path) ⇒ Object
30
31
32
33
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 30
def get(path)
resp = super path
@last_response = RackTestResponse.new resp
end
|
#head(path) ⇒ Object
25
26
27
28
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 25
def head(path)
resp = super path
@last_response = RackTestResponse.new resp
end
|
#post(path, body = nil) ⇒ Object
35
36
37
38
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 35
def post(path, body = nil)
resp = super(path, body)
@last_response = RackTestResponse.new resp
end
|
#put(path, body) ⇒ Object
40
41
42
43
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 40
def put(path, body)
resp = super(path, body)
@last_response = RackTestResponse.new resp
end
|
#response ⇒ Object
50
51
52
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 50
def response
last_response
end
|
#with_basic_auth(user_name, password, realm = nil) ⇒ Object
17
18
19
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 17
def with_basic_auth(user_name, password, realm = nil)
authorize(user_name, password)
end
|
21
22
23
|
# File 'lib/skink/rack_test_client/rack_test_client.rb', line 21
def (name, value)
(name, value)
end
|