diff --git a/src/spectator/errored_result.cr b/src/spectator/errored_result.cr index fd06e67..b65e67e 100644 --- a/src/spectator/errored_result.cr +++ b/src/spectator/errored_result.cr @@ -17,5 +17,10 @@ module Spectator value = yield self interface.error(value) end + + # One-word descriptor of the result. + def to_s(io) + io << "error" + end end end diff --git a/src/spectator/failed_result.cr b/src/spectator/failed_result.cr index 7364c62..773778a 100644 --- a/src/spectator/failed_result.cr +++ b/src/spectator/failed_result.cr @@ -27,5 +27,10 @@ module Spectator value = yield self interface.failure(value) end + + # One-word descriptor of the result. + def to_s(io) + io << "fail" + end end end diff --git a/src/spectator/pending_result.cr b/src/spectator/pending_result.cr index 7e930c5..65512e9 100644 --- a/src/spectator/pending_result.cr +++ b/src/spectator/pending_result.cr @@ -16,5 +16,10 @@ module Spectator value = yield self interface.pending(value) end + + # One-word descriptor of the result. + def to_s(io) + io << "pending" + end end end diff --git a/src/spectator/successful_result.cr b/src/spectator/successful_result.cr index f590812..bd3f0ed 100644 --- a/src/spectator/successful_result.cr +++ b/src/spectator/successful_result.cr @@ -14,5 +14,10 @@ module Spectator value = yield self interface.success(value) end + + # One-word descriptor of the result. + def to_s(io) + io << "success" + end end end