mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add #be_true and #be_false to DSL
This commit is contained in:
parent
0af3efea2a
commit
429c2d7302
1 changed files with 22 additions and 0 deletions
|
@ -57,5 +57,27 @@ module Spectator::DSL
|
|||
macro match(expected)
|
||||
::Spectator::Matchers::RegexMatcher.new({{expected.stringify}}, {{expected}})
|
||||
end
|
||||
|
||||
# Indicates that some value should be true.
|
||||
#
|
||||
# Examples:
|
||||
# ```
|
||||
# expect(nil.nil?).to be_true
|
||||
# expect(%i[a b c].any?).to be_true
|
||||
# ```
|
||||
macro be_true
|
||||
eq(true)
|
||||
end
|
||||
|
||||
# Indicates that some value should be false.
|
||||
#
|
||||
# Examples:
|
||||
# ```
|
||||
# expect("foo".nil?).to be_false
|
||||
# expect(%i[a b c].empty?).to be_false
|
||||
# ```
|
||||
macro be_false
|
||||
eq(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue