mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Move characters to a named tuple
This commit is contained in:
parent
bd500b0799
commit
9c16a5a53e
1 changed files with 12 additions and 4 deletions
|
@ -9,6 +9,14 @@ module Spectator::Formatters
|
||||||
class DotsFormatter < Formatter
|
class DotsFormatter < Formatter
|
||||||
include SuiteSummary
|
include SuiteSummary
|
||||||
|
|
||||||
|
# Characters for each of the result types.
|
||||||
|
private CHARACTERS = {
|
||||||
|
success: '.',
|
||||||
|
failure: 'F',
|
||||||
|
error: 'E',
|
||||||
|
pending: '*',
|
||||||
|
}
|
||||||
|
|
||||||
# Creates the formatter.
|
# Creates the formatter.
|
||||||
# By default, output is sent to `STDOUT`.
|
# By default, output is sent to `STDOUT`.
|
||||||
def initialize(@io : IO = STDOUT)
|
def initialize(@io : IO = STDOUT)
|
||||||
|
@ -30,22 +38,22 @@ module Spectator::Formatters
|
||||||
|
|
||||||
# Character output for a successful example.
|
# Character output for a successful example.
|
||||||
def success(result)
|
def success(result)
|
||||||
Color.success('.')
|
Color.success(CHARACTERS[:success])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Character output for a failed example.
|
# Character output for a failed example.
|
||||||
def failure(result)
|
def failure(result)
|
||||||
Color.failure('F')
|
Color.failure(CHARACTERS[:failure])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Character output for an errored example.
|
# Character output for an errored example.
|
||||||
def error(result)
|
def error(result)
|
||||||
Color.error('E')
|
Color.error(CHARACTERS[:error])
|
||||||
end
|
end
|
||||||
|
|
||||||
# Character output for a pending or skipped example.
|
# Character output for a pending or skipped example.
|
||||||
def pending(result)
|
def pending(result)
|
||||||
Color.pending('*')
|
Color.pending(CHARACTERS[:pending])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue