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. # Formatter that doubles as a spy.
# This class tracks calls made to it. # This class tracks calls made to it.
class SpyFormatter < Spectator::Formatters::Formatter class SpyFormatter < Spectator::Formatting::Formatter
{% for item in [ {% for item in [
{"start_suite", "Spectator::TestSuite"}, {"start_suite", "Spectator::TestSuite"},
{"end_suite", "Spectator::Report"}, {"end_suite", "Spectator::Report"},

View file

@ -1,8 +1,8 @@
require "./spec_helper" require "./spec_helper"
# Creates a `Config` for Spectator that is suited for testing it. # Creates a `Config` for Spectator that is suited for testing it.
def spectator_test_config(formatter : Spectator::Formatters::Formatter? = nil) def spectator_test_config(formatter : Spectator::Formatting::Formatter? = nil)
Spectator::Config.new(formatter || Spectator::Formatters::SilentFormatter.new) Spectator::Config.new(formatter || Spectator::Formatting::SilentFormatter.new)
end end
def new_test_suite 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. # Provides customization and describes specifics for how Spectator will run and report tests.
class Config class Config
# Used to report test progress and results. # Used to report test progress and results.
getter formatter : Formatters::Formatter getter formatter : Formatting::Formatter
# Creates a new configuration. # Creates a new configuration.
def initialize(@formatter) def initialize(@formatter)

View file

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

View file

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

View file

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

View file

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

View file

@ -1,7 +1,7 @@
require "./formatter" require "./formatter"
require "./suite_summary" require "./suite_summary"
module Spectator::Formatters module Spectator::Formatting
# Produces a single character for each example. # Produces a single character for each example.
# A dot is output for each successful example (hence the name). # A dot is output for each successful example (hence the name).
# Other characters are output for non-successful results. # 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. # Constructs a block of text containing information about a failed example.
# #
# A failure block takes the form: # 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. # Produces a stringified command to run a failed test.
private struct FailureCommand private struct FailureCommand
# Creates the failure command. # Creates the failure command.

View file

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

View file

@ -1,4 +1,4 @@
module Spectator::Formatters module Spectator::Formatting
# Interface for reporting test progress and results. # Interface for reporting test progress and results.
# #
# The methods should be called in this order: # 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. # A single key-value pair from the `Spectator::Matchers::MatchData#value` method.
private struct MatchDataValuePair(T) private struct MatchDataValuePair(T)
# Creates the pair formatter. # Creates the pair formatter.

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
module Spectator::Formatters module Spectator::Formatting
# Produces a stringified stats counter from result totals. # Produces a stringified stats counter from result totals.
private struct StatsCounter private struct StatsCounter
# Creates the instance with each of the counters. # 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. # Mix-in for producing a human-readable summary of a test suite.
module SuiteSummary module SuiteSummary
# Does nothing when starting a test suite. # Does nothing when starting a test suite.

View file

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