Skip to content

Commit

Permalink
Remove mocks from deprecated Generator interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ernesto-jimenez committed Aug 20, 2016
1 parent 8c3437c commit 5351b73
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 141 deletions.
129 changes: 0 additions & 129 deletions automock/generator_mock_test.go

This file was deleted.

12 changes: 0 additions & 12 deletions automock/generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package automock
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -81,21 +80,10 @@ func printWithLines(txt io.Reader) {
}
}

//go:generate go run ../cmd/goautomock/main.go Generator
//go:generate go run ../cmd/goautomock/main.go io.Writer
//go:generate go run ../cmd/goautomock/main.go -pkg=io ByteScanner
//go:generate go run ../cmd/goautomock/main.go net/http.CookieJar

func TestMockedGenerator(t *testing.T) {
m := &GeneratorMock{}
m.On("Write", mock.Anything).Return(nil).Once()
assert.NoError(t, m.Write(&bytes.Buffer{}))

err := errors.New("fail")
m.On("Write", mock.Anything).Return(err)
assert.Equal(t, err, m.Write(&bytes.Buffer{}))
}

func TestMockedIOWriter(t *testing.T) {
m := &WriterMock{}
expected := []byte("hello")
Expand Down

0 comments on commit 5351b73

Please sign in to comment.