Class: RoutesCoverage::Adapters::AtExit

Inherits:
Object
  • Object
show all
Defined in:
lib/routes_coverage/adapters/atexit.rb

Class Method Summary collapse

Class Method Details

.use(_coverer = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/routes_coverage/adapters/atexit.rb', line 6

def self.use(_coverer = nil)
  # NB: at_exit order is important, for example minitest uses it to run, need to install our handler before it

  RoutesCoverage.reset!
  at_exit do
    next if RoutesCoverage.pid != Process.pid

    RoutesCoverage.perform_report
    exit # rubocop:disable Rails/Exit
  end
end