shard-spectator/src/spectator/pass_result.cr

32 lines
598 B
Crystal
Raw Normal View History

2020-10-17 20:56:31 +00:00
require "./result"
module Spectator
# Outcome that indicates running an example was successful.
class PassResult < Result
# Calls the `pass` method on *visitor*.
def accept(visitor)
visitor.pass
end
2021-01-31 02:42:46 +00:00
# Calls the `pass` method on *visitor*.
def accept(visitor)
visitor.pass(yield self)
end
# Indicates whether the example passed.
def pass? : Bool
true
end
# Indicates whether the example failed.
def fail? : Bool
false
end
2020-10-17 20:56:31 +00:00
# One-word description of the result.
def to_s(io)
io << "pass"
end
end
end