Add should keywords to examples

Allows short-hand like:
it { should be_empty }
This commit is contained in:
Michael Miller 2020-01-19 22:12:06 -07:00
parent 8381c08b05
commit b1984b343a
2 changed files with 19 additions and 4 deletions

View file

@ -184,6 +184,22 @@ module Spectator
is_expected.to_not eq({{expected}})
end
macro should(matcher)
is_expected.to({{matcher}})
end
macro should_not(matcher)
is_expected.to_not({{matcher}})
end
macro should_eventuall(matcher)
is_expected.to_eventually({{matcher}})
end
macro should_never(matcher)
is_expected.to_never({{matcher}})
end
# Immediately fail the current test.
# A reason can be passed,
# which is reported in the output.