improved output
This commit is contained in:
parent
6a2af83edc
commit
da0b19b274
@ -10,6 +10,6 @@ type Person struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type PersonStore interface {
|
type PersonStore interface {
|
||||||
Get(context.Context, string) (*Person, error)
|
Get(ctx context.Context, id string) (*Person, error)
|
||||||
Create(ctx context.Context, person *Person, confirm bool) error
|
Create(ctx context.Context, person *Person, confirm bool) error
|
||||||
}
|
}
|
||||||
|
@ -161,6 +161,20 @@ package todo
|
|||||||
// github.com/matryer/moq
|
// github.com/matryer/moq
|
||||||
{{ range .Objs }}
|
{{ range .Objs }}
|
||||||
// {{.Name}}Mock is a mock implementation of {{.Name}}.
|
// {{.Name}}Mock is a mock implementation of {{.Name}}.
|
||||||
|
//
|
||||||
|
// func TestSomethingThatUses{{.Name}}(t *testing.T) {
|
||||||
|
//
|
||||||
|
// // make and configure a mocked {{.Name}}
|
||||||
|
// mocked{{.Name}} := {{.Name}}Mock{
|
||||||
|
// {{ range .Methods }}{{.Name}}Func: func({{ .Arglist }}) {{.ReturnArglist}} {
|
||||||
|
// panic("TODO: mock out the {{.Name}} function")
|
||||||
|
// },
|
||||||
|
// {{end}}
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // TODO: use mocked{{.Name}} in code that requires {{.Name}}
|
||||||
|
//
|
||||||
|
// }
|
||||||
type {{.Name}}Mock struct {
|
type {{.Name}}Mock struct {
|
||||||
{{ range .Methods }}
|
{{ range .Methods }}
|
||||||
// {{.Name}}Func mocks the {{.Name}} function.
|
// {{.Name}}Func mocks the {{.Name}} function.
|
||||||
|
Loading…
Reference in New Issue
Block a user