Merge pull request #13 from piotrrojek/fix-11-chanel-directions-not-handled-correctly

Change `html/template` to `text/template`
This commit is contained in:
Mat Ryer 2017-03-07 13:40:25 +00:00 committed by GitHub
commit ac5bfca30c
3 changed files with 29 additions and 1 deletions

View File

@ -8,10 +8,10 @@ import (
"go/parser"
"go/token"
"go/types"
"html/template"
"io"
"os"
"strings"
"text/template"
)
// Mocker can generate mock structs.

View File

@ -114,3 +114,24 @@ func TestNothingToReturn(t *testing.T) {
}
}
}
func TestChannelNames(t *testing.T) {
m, err := New("testdata/channels", "")
if err != nil {
t.Errorf("moq.New: %s", err)
}
var buf bytes.Buffer
err = m.Mock(&buf, "Queuer")
if err != nil {
t.Errorf("m.Mock: %s", err)
}
s := buf.String()
var strs = []string{
"func (mock *QueuerMock) Sub(topic string) (<-chan Queue, error)",
}
for _, str := range strs {
if !strings.Contains(s, str) {
t.Errorf("expected by missing: \"%s\"", str)
}
}
}

View File

@ -0,0 +1,7 @@
package channels
type Queue []string
type Queuer interface {
Sub(topic string) (<-chan Queue, error)
}