mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Rename module from Formatters to Formatting
This commit is contained in:
parent
80150f945b
commit
daf2f43f25
19 changed files with 23 additions and 23 deletions
|
@ -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"},
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
|
@ -1,6 +1,6 @@
|
|||
require "colorize"
|
||||
|
||||
module Spectator::Formatters
|
||||
module Spectator::Formatting
|
||||
# Method for colorizing output.
|
||||
module Color
|
||||
extend self
|
|
@ -1,4 +1,4 @@
|
|||
module Spectator::Formatters
|
||||
module Spectator::Formatting
|
||||
# Produces a stringified comment for output.
|
||||
private struct Comment(T)
|
||||
# Creates the comment.
|
|
@ -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.
|
|
@ -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:
|
|
@ -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.
|
|
@ -1,4 +1,4 @@
|
|||
module Spectator::Formatters
|
||||
module Spectator::Formatting
|
||||
# Produces a stringified failure or error message.
|
||||
private struct FailureMessage
|
||||
# Creates the failure message.
|
|
@ -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:
|
|
@ -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.
|
|
@ -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.
|
|
@ -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.
|
|
@ -1,4 +1,4 @@
|
|||
module Spectator::Formatters
|
||||
module Spectator::Formatting
|
||||
# Formatter that outputs nothing.
|
||||
# Useful for testing and larger automated processes.
|
||||
class SilentFormatter < Formatter
|
|
@ -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.
|
|
@ -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.
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue