Formatting

This commit is contained in:
Michael Miller 2021-05-15 19:45:17 -06:00
parent eebcba0749
commit aa03e3527d
No known key found for this signature in database
GPG key ID: F9A0C5C65B162436

View file

@ -16,7 +16,7 @@ module Spectator
# This runner will run each example in the order provided. # This runner will run each example in the order provided.
# The *formatter* will be called for various events. # The *formatter* will be called for various events.
def initialize(@examples : Enumerable(Example), def initialize(@examples : Enumerable(Example),
@formatter : Formatting::Formatter, @run_flags = RunFlags::None) @formatter : Formatting::Formatter, @run_flags = RunFlags::None)
end end
# Runs the spec. # Runs the spec.
@ -33,6 +33,7 @@ module Spectator
# TODO: Generate a report and pass it along to the formatter. # TODO: Generate a report and pass it along to the formatter.
false # TODO: Report real result false # TODO: Report real result
ensure ensure
close close
end end
@ -57,10 +58,10 @@ module Spectator
private def run_example(example) private def run_example(example)
example_started(example) example_started(example)
result = if dry_run? result = if dry_run?
dry_run_result dry_run_result
else else
example.run example.run
end end
example_finished(example) example_finished(example)
result result
end end