Documentation
¶
Index ¶
- Constants
- type IoMock
- func (mock *IoMock) ListYamlFilesPaths(rootPath string) ([]string, error)
- func (mock *IoMock) ListYamlFilesPathsCalls() []struct{ ... }
- func (mock *IoMock) ReadFile(filename string) ([]byte, error)
- func (mock *IoMock) ReadFileCalls() []struct{ ... }
- func (mock *IoMock) WriteFile(filename string, data []byte, perm os.FileMode) error
- func (mock *IoMock) WriteFileCalls() []struct{ ... }
Constants ¶
View Source
const YamlTwoImages = `` /* 3293-byte string literal not displayed */
YamlTwoImages - a yaml example with two image references
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IoMock ¶
type IoMock struct {
// ListYamlFilesPathsFunc mocks the ListYamlFilesPaths method.
ListYamlFilesPathsFunc func(rootPath string) ([]string, error)
// ReadFileFunc mocks the ReadFile method.
ReadFileFunc func(filename string) ([]byte, error)
// WriteFileFunc mocks the WriteFile method.
WriteFileFunc func(filename string, data []byte, perm os.FileMode) error
// contains filtered or unexported fields
}
IoMock is a mock implementation of Io.
func TestSomethingThatUsesIo(t *testing.T) {
// make and configure a mocked Io
mockedIo := &IoMock{
ListYamlFilesPathsFunc: func(rootPath string) ([]string, error) {
panic("mock out the ListYamlFilesPaths method")
},
ReadFileFunc: func(filename string) ([]byte, error) {
panic("mock out the ReadFile method")
},
WriteFileFunc: func(filename string, data []byte, perm os.FileMode) error {
panic("mock out the WriteFile method")
},
}
// use mockedIo in code that requires Io
// and then make assertions.
}
func (*IoMock) ListYamlFilesPaths ¶
ListYamlFilesPaths calls ListYamlFilesPathsFunc.
func (*IoMock) ListYamlFilesPathsCalls ¶
ListYamlFilesPathsCalls gets all the calls that were made to ListYamlFilesPaths. Check the length with:
len(mockedIo.ListYamlFilesPathsCalls())
func (*IoMock) ReadFileCalls ¶
ReadFileCalls gets all the calls that were made to ReadFile. Check the length with:
len(mockedIo.ReadFileCalls())
Click to show internal directories.
Click to hide internal directories.