mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Rig up the harness
This commit is contained in:
parent
bfb133f44d
commit
f5317ecbd3
3 changed files with 4 additions and 5 deletions
|
@ -23,7 +23,7 @@ module Spectator::Expectations
|
|||
def to(matcher : Matchers::ValueMatcher(ExpectedType)) : Nil forall ExpectedType
|
||||
expectation = ValueExpectation.new(self, matcher)
|
||||
result = expectation.eval
|
||||
ExpectationRegistry.current.report(result)
|
||||
Internals::Harness.current.reporter.report(result)
|
||||
end
|
||||
|
||||
# Asserts that the `#actual` value *does not* match some criteria.
|
||||
|
@ -31,7 +31,7 @@ module Spectator::Expectations
|
|||
def to_not(matcher : Matchers::ValueMatcher(ExpectedType)) : Nil forall ExpectedType
|
||||
expectation = ValueExpectation.new(self, matcher)
|
||||
result = expectation.eval(true)
|
||||
ExpectationRegistry.current.report(result)
|
||||
Internals::Harness.current.reporter.report(result)
|
||||
end
|
||||
|
||||
# ditto
|
||||
|
|
|
@ -3,7 +3,6 @@ require "./example"
|
|||
module Spectator
|
||||
abstract class RunnableExample < Example
|
||||
def run
|
||||
Expectations::ExpectationRegistry.start(self)
|
||||
result = ResultCapture.new
|
||||
group.run_before_all_hooks
|
||||
group.run_before_each_hooks
|
||||
|
@ -14,7 +13,7 @@ module Spectator
|
|||
group.run_after_each_hooks
|
||||
group.run_after_all_hooks
|
||||
end
|
||||
expectations = Expectations::ExpectationRegistry.finish
|
||||
expectations = Internals::Harness.current.reporter.results
|
||||
translate_result(result, expectations)
|
||||
end
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ module Spectator
|
|||
@formatter.start_suite
|
||||
results = @group.all_examples.map do |example|
|
||||
@formatter.start_example(example)
|
||||
example.run.tap do |result|
|
||||
Internals::Harness.run(example).tap do |result|
|
||||
@formatter.end_example(result)
|
||||
end.as(Result)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue