mirror of
https://github.com/stretchr/testify.git
synced 2025-05-07 07:59:57 +00:00
Merge pull request #147 from multiplay/master
Fix race condition with ExpectedCalls
This commit is contained in:
commit
93a84c883d
@ -112,6 +112,9 @@ func (m *Mock) On(methodName string, arguments ...interface{}) *Mock {
|
||||
//
|
||||
// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2)
|
||||
func (m *Mock) Return(returnArguments ...interface{}) *Mock {
|
||||
m.mutex.Lock()
|
||||
defer m.mutex.Unlock()
|
||||
|
||||
m.ExpectedCalls = append(m.ExpectedCalls, Call{m.onMethodName, m.onMethodArguments, returnArguments, 0, nil, nil})
|
||||
return m
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user