Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileWriter ¶
type FileWriter struct{}
FileWriter creates normal files on disk.
func (FileWriter) Write ¶
func (FileWriter) Write(path, source string) error
Write creates/truncates a file at path and writes source to it.
type PackagePlacer ¶
type PackagePlacer struct {
FilePerInterface bool
}
PackagePlacer puts mocks into the same package as their interfaces, either in a single file (if FilePerInterface is false) or one mock per file (if true).
Without FilePerInterface: the mock of foo.Bar is placed in foo/mocks.go With FilePerInterface: the mock of foo.Bar is placed in foo/mock_bar.go
type Renderer ¶
Renderer generates the complete contents of a Go source file, including imports, that defines mocks and/or stubs for a number of interfaces.
func NewGomutiRenderer ¶
func NewGomutiRenderer() Renderer
NewGomutiRenderer creates a code generator using github.com/xeger/gomuti. The mock type contains a gomuti.Mock and can be programmed using the gomuti.Allow() method.
func NewTestifyRenderer ¶
func NewTestifyRenderer() Renderer
NewTestifyRenderer creates a code generator for github.com/stretchr/testify. The mock type embeds tesify/mock.Mock and can be programmed using the embedded methods.
type StdoutWriter ¶
type StdoutWriter struct{}
StdoutWriter prints file contents to the screen.
func (StdoutWriter) Write ¶
func (StdoutWriter) Write(path, source string) error
Write prints source to the screen.