Documentation
¶
Index ¶
- type IT
- type MockedT
- func (testState *MockedT) AssertDidNotFailed()
- func (testState *MockedT) AssertFailNowHasBeenCalled()
- func (testState *MockedT) AssertFailedWithError()
- func (testState *MockedT) AssertFailedWithErrorMessage(expectedMessage string)
- func (testState *MockedT) AssertFailedWithFatal()
- func (testState *MockedT) AssertFailedWithFatalMessage(expectedMessage string)
- func (testState *MockedT) Cleanup(f func())
- func (testState *MockedT) Error(args ...any)
- func (testState *MockedT) Errorf(format string, args ...any)
- func (testState *MockedT) FailNow()
- func (testState *MockedT) Failed() bool
- func (testState *MockedT) Fatal(args ...any)
- func (testState *MockedT) Fatalf(format string, args ...any)
- func (testState *MockedT) GetCleanups() []func()
- func (testState *MockedT) Log(args ...any)
- func (testState *MockedT) Logf(format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IT ¶
type IT interface {
Error(args ...any)
Errorf(format string, args ...any)
Fatal(args ...any)
Fatalf(format string, args ...any)
FailNow()
Log(args ...any)
Logf(format string, args ...any)
Failed() bool
Cleanup(f func())
}
IT is an interface wrapper around *testing.T. It also implements the interfaces required by testify's assert, require and mock packages. This is useful for creating mocks of testing.T in order to test tests fixtures and utilities.
type MockedT ¶
type MockedT struct {
// contains filtered or unexported fields
}
MockedT is a mock implementation of IT that can be used to test fixtures and utilities.
func (*MockedT) AssertDidNotFailed ¶
func (testState *MockedT) AssertDidNotFailed()
AssertDidNotFailed asserts that no failure methods were called.
func (*MockedT) AssertFailNowHasBeenCalled ¶
func (testState *MockedT) AssertFailNowHasBeenCalled()
AssertFailNowHasBeenCalled asserts that FailNow was called.
func (*MockedT) AssertFailedWithError ¶
func (testState *MockedT) AssertFailedWithError()
AssertFailedWithError asserts that an error method (Error, Errorf) was called.
func (*MockedT) AssertFailedWithErrorMessage ¶
AssertFailedWithErrorMessage asserts that an error method (Error, Errorf) was called with the expected message.
func (*MockedT) AssertFailedWithFatal ¶
func (testState *MockedT) AssertFailedWithFatal()
AssertFailedWithFatal asserts that a fatal method (Fatal, Fatalf) was called.
func (*MockedT) AssertFailedWithFatalMessage ¶
AssertFailedWithFatalMessage asserts that a fatal method (Fatal, Fatalf) was called with the expected message.
func (*MockedT) Cleanup ¶
func (testState *MockedT) Cleanup(f func())
Cleanup mocked implementation.
func (*MockedT) GetCleanups ¶
func (testState *MockedT) GetCleanups() []func()