Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RendererMock ¶
type RendererMock struct {
// DoFunc mocks the Do method.
DoFunc func(path string, b []byte) ([]byte, error)
// contains filtered or unexported fields
}
RendererMock is a mock implementation of interfaces.Renderer.
func TestSomethingThatUsesRenderer(t *testing.T) {
// make and configure a mocked interfaces.Renderer
mockedRenderer := &RendererMock{
DoFunc: func(path string, b []byte) ([]byte, error) {
panic("mock out the Do method")
},
}
// use mockedRenderer in code that requires interfaces.Renderer
// and then make assertions.
}
func (*RendererMock) Do ¶
func (mock *RendererMock) Do(path string, b []byte) ([]byte, error)
Do calls DoFunc.
func (*RendererMock) DoCalls ¶
func (mock *RendererMock) DoCalls() []struct { Path string B []byte }
DoCalls gets all the calls that were made to Do. Check the length with:
len(mockedRenderer.DoCalls())
Click to show internal directories.
Click to hide internal directories.