mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add be_an
variation of be_a
This commit is contained in:
parent
6a91b3e399
commit
154832e5c4
1 changed files with 14 additions and 0 deletions
|
@ -75,6 +75,20 @@ module Spectator::DSL
|
|||
::Spectator::Matchers::TypeMatcher({{expected}}).new
|
||||
end
|
||||
|
||||
# Indicates that some value should be of a specified type.
|
||||
# The `#is_a?` method is used for this check.
|
||||
# A type name or type union should be used for `expected`.
|
||||
# This method is identical to `#be_a`,
|
||||
# and exists just to improve grammar.
|
||||
#
|
||||
# Examples:
|
||||
# ```
|
||||
# expect(123).to be_an(Int32)
|
||||
# ```
|
||||
macro be_an(expected)
|
||||
be_a({{expected}})
|
||||
end
|
||||
|
||||
# Indicates that some value should be less than another.
|
||||
# The `<` operator is used for this check.
|
||||
# The value passed to this method is the value expected to be larger.
|
||||
|
|
Loading…
Reference in a new issue