Class: Tap::Test::HttpTest::MockServer

Inherits:
Object
  • Object
show all
Defined in:
lib/tap/test/http_test.rb

Instance Method Summary collapse

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