+ Refactor setup hooks into a SETUP_METHODS constant. (MSP-Greg)
[git-p4: depot-paths = "//src/minitest/dev/": change = 13579]
This commit is contained in:
parent
b5565c0c7a
commit
3a77687e8b
|
@ -84,6 +84,8 @@ module Minitest
|
||||||
:random
|
:random
|
||||||
end
|
end
|
||||||
|
|
||||||
|
SETUP_METHODS = %w[ before_setup setup after_setup ] # :nodoc:
|
||||||
|
|
||||||
TEARDOWN_METHODS = %w[ before_teardown teardown after_teardown ] # :nodoc:
|
TEARDOWN_METHODS = %w[ before_teardown teardown after_teardown ] # :nodoc:
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -93,7 +95,9 @@ module Minitest
|
||||||
with_info_handler do
|
with_info_handler do
|
||||||
time_it do
|
time_it do
|
||||||
capture_exceptions do
|
capture_exceptions do
|
||||||
before_setup; setup; after_setup
|
SETUP_METHODS.each do |hook|
|
||||||
|
self.send hook
|
||||||
|
end
|
||||||
|
|
||||||
self.send self.name
|
self.send self.name
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue