mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Rename TestSuiteResults to Report
This commit is contained in:
parent
3d67c45a22
commit
eef1062775
5 changed files with 21 additions and 21 deletions
|
@ -16,16 +16,16 @@ module Spectator::Formatters
|
|||
def start_suite
|
||||
end
|
||||
|
||||
def end_suite(results : TestSuiteResults)
|
||||
def end_suite(report : Report)
|
||||
puts
|
||||
puts
|
||||
display_failures(results)
|
||||
display_errors(results)
|
||||
display_summary(results)
|
||||
display_failures(report)
|
||||
display_errors(report)
|
||||
display_summary(report)
|
||||
end
|
||||
|
||||
private def display_failures(results)
|
||||
failures = results.failures
|
||||
private def display_failures(report)
|
||||
failures = report.failures
|
||||
if failures.any?
|
||||
puts "Failures:"
|
||||
puts
|
||||
|
@ -46,12 +46,12 @@ module Spectator::Formatters
|
|||
puts
|
||||
end
|
||||
|
||||
private def display_errors(results)
|
||||
private def display_errors(report)
|
||||
end
|
||||
|
||||
private def display_summary(results)
|
||||
puts finish_time_string(results)
|
||||
puts result_string(results)
|
||||
private def display_summary(report)
|
||||
puts finish_time_string(report)
|
||||
puts result_string(report)
|
||||
end
|
||||
|
||||
def start_example(example : Example)
|
||||
|
@ -74,15 +74,15 @@ module Spectator::Formatters
|
|||
end
|
||||
end
|
||||
|
||||
private def finish_time_string(results)
|
||||
"Finished in #{human_time(results.runtime)}"
|
||||
private def finish_time_string(report)
|
||||
"Finished in #{human_time(report.runtime)}"
|
||||
end
|
||||
|
||||
private def result_string(results)
|
||||
examples = results.examples
|
||||
failures = results.failed_examples
|
||||
errors = results.errored_examples
|
||||
pending = results.pending_examples
|
||||
private def result_string(report)
|
||||
examples = report.examples
|
||||
failures = report.failed_examples
|
||||
errors = report.errored_examples
|
||||
pending = report.pending_examples
|
||||
string = "#{examples} examples, #{failures} failures, #{errors} errors, #{pending} pending"
|
||||
if failures > 0 || errors > 0
|
||||
string.colorize(FAILURE_COLOR)
|
||||
|
|
|
@ -14,7 +14,7 @@ module Spectator::Formatters
|
|||
|
||||
# Called when a test suite finishes.
|
||||
# The results from the entire suite are provided.
|
||||
abstract def end_suite(results : TestSuiteResults)
|
||||
abstract def end_suite(report : Report)
|
||||
|
||||
# Called before a test starts.
|
||||
abstract def start_example(example : Example)
|
||||
|
|
|
@ -32,7 +32,7 @@ require "./command_line_arguments_config_source"
|
|||
require "./example_failed"
|
||||
require "./expectation_failed"
|
||||
require "./test_suite"
|
||||
require "./test_suite_results"
|
||||
require "./report"
|
||||
require "./runner"
|
||||
|
||||
require "./result"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module Spectator
|
||||
# Outcome of all tests in a suite.
|
||||
class TestSuiteResults
|
||||
class Report
|
||||
getter runtime : Time::Span
|
||||
|
||||
@results : Array(Result)
|
|
@ -12,7 +12,7 @@ module Spectator
|
|||
run_example(example).as(Result)
|
||||
end
|
||||
end
|
||||
@config.formatter.end_suite(TestSuiteResults.new(results, elapsed))
|
||||
@config.formatter.end_suite(Report.new(results, elapsed))
|
||||
end
|
||||
|
||||
private def run_example(example) : Result
|
||||
|
|
Loading…
Reference in a new issue