be_ctx

package
v0.1.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 3 Imported by: 0

README

be_ctx

-- import "github.com/expectto/be/be_ctx"

Package be_ctx provides Be matchers on context.Context

Usage

func Ctx
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
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
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
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.

Documentation

Overview

Package be_ctx provides Be matchers on context.Context

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ctx

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

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

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

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL