mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Add kind_of aliases for be_a matcher
This commit is contained in:
parent
2538f3a9a4
commit
c3688807d4
1 changed files with 28 additions and 0 deletions
|
@ -94,6 +94,34 @@ module Spectator
|
||||||
be_a({{expected}})
|
be_a({{expected}})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Indicates that some value should be of a specified type.
|
||||||
|
# The `Object#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_kind_of(Int)
|
||||||
|
# ```
|
||||||
|
macro be_kind_of(expected)
|
||||||
|
be_a({{expected}})
|
||||||
|
end
|
||||||
|
|
||||||
|
# Indicates that some value should be of a specified type.
|
||||||
|
# The `Object#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_a_kind_of(Int)
|
||||||
|
# ```
|
||||||
|
macro be_a_kind_of(expected)
|
||||||
|
be_a({{expected}})
|
||||||
|
end
|
||||||
|
|
||||||
# Indicates that some value should respond to a method call.
|
# Indicates that some value should respond to a method call.
|
||||||
# One or more method names can be provided.
|
# One or more method names can be provided.
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue