Add be_an variation of be_a

This commit is contained in:
Michael Miller 2019-01-25 11:21:41 -07:00
parent 6a91b3e399
commit 154832e5c4

View file

@ -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.