Class: Capybara::Lockstep::Middleware

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara-lockstep/middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



5
6
7
# File 'lib/capybara-lockstep/middleware.rb', line 5

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/capybara-lockstep/middleware.rb', line 9

def call(env)
  tag = "Server request for #{env['PATH_INFO'] || 'unknown path'}"
  Lockstep.start_work(tag)

  begin
    @app.call(env)
  ensure
    Lockstep.stop_work(tag)
  end
end