Move harness out of internals

This commit is contained in:
Michael Miller 2019-09-26 15:11:54 -06:00
parent 0067191423
commit 7e6080aa5f
4 changed files with 6 additions and 6 deletions

View File

@ -40,7 +40,7 @@ module Spectator::Expectations
# Reports an expectation to the current harness.
private def report(match_data : Matchers::MatchData)
expectation = Expectation.new(match_data, @source)
Internals::Harness.current.report_expectation(expectation)
Harness.current.report_expectation(expectation)
end
end
end

View File

@ -1,4 +1,4 @@
module Spectator::Internals
module Spectator
# Helper class that acts as a gateway between example code and the test framework.
# Every example must be invoked by passing it to `#run`.
# This sets up the harness so that the example code can use it.
@ -9,7 +9,7 @@ module Spectator::Internals
# ```
# Then from the example code, the harness can be accessed via `#current` like so:
# ```
# harness = ::Spectator::Internals::Harness.current
# harness = ::Spectator::Harness.current
# # Do something with the harness.
# ```
# Of course, the end-user shouldn't see this or work directly with the harness.

View File

@ -8,7 +8,7 @@ module Spectator
# and translates to a usable result.
def run_impl : Result
result = capture_result
expectations = Internals::Harness.current.expectations
expectations = Harness.current.expectations
translate_result(result, expectations)
end

View File

@ -1,4 +1,4 @@
require "./internals/harness"
require "./harness"
module Spectator
# Main driver for executing tests and feeding results to formatters.
@ -59,7 +59,7 @@ module Spectator
result = if @config.dry_run? && example.is_a?(RunnableExample)
dry_run_result(example)
else
Internals::Harness.run(example)
Harness.run(example)
end
@config.each_formatter(&.end_example(result))
result