mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Split error handler from failure method
This commit is contained in:
parent
a36982d6d6
commit
e2f4051927
2 changed files with 11 additions and 3 deletions
|
@ -63,11 +63,19 @@ module Spectator::Formatting
|
||||||
|
|
||||||
# Invoked after an example fails.
|
# Invoked after an example fails.
|
||||||
# This is called right after `#example_finished`.
|
# This is called right after `#example_finished`.
|
||||||
# Errors are considered failures and will cause this method to be called.
|
|
||||||
# The *notification* will be an `ExampleNotification` type of object.
|
# The *notification* will be an `ExampleNotification` type of object.
|
||||||
|
#
|
||||||
|
# NOTE: Errors are normally considered failures,
|
||||||
|
# however `#example_error` is called instead if one occurs in an exmaple.
|
||||||
def example_failed(_notification)
|
def example_failed(_notification)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Invoked after an example fails from an unexpected error.
|
||||||
|
# This is called right after `#example_finished`.
|
||||||
|
# The *notification* will be an `ExampleNotification` type of object.
|
||||||
|
def example_error(_notification)
|
||||||
|
end
|
||||||
|
|
||||||
# Called whenever the example or framework produces a message.
|
# Called whenever the example or framework produces a message.
|
||||||
# This is typically used for logging.
|
# This is typically used for logging.
|
||||||
def message(_notification)
|
def message(_notification)
|
||||||
|
|
|
@ -58,9 +58,9 @@ module Spectator
|
||||||
@formatter.example_failed(@notification)
|
@formatter.example_failed(@notification)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Invokes the example failed method.
|
# Invokes the example error method.
|
||||||
def error
|
def error
|
||||||
@formatter.example_failed(@notification)
|
@formatter.example_error(@notification)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Invokes the example pending method.
|
# Invokes the example pending method.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue