Documentation ¶
Overview ¶
Package mocktesting is used for mocking out the testing.T interface.
Index ¶
- type MockTester
- func (t *MockTester) Error(args ...interface{})
- func (t *MockTester) Errorf(format string, args ...interface{})
- func (t *MockTester) Fail()
- func (t *MockTester) FailNow()
- func (t *MockTester) Failed() bool
- func (t *MockTester) Fatal(args ...interface{})
- func (t *MockTester) Fatalf(format string, args ...interface{})
- func (t *MockTester) Helper()
- func (t *MockTester) Log(args ...interface{})
- func (t *MockTester) Logf(format string, args ...interface{})
- func (t *MockTester) Name() string
- func (t *MockTester) Output() []string
- func (t *MockTester) SetOutputHandler(handler func(...interface{}))
- func (t *MockTester) Skip(args ...interface{})
- func (t *MockTester) SkipNow()
- func (t *MockTester) Skipf(format string, args ...interface{})
- func (t *MockTester) Skipped() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockTester ¶
type MockTester struct { // The testing.TB interface has an unexported method "to prevent users implementing the // interface and so future additions to it will not violate Go 1 compatibility." // // This may cause problems across Go versions, but let's ignore them and // work around that restriction by embedding a T so we satisfy the unexported methods of the interface. *testing.T // contains filtered or unexported fields }
MockTester is a mock tester. This is used for making sure a test fails using the testing.TB interface and is useful for testing error cases in other test helpers.
func NewMockTester ¶
func NewMockTester(name string) *MockTester
NewMockTester creates a new process tester.
func (*MockTester) Error ¶
func (t *MockTester) Error(args ...interface{})
Error registers an error.
func (*MockTester) Errorf ¶
func (t *MockTester) Errorf(format string, args ...interface{})
Errorf formats the error.
func (*MockTester) Failed ¶
func (t *MockTester) Failed() bool
Failed indicates whether or not the process failed.
func (*MockTester) Fatalf ¶
func (t *MockTester) Fatalf(format string, args ...interface{})
Fatalf formats a fail.
func (*MockTester) Helper ¶
func (t *MockTester) Helper()
Helper is used to implement the test helper.
func (*MockTester) Logf ¶
func (t *MockTester) Logf(format string, args ...interface{})
Logf format logs.
func (*MockTester) Output ¶
func (t *MockTester) Output() []string
Output gets the output of the test.
func (*MockTester) SetOutputHandler ¶
func (t *MockTester) SetOutputHandler(handler func(...interface{}))
SetOutputHandler sets the output handler for the test output.
func (*MockTester) Skipf ¶
func (t *MockTester) Skipf(format string, args ...interface{})
Skipf skips the test with formaatting.
func (*MockTester) Skipped ¶
func (t *MockTester) Skipped() bool
Skipped gets whether or not a process was skipped.