This commit is contained in:
Mat Ryer 2016-08-31 13:05:37 +01:00
parent 5f095748f8
commit 99a46df581
3 changed files with 4 additions and 6 deletions

View File

@ -2,6 +2,8 @@ package example
import "context" import "context"
//go:generate moq PersonStore -out mockpersonstore_test.go
type Person struct { type Person struct {
ID string ID string
Name string Name string

View File

@ -78,9 +78,7 @@ func (m *Mocker) Mock(w io.Writer, name ...string) error {
method.Returns = extractArgs(sig.Results(), "out%d") method.Returns = extractArgs(sig.Results(), "out%d")
} }
objs = append(objs, obj) objs = append(objs, obj)
} }
} }
err := m.tmpl.Execute(w, struct{ Objs []*obj }{Objs: objs}) err := m.tmpl.Execute(w, struct{ Objs []*obj }{Objs: objs})
if err != nil { if err != nil {

View File

@ -1,16 +1,14 @@
package moq_test package moq
import ( import (
"bytes" "bytes"
"log" "log"
"testing" "testing"
"github.com/matryer/moq/package/moq"
) )
func TestMoq(t *testing.T) { func TestMoq(t *testing.T) {
m, err := moq.New("../../example") m, err := New("../../example")
if err != nil { if err != nil {
t.Errorf("moq.New: %s", err) t.Errorf("moq.New: %s", err)
} }