franela/goblin

Allow multiple `errors` from failed test

schmurfy opened this issue · 2 comments

I realized after #85 that I made a false assumption: I though multiple messages could be displayed but as it turns ou only one failure can be stored for each test.

The issue is that gomock does that:

failures := ctrl.expectedCalls.Failures()
for _, call := range failures {
  ctrl.T.Errorf("missing call(s) to %v", call)
}
if len(failures) != 0 {
  ctrl.T.Fatalf("aborting test due to missing call(s)")
}

With the Errorf methods introduced by the original testify patch each successive call to Errorf and then Fatalf overwrite the previous one.

Adding support for multiple erros would allow logging non fatal errors like this:

g.Errrof("this should take less than 10ms")
g.Fatalf("X is different than 10")

I can give it a try but is that something that could be merged ?

@marcosnils Do you have any opinion on this ?

Hello, this is still an issue for me, so... any opinions ?