Documentation
¶
Index ¶
- func CaptureStderr(fn func()) (string, error)
- func Run(t *testing.T, s suite.TestingSuite)
- type EnvVarHelper
- type MockFile
- func (m *MockFile) Close() error
- func (m *MockFile) Name() string
- func (m *MockFile) Read(p []byte) (n int, err error)
- func (m *MockFile) ReadAt(p []byte, off int64) (n int, err error)
- func (m *MockFile) Readdir(count int) ([]os.FileInfo, error)
- func (m *MockFile) Readdirnames(n int) ([]string, error)
- func (m *MockFile) Seek(offset int64, whence int) (int64, error)
- func (m *MockFile) Stat() (os.FileInfo, error)
- func (m *MockFile) Sync() error
- func (m *MockFile) Truncate(size int64) error
- func (m *MockFile) Write(p []byte) (n int, err error)
- func (m *MockFile) WriteAt(p []byte, off int64) (n int, err error)
- func (m *MockFile) WriteString(s string) (int, error)
- type MockFileInfo
- type MockFs
- func (m *MockFs) Chmod(name string, mode os.FileMode) error
- func (m *MockFs) Chown(name string, uid, gid int) error
- func (m *MockFs) Chtimes(name string, atime time.Time, mtime time.Time) error
- func (m *MockFs) Create(name string) (afero.File, error)
- func (m *MockFs) Mkdir(name string, perm os.FileMode) error
- func (m *MockFs) MkdirAll(path string, perm os.FileMode) error
- func (m *MockFs) Name() string
- func (m *MockFs) Open(name string) (afero.File, error)
- func (m *MockFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)
- func (m *MockFs) Remove(name string) error
- func (m *MockFs) RemoveAll(path string) error
- func (m *MockFs) Rename(oldname, newname string) error
- func (m *MockFs) Stat(name string) (os.FileInfo, error)
- type MockReader
- type MockTarWriter
- type MockWriter
- type Suite
- type SuiteInformation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureStderr ¶
Types ¶
type EnvVarHelper ¶
type EnvVarHelper struct {
// contains filtered or unexported fields
}
func (*EnvVarHelper) Setup ¶
func (h *EnvVarHelper) Setup(vars ...string)
func (*EnvVarHelper) Teardown ¶
func (h *EnvVarHelper) Teardown()
type MockFile ¶
func NewMockFile ¶
func NewMockFile() *MockFile
type MockFileInfo ¶
func NewMockFileInfo ¶
func NewMockFileInfo() *MockFileInfo
func (*MockFileInfo) IsDir ¶
func (m *MockFileInfo) IsDir() bool
func (*MockFileInfo) ModTime ¶
func (m *MockFileInfo) ModTime() time.Time
func (*MockFileInfo) Mode ¶
func (m *MockFileInfo) Mode() fs.FileMode
func (*MockFileInfo) Name ¶
func (m *MockFileInfo) Name() string
func (*MockFileInfo) Size ¶
func (m *MockFileInfo) Size() int64
func (*MockFileInfo) Sys ¶
func (m *MockFileInfo) Sys() any
type MockReader ¶
func NewMockReader ¶
func NewMockReader() *MockReader
type MockTarWriter ¶
func NewMockTarWriter ¶
func NewMockTarWriter() *MockTarWriter
func (*MockTarWriter) Close ¶
func (m *MockTarWriter) Close() error
func (*MockTarWriter) WriteHeader ¶
func (m *MockTarWriter) WriteHeader(hdr *tar.Header) error
type MockWriter ¶
func NewMockWriter ¶
func NewMockWriter() *MockWriter
type Suite ¶
type Suite struct { *require.Assertions // contains filtered or unexported fields }
Suite is a basic testing suite with methods for storing and retrieving the current *testing.T context.
func (*Suite) Assert ¶
func (s *Suite) Assert() *assert.Assertions
Assert returns an assert context for suite. Normally, you can call `suite.NoError(expected, actual)`, but for situations where the embedded methods are overridden (for example, you might want to override assert.Assertions with require.Assertions), this method is provided so you can call `suite.Assert().NoError()`.
func (*Suite) Require ¶
func (s *Suite) Require() *require.Assertions
Require returns a require context for suite.
func (*Suite) Run ¶
Run provides suite functionality around golang subtests. It should be called in place of t.Run(name, func(t *testing.T)) in test suite code. The passed-in func will be executed as a subtest with a fresh instance of t. Provides compatibility with go test pkg -run TestSuite/TestName/SubTestName.
func (*Suite) SetS ¶
func (s *Suite) SetS(newS suite.TestingSuite)
SetS needs to set the current test suite as parent to get access to the parent methods
type SuiteInformation ¶
type SuiteInformation struct {
suite.SuiteInformation
}
SuiteInformation stats stores stats for the whole suite execution.