Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate out offsets and timeouts #478

Merged
merged 1 commit into from Nov 2, 2021
Merged

Conversation

thediveo
Copy link
Collaborator

@thediveo thediveo commented Nov 1, 2021

This is a (late) follow-up to #392 and separates control over offset, timeout and polling intervals from the multitude of expectation-related function signatures. In consequence, test writers can stick solely to the baseline of Expect, Eventually, Consistently in the future:

  • WithOffset(offset int) on (async) assertions sets the offset, so ExpectWithOffset(666, ...).To(FooBar()) can now be written as Expect(...).WithOffset(666).To(FooBar()). The same applies to Eventually and Consistently.
  • async assertions additionally feature WithTimeout(interval time.Duration) and WithPolling(interval time.Duration). Here, I opted for a type-safe interface and not repeating "Interval" in the method names, as the function parameter names already carry this meaning.
  • existing interfaces are kept unmodified.
  • internal/ tests are updated to use WithOffset, WithTimeout and WithPolling.
  • godoc comments have been updated.

@onsi
Copy link
Owner

onsi commented Nov 2, 2021

This looks great - thanks so much!

@onsi onsi merged commit 18a4723 into onsi:master Nov 2, 2021
@thediveo thediveo deleted the thediveo-withoffset branch November 2, 2021 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants