mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
25 lines
522 B
Crystal
25 lines
522 B
Crystal
module Spectator
|
|
# Type dedicated to matching everything.
|
|
# This is intended to be used as a value to compare against when the value doesn't matter.
|
|
# Can be used like so:
|
|
# ```
|
|
# anything = Spectator::Anything.new
|
|
# expect("foo").to match(anything)
|
|
# ```
|
|
struct Anything
|
|
# Always returns true.
|
|
def ===(other)
|
|
true
|
|
end
|
|
|
|
# Displays "anything".
|
|
def to_s(io)
|
|
io << "anything"
|
|
end
|
|
|
|
# Displays "<anything>".
|
|
def inspect(io)
|
|
io << "<anything>"
|
|
end
|
|
end
|
|
end
|