Class: RackBox::App
- Inherits:
-
Object
- Object
- RackBox::App
- Defined in:
- lib/rackbox/app.rb
Overview
represents a rack appliction
gives us some helpers on a rack app like the ability to use the #request method on it easily
Instance Attribute Summary collapse
-
#mock_request ⇒ Object
Returns the value of attribute mock_request.
-
#rack_app ⇒ Object
Returns the value of attribute rack_app.
Instance Method Summary collapse
-
#initialize(rack_app) ⇒ App
constructor
A new instance of App.
-
#request(url, options = {}) ⇒ Object
sessions are sticky!.
- #reset_request ⇒ Object (also: #reset)
Constructor Details
#initialize(rack_app) ⇒ App
Returns a new instance of App.
12 13 14 15 |
# File 'lib/rackbox/app.rb', line 12 def initialize rack_app @rack_app = rack_app reset_request end |
Instance Attribute Details
#mock_request ⇒ Object
Returns the value of attribute mock_request.
10 11 12 |
# File 'lib/rackbox/app.rb', line 10 def mock_request @mock_request end |
#rack_app ⇒ Object
Returns the value of attribute rack_app.
10 11 12 |
# File 'lib/rackbox/app.rb', line 10 def rack_app @rack_app end |
Instance Method Details
#request(url, options = {}) ⇒ Object
sessions are sticky!
to reset, @rackbox_app.reset
25 26 27 |
# File 'lib/rackbox/app.rb', line 25 def request url, = {} RackBox.request @mock_request, url, end |
#reset_request ⇒ Object Also known as: reset
17 18 19 |
# File 'lib/rackbox/app.rb', line 17 def reset_request @mock_request = Rack::MockRequest.new @rack_app end |