Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamluzsi committed Mar 8, 2023
1 parent d2be80f commit db9a9e0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions assert/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,22 @@ func ExampleWaiter_While() {
})
}

func ExampleEventuallyWithin_byCount() {
var tb testing.TB
assert.EventuallyWithin(3 /* times */).Assert(tb, func(it assert.It) {
// use "it" as you would tb, but if the test fails with "it"
// it will be retried 3 times as specified above as argument.
})
}

func ExampleEventuallyWithin_byTimeout() {
var tb testing.TB
assert.EventuallyWithin(time.Minute /* times */).Assert(tb, func(it assert.It) {
// use "it" as you would tb, but if the test fails with "it"
// then the function block will be retried until the allowed time duration, which is one minute in this case.
})
}

func ExampleEventually() {
waiter := assert.Waiter{
WaitDuration: time.Millisecond,
Expand Down

0 comments on commit db9a9e0

Please sign in to comment.