+ Refactor setup hooks into a SETUP_METHODS constant. (MSP-Greg)

[git-p4: depot-paths = "//src/minitest/dev/": change = 13579]
This commit is contained in:
Ryan Davis 2022-11-06 11:29:33 -08:00
parent b5565c0c7a
commit 3a77687e8b
1 changed files with 5 additions and 1 deletions

View File

@ -84,6 +84,8 @@ module Minitest
:random
end
SETUP_METHODS = %w[ before_setup setup after_setup ] # :nodoc:
TEARDOWN_METHODS = %w[ before_teardown teardown after_teardown ] # :nodoc:
##
@ -93,7 +95,9 @@ module Minitest
with_info_handler do
time_it do
capture_exceptions do
before_setup; setup; after_setup
SETUP_METHODS.each do |hook|
self.send hook
end
self.send self.name
end