shard-spectator/spec/helpers/result_call_spy.cr
2019-02-20 21:17:27 -07:00

16 lines
294 B
Crystal

# Spy class for testing `Spectator::Result#call`.
class ResultCallSpy
{% for name in %i[success failure error pending] %}
getter? {{name.id}} = false
def {{name.id}}
@{{name.id}} = true
{{name}}
end
def {{name.id}}(arg)
@{{name.id}} = true
arg
end
{% end %}
end