Class: Tap::Test::HttpTest::MockServer
- Inherits:
-
Object
- Object
- Tap::Test::HttpTest::MockServer
- Defined in:
- lib/tap/test/http_test.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(status = 200, headers = {}, &block) ⇒ MockServer
constructor
A new instance of MockServer.
Constructor Details
#initialize(status = 200, headers = {}, &block) ⇒ MockServer
Returns a new instance of MockServer.
17 18 19 20 21 |
# File 'lib/tap/test/http_test.rb', line 17 def initialize(status=200, headers={}, &block) @status = status @headers = headers @block = block end |
Instance Method Details
#call(env) ⇒ Object
23 24 25 |
# File 'lib/tap/test/http_test.rb', line 23 def call(env) [@status, @headers, @block.call(env)] end |