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

Method Return

mock/mock.go:108–115  ·  view source on GitHub ↗

Return specifies the return arguments for the expectation. Mock.On("DoSomething").Return(errors.New("failed"))

(returnArguments ...interface{})

Source from the content-addressed store, hash-verified

106//
107// Mock.On("DoSomething").Return(errors.New("failed"))
108func (c *Call) Return(returnArguments ...interface{}) *Call {
109 c.lock()
110 defer c.unlock()
111
112 c.ReturnArguments = returnArguments
113
114 return c
115}
116
117// Panic specifies if the function call should fail and the panic message
118//

Calls 2

lockMethod · 0.95
unlockMethod · 0.95