From da0b19b274eea99b9dabda5deede080013ade773 Mon Sep 17 00:00:00 2001 From: Mat Ryer Date: Mon, 29 Aug 2016 13:09:34 +0100 Subject: [PATCH] improved output --- example/example.go | 2 +- package/moq/moq.go | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/example/example.go b/example/example.go index 5ec5384..3adcbb8 100644 --- a/example/example.go +++ b/example/example.go @@ -10,6 +10,6 @@ type Person struct { } 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 } diff --git a/package/moq/moq.go b/package/moq/moq.go index 4c670a4..4cd2ac2 100644 --- a/package/moq/moq.go +++ b/package/moq/moq.go @@ -161,6 +161,20 @@ package todo // github.com/matryer/moq {{ range .Objs }} // {{.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 { {{ range .Methods }} // {{.Name}}Func mocks the {{.Name}} function.