Rename module from Formatters to Formatting

This commit is contained in:
Michael Miller 2019-02-28 19:14:03 -07:00
parent 80150f945b
commit daf2f43f25
19 changed files with 23 additions and 23 deletions

View file

@ -1,6 +1,6 @@
# Formatter that doubles as a spy.
# This class tracks calls made to it.
class SpyFormatter < Spectator::Formatters::Formatter
class SpyFormatter < Spectator::Formatting::Formatter
{% for item in [
{"start_suite", "Spectator::TestSuite"},
{"end_suite", "Spectator::Report"},

View file

@ -1,8 +1,8 @@
require "./spec_helper"
# Creates a `Config` for Spectator that is suited for testing it.
def spectator_test_config(formatter : Spectator::Formatters::Formatter? = nil)
Spectator::Config.new(formatter || Spectator::Formatters::SilentFormatter.new)
def spectator_test_config(formatter : Spectator::Formatting::Formatter? = nil)
Spectator::Config.new(formatter || Spectator::Formatting::SilentFormatter.new)
end
def new_test_suite

View file

@ -2,7 +2,7 @@ module Spectator
# Provides customization and describes specifics for how Spectator will run and report tests.
class Config
# Used to report test progress and results.
getter formatter : Formatters::Formatter
getter formatter : Formatting::Formatter
# Creates a new configuration.
def initialize(@formatter)

View file

@ -8,10 +8,10 @@ module Spectator
new.build
end
@formatter : Formatters::Formatter? = nil
@formatter : Formatting::Formatter? = nil
# Sets the formatter to use for reporting test progress and results.
def formatter=(formatter : Formatters::Formatter)
def formatter=(formatter : Formatting::Formatter)
@formatter = formatter
end
@ -25,7 +25,7 @@ module Spectator
# The formatter that should be used,
# if one wasn't provided.
private def default_formatter
Formatters::DotsFormatter.new
Formatting::DotsFormatter.new
end
# Creates a configuration.

View file

@ -1,7 +1,7 @@
require "./formatters/*"
require "./formatting/*"
module Spectator
# Reports test results to the end-user in various formats.
module Formatters
module Formatting
end
end

View file

@ -1,6 +1,6 @@
require "colorize"
module Spectator::Formatters
module Spectator::Formatting
# Method for colorizing output.
module Color
extend self

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# Produces a stringified comment for output.
private struct Comment(T)
# Creates the comment.

View file

@ -1,7 +1,7 @@
require "./formatter"
require "./suite_summary"
module Spectator::Formatters
module Spectator::Formatting
# Produces a single character for each example.
# A dot is output for each successful example (hence the name).
# Other characters are output for non-successful results.

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# Constructs a block of text containing information about a failed example.
#
# A failure block takes the form:

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# Produces a stringified command to run a failed test.
private struct FailureCommand
# Creates the failure command.

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# Produces a stringified failure or error message.
private struct FailureMessage
# Creates the failure message.

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# Interface for reporting test progress and results.
#
# The methods should be called in this order:

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# A single key-value pair from the `Spectator::Matchers::MatchData#value` method.
private struct MatchDataValuePair(T)
# Creates the pair formatter.

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# Produces a stringified value with a numerical prefix.
private struct NumberedItem(T)
# Creates the numbered item.

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# Produces a stringified time span for the runtime.
private struct Runtime
# Creates the runtime instance.

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# Formatter that outputs nothing.
# Useful for testing and larger automated processes.
class SilentFormatter < Formatter

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# Produces a stringified stats counter from result totals.
private struct StatsCounter
# Creates the instance with each of the counters.

View file

@ -1,4 +1,4 @@
module Spectator::Formatters
module Spectator::Formatting
# Mix-in for producing a human-readable summary of a test suite.
module SuiteSummary
# Does nothing when starting a test suite.

View file

@ -9,7 +9,7 @@ require "./internals"
require "./dsl"
require "./expectations"
require "./matchers"
require "./formatters"
require "./formatting"
# Then all of the top-level types.
require "./example_component"