align task with description

add a complete with message in case we need that
This commit is contained in:
Robin Olsen
2026-03-04 14:00:35 +01:00
parent cb10aeff6b
commit 77b38692c6
3 changed files with 41 additions and 9 deletions

View File

@@ -35,6 +35,14 @@ func (e *Expector) Complete() ValidationFeedback {
return e.ValidationFeedback
}
func (e *Expector) CompleteWithMessage(message string) ValidationFeedback {
e.Success = len(e.Errors()) == 0
if !e.Success {
e.Message = message
}
return e.ValidationFeedback
}
func (e *Expector) Fail(message string) ValidationFeedback {
e.Checks = append(e.Checks, NewCheck(message, false))
return e.ValidationFeedback