mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add to_eventually and to_never operations
This defines what they should look like.
This commit is contained in:
parent
3666b0e02f
commit
bd0396c001
1 changed files with 18 additions and 0 deletions
|
@ -37,6 +37,24 @@ module Spectator::Expectations
|
||||||
to_not(matcher)
|
to_not(matcher)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Asserts that some criteria defined by the matcher is eventually satisfied.
|
||||||
|
# The expectation is checked after the example finishes and all hooks have run.
|
||||||
|
def to_eventually(matcher) : Nil
|
||||||
|
Harness.current.defer { to(matcher) }
|
||||||
|
end
|
||||||
|
|
||||||
|
# Asserts that some criteria defined by the matcher is never satisfied.
|
||||||
|
# The expectation is checked after the example finishes and all hooks have run.
|
||||||
|
def to_never(matcher) : Nil
|
||||||
|
Harness.current.defer { to_not(matcher) }
|
||||||
|
end
|
||||||
|
|
||||||
|
# ditto
|
||||||
|
@[AlwaysInline]
|
||||||
|
def never_to(matcher) : Nil
|
||||||
|
to_never(matcher)
|
||||||
|
end
|
||||||
|
|
||||||
# Reports an expectation to the current harness.
|
# Reports an expectation to the current harness.
|
||||||
private def report(match_data : Matchers::MatchData)
|
private def report(match_data : Matchers::MatchData)
|
||||||
expectation = Expectation.new(match_data, @source)
|
expectation = Expectation.new(match_data, @source)
|
||||||
|
|
Loading…
Reference in a new issue