MCPcopy
hub / github.com/stretchr/testify / NotBefore

Method NotBefore

mock/mock.go:269–281  ·  view source on GitHub ↗

NotBefore indicates that the mock should only be called after the referenced calls have been called as expected. The referenced calls may be from the same mock instance and/or other mock instances. Mock.On("Do").Return(nil).NotBefore( Mock.On("Init").Return(nil) )

(calls ...*Call)

Source from the content-addressed store, hash-verified

267// Mock.On("Init").Return(nil)
268// )
269func (c *Call) NotBefore(calls ...*Call) *Call {
270 c.lock()
271 defer c.unlock()
272
273 for _, call := range calls {
274 if call.Parent == nil {
275 panic("not before calls must be created with Mock.On()")
276 }
277 }
278
279 c.requires = append(c.requires, calls...)
280 return c
281}
282
283// InOrder defines the order in which the calls should be made
284//

Calls 2

lockMethod · 0.95
unlockMethod · 0.95