Module: Sus::Fixtures::Protocol::HTTP::MiddlewareContext
- Defined in:
- lib/sus/fixtures/protocol/http/middleware_context.rb
Overview
A test context for exercising protocol HTTP middleware in-process.
Instance Method Summary collapse
-
#after(error = nil) ⇒ Object
Close the client after each test.
-
#client ⇒ Object
The in-process client for the application.
-
#last_request ⇒ Object
The most recent request.
-
#last_response ⇒ Object
The most recent response.
-
#middleware ⇒ Object
The middleware under test.
Instance Method Details
#after(error = nil) ⇒ Object
Close the client after each test.
46 47 48 49 50 51 52 |
# File 'lib/sus/fixtures/protocol/http/middleware_context.rb', line 46 def after(error = nil) begin @client&.close(error) ensure super end end |
#client ⇒ Object
The in-process client for the application.
25 26 27 |
# File 'lib/sus/fixtures/protocol/http/middleware_context.rb', line 25 def client @client ||= Client.new(middleware) end |
#last_request ⇒ Object
The most recent request.
32 33 34 |
# File 'lib/sus/fixtures/protocol/http/middleware_context.rb', line 32 def last_request client.last_request end |
#last_response ⇒ Object
The most recent response.
39 40 41 |
# File 'lib/sus/fixtures/protocol/http/middleware_context.rb', line 39 def last_response client.last_response end |
#middleware ⇒ Object
The middleware under test.
18 19 20 |
# File 'lib/sus/fixtures/protocol/http/middleware_context.rb', line 18 def middleware ::Protocol::HTTP::Middleware::HelloWorld end |