Class: Webrat::SinatraAdapter

Inherits:
RackAdapter show all
Defined in:
lib/webrat/sinatra.rb

Instance Method Summary collapse

Methods inherited from RackAdapter

#response, #response_body, #response_code

Constructor Details

#initialize(context) ⇒ SinatraAdapter

Returns a new instance of SinatraAdapter.



5
6
7
8
9
# File 'lib/webrat/sinatra.rb', line 5

def initialize(context)
  app = context.respond_to?(:app) ? context.app : Sinatra::Application

  super(Rack::Test::Session.new(Rack::MockSession.new(app, "www.example.com")))
end