Move characters constant to sub-module

This commit is contained in:
Michael Miller 2019-02-20 21:38:23 -07:00
parent e752f901a5
commit 0ca300ba89

View file

@ -9,14 +9,6 @@ module Spectator::Formatters
class DotsFormatter < Formatter
include SuiteSummary
# Characters for each of the result types.
private CHARACTERS = {
success: '.',
failure: 'F',
error: 'E',
pending: '*',
}
# Creates the formatter.
# By default, output is sent to STDOUT.
def initialize(@io : IO = STDOUT)
@ -36,6 +28,14 @@ module Spectator::Formatters
private module Character
extend self
# Characters for each of the result types.
private CHARACTERS = {
success: '.',
failure: 'F',
error: 'E',
pending: '*',
}
# Character output for a successful example.
def success
Color.success(CHARACTERS[:success])