Skip to content

Commit c530fb3

Browse files
committed
improve eventually failure message output
1 parent 21f3090 commit c530fb3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

internal/async_assertion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ func (assertion *AsyncAssertion) match(matcher types.GomegaMatcher, desiredMatch
446446
message += renderError(fmt.Sprintf("The function passed to %s returned the following error:", assertion.asyncType), actualErr)
447447
}
448448
if hasLastValidActual {
449-
message += fmt.Sprintf("\nAt one point, however, the function did return successfully. But %s failed because", assertion.asyncType)
449+
message += fmt.Sprintf("\nAt one point, however, the function did return successfully.\nYet, %s failed because", assertion.asyncType)
450450
_, e := matcher.Match(lastValidActual)
451451
if e != nil {
452452
message += renderError(" the matcher returned the following error:", e)

internal/async_assertion_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ var _ = Describe("Asynchronous Assertions", func() {
756756
}).WithTimeout(100 * time.Millisecond).WithPolling(10 * time.Millisecond).Should(Equal(10))
757757
Ω(ig.FailureMessage).Should(ContainSubstring("The function passed to Eventually failed at %s:%d with:\nExpected\n <int>: ", file, line+3))
758758
Ω(ig.FailureMessage).Should(ContainSubstring("to be <\n <int>: 3"))
759-
Ω(ig.FailureMessage).Should(ContainSubstring("At one point, however, the function did return successfully. But Eventually failed because the matcher was not satisfied:\nExpected\n <int>: 2\nto equal\n <int>: 10"))
759+
Ω(ig.FailureMessage).Should(ContainSubstring("At one point, however, the function did return successfully.\nYet, Eventually failed because the matcher was not satisfied:\nExpected\n <int>: 2\nto equal\n <int>: 10"))
760760
})
761761
})
762762

@@ -1445,7 +1445,7 @@ sprocket:
14451445

14461446
Ω(ig.FailureMessage).Should(ContainSubstring("Timed out after"))
14471447
Ω(ig.FailureMessage).Should(ContainSubstring("told to try again after 10s: bam"))
1448-
Ω(ig.FailureMessage).Should(ContainSubstring("At one point, however, the function did return successfully. But Eventually failed because the matcher was not satisfied:\nExpected\n <int>: 2\nto equal\n <int>: 4"))
1448+
Ω(ig.FailureMessage).Should(ContainSubstring("At one point, however, the function did return successfully.\nYet, Eventually failed because the matcher was not satisfied:\nExpected\n <int>: 2\nto equal\n <int>: 4"))
14491449
})
14501450
})
14511451

@@ -1592,7 +1592,7 @@ sprocket:
15921592
return false, nil
15931593
}), "My Description")
15941594
Ω(ig.FailureMessage).Should(ContainSubstring("My Description\nThe function passed to Eventually returned the following error:\nactual-err\n <*errors.errorString"))
1595-
Ω(ig.FailureMessage).Should(ContainSubstring("At one point, however, the function did return successfully. But Eventually failed because the matcher returned the following error:\nmatcher-err"))
1595+
Ω(ig.FailureMessage).Should(ContainSubstring("At one point, however, the function did return successfully.\nYet, Eventually failed because the matcher returned the following error:\nmatcher-err"))
15961596
})
15971597
})
15981598

@@ -1611,7 +1611,7 @@ sprocket:
16111611
return actualInt > 3, nil
16121612
}), "My Description")
16131613
Ω(ig.FailureMessage).Should(ContainSubstring("My Description\nThe function passed to Eventually returned the following error:\nactual-err\n <*errors.errorString"))
1614-
Ω(ig.FailureMessage).Should(ContainSubstring("At one point, however, the function did return successfully. But Eventually failed because the matcher was not satisfied:\nQM failure message: 3"))
1614+
Ω(ig.FailureMessage).Should(ContainSubstring("At one point, however, the function did return successfully.\nYet, Eventually failed because the matcher was not satisfied:\nQM failure message: 3"))
16151615

16161616
})
16171617
})

0 commit comments

Comments
 (0)