Skip to content

Commit 375648c

Browse files
authoredOct 2, 2023
Minor typos (#699)
1 parent 85681d4 commit 375648c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

Diff for: ‎gomega_dsl.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func ExpectWithOffset(offset int, actual interface{}, extra ...interface{}) Asse
242242
Eventually enables making assertions on asynchronous behavior.
243243
244244
Eventually checks that an assertion *eventually* passes. Eventually blocks when called and attempts an assertion periodically until it passes or a timeout occurs. Both the timeout and polling interval are configurable as optional arguments.
245-
The first optional argument is the timeout (which defaults to 1s), the second is the polling interval (which defaults to 10ms). Both intervals can be specified as time.Duration, parsable duration strings or floats/integers (in which case they are interpreted as seconds). In addition an optional context.Context can be passed in - Eventually will keep trying until either the timeout epxires or the context is cancelled, whichever comes first.
245+
The first optional argument is the timeout (which defaults to 1s), the second is the polling interval (which defaults to 10ms). Both intervals can be specified as time.Duration, parsable duration strings or floats/integers (in which case they are interpreted as seconds). In addition an optional context.Context can be passed in - Eventually will keep trying until either the timeout expires or the context is cancelled, whichever comes first.
246246
247247
Eventually works with any Gomega compatible matcher and supports making assertions against three categories of actual value:
248248
@@ -313,13 +313,13 @@ It is important to note that the function passed into Eventually is invoked *syn
313313
}).Should(BeNumerically(">=", 17))
314314
}, SpecTimeout(time.Second))
315315
316-
you an also use Eventually().WithContext(ctx) to pass in the context. Passed-in contexts play nicely with paseed-in arguments as long as the context appears first. You can rewrite the above example as:
316+
you an also use Eventually().WithContext(ctx) to pass in the context. Passed-in contexts play nicely with passed-in arguments as long as the context appears first. You can rewrite the above example as:
317317
318318
It("fetches the correct count", func(ctx SpecContext) {
319319
Eventually(client.FetchCount).WithContext(ctx).WithArguments("/users").Should(BeNumerically(">=", 17))
320320
}, SpecTimeout(time.Second))
321321
322-
Either way the context passd to Eventually is also passed to the underlying funciton. Now, when Ginkgo cancels the context both the FetchCount client and Gomega will be informed and can exit.
322+
Either way the context passd to Eventually is also passed to the underlying function. Now, when Ginkgo cancels the context both the FetchCount client and Gomega will be informed and can exit.
323323
324324
**Category 3: Making assertions _in_ the function passed into Eventually**
325325
@@ -349,7 +349,7 @@ For example:
349349
350350
will rerun the function until all assertions pass.
351351
352-
You can also pass additional arugments to functions that take a Gomega. The only rule is that the Gomega argument must be first. If you also want to pass the context attached to Eventually you must ensure that is the second argument. For example:
352+
You can also pass additional arguments to functions that take a Gomega. The only rule is that the Gomega argument must be first. If you also want to pass the context attached to Eventually you must ensure that is the second argument. For example:
353353
354354
Eventually(func(g Gomega, ctx context.Context, path string, expected ...string){
355355
tok, err := client.GetToken(ctx)

0 commit comments

Comments
 (0)