mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add should_eventually and should_never methods
This commit is contained in:
parent
a80d018ff6
commit
173f7bfa13
1 changed files with 12 additions and 0 deletions
|
@ -33,6 +33,18 @@ class Object
|
|||
source = ::Spectator::Source.new(__FILE__, __LINE__)
|
||||
::Spectator::Expectations::ExpectationPartial.new(actual, source).to_not(matcher)
|
||||
end
|
||||
|
||||
# Works the same as `#should` except that the condition check is postphoned.
|
||||
# The expectation is checked after the example finishes and all hooks have run.
|
||||
def should_eventually(matcher)
|
||||
::Spectator::Harness.current.defer { should(matcher) }
|
||||
end
|
||||
|
||||
# Works the same as `#should_not` except that the condition check is postphoned.
|
||||
# The expectation is checked after the example finishes and all hooks have run.
|
||||
def should_never(matcher)
|
||||
::Spectator::Harness.current.defer { should_not(matcher) }
|
||||
end
|
||||
end
|
||||
|
||||
struct Proc(*T, R)
|
||||
|
|
Loading…
Reference in a new issue