-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
1,333 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# be_ctx | ||
-- | ||
import "github.com/expectto/be/be_ctx" | ||
|
||
Package be_ctx provides Be matchers on context.Context | ||
|
||
## Usage | ||
|
||
#### func Ctx | ||
|
||
```go | ||
func Ctx(args ...any) types.BeMatcher | ||
``` | ||
Ctx succeeds if the actual value is a context.Context. If no arguments are | ||
provided, it matches any context.Context. Otherwise, it uses the Psi matcher to | ||
match the provided arguments against the actual context's values. | ||
|
||
#### func CtxWithDeadline | ||
|
||
```go | ||
func CtxWithDeadline(deadline any) types.BeMatcher | ||
``` | ||
CtxWithDeadline succeeds if the actual value is a context.Context and its | ||
deadline matches the provided deadline. | ||
|
||
#### func CtxWithError | ||
|
||
```go | ||
func CtxWithError(err any) types.BeMatcher | ||
``` | ||
CtxWithError succeeds if the actual value is a context.Context and its error | ||
matches the provided error value. | ||
|
||
#### func CtxWithValue | ||
|
||
```go | ||
func CtxWithValue(key any, vs ...any) types.BeMatcher | ||
``` | ||
CtxWithValue succeeds if the actual value is a context.Context and contains a | ||
key-value pair where the key matches the provided key and the value matches the | ||
provided arguments using any other matchers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// Package be_ctx provides Be matchers on context.Context | ||
package be_ctx | ||
|
||
import ( | ||
|
Oops, something went wrong.