Skip to content

Commit

Permalink
fix mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
everdance authored and glesica committed Jul 12, 2019
1 parent 1bb3d5a commit 221dbe5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mock/mock.go
Expand Up @@ -350,6 +350,7 @@ func (m *Mock) MethodCalled(methodName string, arguments ...interface{}) Argumen
if found < 0 {
// expected call found but it has already been called with repeatable times
if call != nil {
m.mutex.Unlock()
m.fail("\nassert: mock: The method has been called over %d times.\n\tEither do one more Mock.On(\"%s\").Return(...), or remove extra call.\n\tThis call was unexpected:\n\t\t%s\n\tat: %s", call.totalCalls, methodName, callString(methodName, arguments, true), assert.CallerInfo())
}
// we have to fail here - because we don't know what to do
Expand Down

0 comments on commit 221dbe5

Please sign in to comment.