mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add a silent formatter
This commit is contained in:
parent
ff7fcc6a68
commit
142011a763
1 changed files with 27 additions and 0 deletions
27
src/spectator/formatters/silent_formatter.cr
Normal file
27
src/spectator/formatters/silent_formatter.cr
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
module Spectator::Formatters
|
||||||
|
# Formatter that outputs nothing.
|
||||||
|
# Useful for testing and larger automated processes.
|
||||||
|
class SilentFormatter < Formatter
|
||||||
|
# Called when a test suite is starting to execute.
|
||||||
|
def start_suite(suite : TestSuite)
|
||||||
|
# ... crickets ...
|
||||||
|
end
|
||||||
|
|
||||||
|
# Called when a test suite finishes.
|
||||||
|
# The results from the entire suite are provided.
|
||||||
|
def end_suite(report : Report)
|
||||||
|
# ... crickets ...
|
||||||
|
end
|
||||||
|
|
||||||
|
# Called before a test starts.
|
||||||
|
def start_example(example : Example)
|
||||||
|
# ... crickets ...
|
||||||
|
end
|
||||||
|
|
||||||
|
# Called when a test finishes.
|
||||||
|
# The result of the test is provided.
|
||||||
|
def end_example(result : Result)
|
||||||
|
# ... crickets ...
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue