Class: Webrat::SinatraAdapter

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

Instance Method Summary collapse

Methods inherited from RackAdapter

#response, #response_body, #response_code, #response_headers

Constructor Details

#initialize(context) ⇒ SinatraAdapter

Returns a new instance of SinatraAdapter.



3
4
5
6
7
# File 'lib/webrat/adapters/sinatra.rb', line 3

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