Class: RackStubs::Middleware::PathSpecification

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

Instance Method Summary collapse

Constructor Details

#initialize(stubs, path, verb) ⇒ PathSpecification

Returns a new instance of PathSpecification.



42
43
44
# File 'lib/rack_stubs/middleware.rb', line 42

def initialize(stubs, path, verb)
  @stubs, @path, @verb = stubs, path, verb
end

Instance Method Details

#returns(status, headers, body) ⇒ Object



46
47
48
# File 'lib/rack_stubs/middleware.rb', line 46

def returns(status, headers, body)
  (@stubs[@path] ||= {})[@verb] = [status, headers, body]
end