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`
# 9. `#dump_pending`
# 10. `#dump_failures`
# 11. `#dump_summary`
# 12. `#dump_profile`
# 11. `#dump_profile`
# 12. `#dump_summary`
# 13. `#close`
#
# Only one of the `#example_passed`, `#example_pending`, or `#example_failed` methods
@ -107,18 +107,18 @@ module Spectator::Formatting
def dump_failures(_notification)
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.
# 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)
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.
# Allows the formatter to perform any cleanup and teardown.
def close

View file

@ -45,6 +45,12 @@ module Spectator::Formatting
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.
# Called after `#dump_failures` and before `#dump_profile`.
def dump_summary(notification)
@ -55,11 +61,5 @@ module Spectator::Formatting
io.puts Components::FailureCommandList.new(failures)
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

View file

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