Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v2_1_10) is shown here.
autorun()public
Registers MiniTest::Unit to run tests at process exit
# File lib/minitest/unit.rb, line 785
def self.autorun
at_exit {
# don't run if there was a non-exit exception
next if $! and not $!.kind_of? SystemExit
# the order here is important. The at_exit handler must be
# installed before anyone else gets a chance to install their
# own, that way we can be assured that our exit will be last
# to run (at_exit stacks).
exit_code = nil
at_exit {
@@after_tests.reverse_each(&:call)
exit false if exit_code && exit_code != 0
}
exit_code = MiniTest::Unit.new.run ARGV
} unless @@installed_at_exit
@@installed_at_exit = true
end