Class: OneshotCoverage::Middleware

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

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



9
10
11
# File 'lib/oneshot_coverage.rb', line 9

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/oneshot_coverage.rb', line 13

def call(env)
  @app.call(env)
ensure
  if Coverage.running?
    OneshotCoverage.emit
  end
end