Skip to content

Commit

Permalink
+ Refactor setup hooks into a SETUP_METHODS constant. (MSP-Greg)
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/minitest/dev/": change = 13579]
  • Loading branch information
zenspider committed Nov 6, 2022
1 parent b5565c0 commit 3a77687
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/minitest/test.rb
Expand Up @@ -84,6 +84,8 @@ def self.test_order
:random
end

SETUP_METHODS = %w[ before_setup setup after_setup ] # :nodoc:

TEARDOWN_METHODS = %w[ before_teardown teardown after_teardown ] # :nodoc:

##
Expand All @@ -93,7 +95,9 @@ def run
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
Expand Down

0 comments on commit 3a77687

Please sign in to comment.