Class: RackStubs::Middleware::PathSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/rack_stubs/middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, http_verb, middleware) ⇒ PathSpecification

Returns a new instance of PathSpecification.



44
45
46
# File 'lib/rack_stubs/middleware.rb', line 44

def initialize(path, http_verb, middleware)
  @path, @http_verb, @middleware = path, http_verb, middleware
end

Instance Method Details

#returns(status, headers, body) ⇒ Object



48
49
50
# File 'lib/rack_stubs/middleware.rb', line 48

def returns(status, headers, body)
  @middleware.setup_stub(@path, { @http_verb => [status, headers, body] })
end