mirror of https://github.com/stretchr/testify.git
Merge pull request #1360 from hikyaru-suzuki/feature/update_logging_output
mock: AssertExpectations log reason only on failurepull/1219/merge
commit
862e41010c
|
@ -606,9 +606,9 @@ func (m *Mock) AssertExpectations(t TestingT) bool {
|
|||
satisfied, reason := m.checkExpectation(expectedCall)
|
||||
if !satisfied {
|
||||
failedExpectations++
|
||||
}
|
||||
t.Logf(reason)
|
||||
}
|
||||
}
|
||||
|
||||
if failedExpectations != 0 {
|
||||
t.Errorf("FAIL: %d out of %d expectation(s) were met.\n\tThe code you are testing needs to make %d more call(s).\n\tat: %s", len(expectedCalls)-failedExpectations, len(expectedCalls), failedExpectations, assert.CallerInfo())
|
||||
|
|
Loading…
Reference in New Issue