Documentation ¶
Index ¶
- func AssertThat[A any](t gocrest.TestingT, actual A, m *gocrest.Matcher[A])
- func Eventually(t gocrest.TestingT, waitFor, tick time.Duration, ...)
- func WithinFiveSeconds(t gocrest.TestingT, assertions func(eventually gocrest.TestingT))
- func WithinTenSeconds(t gocrest.TestingT, assertions func(eventually gocrest.TestingT))
- type FailureLog
- type Latest
- type RecordingTestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertThat ¶
AssertThat calls a given matcher and fails the test with a message if the matcher doesn't match.
func Eventually ¶ added in v1.0.7
func Eventually(t gocrest.TestingT, waitFor, tick time.Duration, assertions func(eventually gocrest.TestingT))
Eventually retries a set of assertions passed into it from a function. waitFor is the amount of time to wait for the assertions to pass. tick is the amount of time between running the assertions assertions are the function containing the assertions. e.g: ```
then.Eventually(t, time.Second*5, time.Second, func(eventually gocrest.TestingT) { then.AssertThat(eventually, by.Channelling(channel), is.EqualTo(3).Reason("should not fail")) })
```
func WithinFiveSeconds ¶ added in v1.0.7
WithinFiveSeconds is a shortcut for a five-second Eventually call with one second tick
Types ¶
type FailureLog ¶ added in v1.0.8
type FailureLog struct { TestOutput string // contains filtered or unexported fields }
FailureLog is a type that holds temporary test data whilst Eventually runs
type Latest ¶ added in v1.0.7
Latest is used internally by Eventually to record the last recorded test output from assertions passed into it Only used with Eventually
func (*Latest) Get ¶ added in v1.0.7
func (l *Latest) Get() RecordingTestingT
Get is used internally by Eventually to Get the last recorded test output from assertions passed into it Only used with Eventually
func (*Latest) Merge ¶ added in v1.0.8
func (l *Latest) Merge(updated RecordingTestingT) RecordingTestingT
Merge is used internally by Eventually to Merge the latest recorded test output from assertions passed into it with the last one Only used with Eventually
type RecordingTestingT ¶ added in v1.0.7
type RecordingTestingT struct { sync.Mutex gocrest.TestingT // contains filtered or unexported fields }
RecordingTestingT is a testingT interface that holds temporary test data whilst Eventually runs. Only used with Eventually
func (*RecordingTestingT) Errorf ¶ added in v1.0.7
func (t *RecordingTestingT) Errorf(format string, args ...interface{})
Errorf appends an error message into the failure buffer. Only used with Eventually
func (*RecordingTestingT) Fail ¶ added in v1.0.7
func (t *RecordingTestingT) Fail()
Fail calls Errorf with a generic failure message in case the test is failed from inside the value under test. Only used with Eventually
func (*RecordingTestingT) FailNow ¶ added in v1.0.7
func (t *RecordingTestingT) FailNow()
FailNow calls Errorf with a generic failure message in case the test is failed from inside the value under test. Only used with Eventually
func (*RecordingTestingT) FailedTestOutputs ¶ added in v1.0.8
func (t *RecordingTestingT) FailedTestOutputs() []string
FailedTestOutputs retrieves the list of recorded testing.T failures from the assertions passed in for Eventually evaluation. Only used with Eventually
func (*RecordingTestingT) Failing ¶ added in v1.0.8
func (t *RecordingTestingT) Failing() bool
Failing determines whether any of the Eventually assertions are still failing. Only used with Eventually