Dump profile before summary

This commit is contained in:
Michael Miller 2021-05-16 19:52:53 -06:00
parent aa13b077f3
commit 4bb4c2f16e
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD
3 changed files with 17 additions and 17 deletions

View file

@ -18,8 +18,8 @@ module Spectator::Formatting
# 8. `#start_dump` # 8. `#start_dump`
# 9. `#dump_pending` # 9. `#dump_pending`
# 10. `#dump_failures` # 10. `#dump_failures`
# 11. `#dump_summary` # 11. `#dump_profile`
# 12. `#dump_profile` # 12. `#dump_summary`
# 13. `#close` # 13. `#close`
# #
# Only one of the `#example_passed`, `#example_pending`, or `#example_failed` methods # Only one of the `#example_passed`, `#example_pending`, or `#example_failed` methods
@ -107,18 +107,18 @@ module Spectator::Formatting
def dump_failures(_notification) def dump_failures(_notification)
end end
# Invoked after testing completes with summarized information from the test suite.
# Called after `#dump_failures` and before `#dump_profile`.
# The *notification* will be an `SummaryNotification` type of object.
def dump_summary(_notification)
end
# Invoked after testing completes with profiling information. # Invoked after testing completes with profiling information.
# This method is only called if profiling is enabled. # This method is only called if profiling is enabled.
# Called after `#dump_summary` and before `#close`. # Called after `#dump_failures` and before `#dump_summary`.
def dump_profile(_notification) def dump_profile(_notification)
end end
# Invoked after testing completes with summarized information from the test suite.
# Called after `#dump_profile` and before `#close`.
# The *notification* will be an `SummaryNotification` type of object.
def dump_summary(_notification)
end
# Invoked at the end of the program. # Invoked at the end of the program.
# Allows the formatter to perform any cleanup and teardown. # Allows the formatter to perform any cleanup and teardown.
def close def close

View file

@ -45,6 +45,12 @@ module Spectator::Formatting
end end
end end
# Invoked after testing completes with profiling information.
# This method is only called if profiling is enabled.
# Called after `#dump_failures` and before `#dump_summary`.
def dump_profile(_notification)
end
# Invoked after testing completes with summarized information from the test suite. # Invoked after testing completes with summarized information from the test suite.
# Called after `#dump_failures` and before `#dump_profile`. # Called after `#dump_failures` and before `#dump_profile`.
def dump_summary(notification) def dump_summary(notification)
@ -55,11 +61,5 @@ module Spectator::Formatting
io.puts Components::FailureCommandList.new(failures) io.puts Components::FailureCommandList.new(failures)
end end
# Invoked after testing completes with profiling information.
# This method is only called if profiling is enabled.
# Called after `#dump_summary` and before `#close`.
def dump_profile(_notification)
end
end end
end end

View file

@ -45,10 +45,10 @@ module Spectator
notification = Formatting::ExampleSummaryNotification.new(report.failures) notification = Formatting::ExampleSummaryNotification.new(report.failures)
formatter.dump_failures(notification) formatter.dump_failures(notification)
formatter.dump_profile(nil)
notification = Formatting::SummaryNotification.new(report) notification = Formatting::SummaryNotification.new(report)
formatter.dump_summary(notification) formatter.dump_summary(notification)
formatter.dump_profile(nil)
end end
# Triggers the 'close' event. # Triggers the 'close' event.