check for field to be nil, not function - fixes #4
This commit is contained in:
parent
b082cf0fd0
commit
b050476316
@ -217,7 +217,7 @@ type {{.InterfaceName}}Mock struct {
|
|||||||
{{ range .Methods }}
|
{{ range .Methods }}
|
||||||
// {{.Name}} calls {{.Name}}Func.
|
// {{.Name}} calls {{.Name}}Func.
|
||||||
func (mock *{{$obj.InterfaceName}}Mock) {{.Name}}({{.Arglist}}) {{.ReturnArglist}} {
|
func (mock *{{$obj.InterfaceName}}Mock) {{.Name}}({{.Arglist}}) {{.ReturnArglist}} {
|
||||||
if mock.{{.Name}} == nil {
|
if mock.{{.Name}}Func == nil {
|
||||||
panic("moq: {{.Name}}Func is nil but was just called")
|
panic("moq: {{.Name}}Func is nil but was just called")
|
||||||
}
|
}
|
||||||
return mock.{{.Name}}Func({{.ArgCallList}})
|
return mock.{{.Name}}Func({{.ArgCallList}})
|
||||||
|
Loading…
Reference in New Issue
Block a user