Skip to main content

Existential asserts

<name> should be absent

Checks that a named binding is absent from the current scope.

With custom assertion error message (as of v3.9.0):

<name> should be absent  @Message("my custom assert fail message")


Without any timeout (as of v3.73.0):

@Timeout('0s') <name> should be absent


With custom timeout (as of v3.73.0):

@Timeout('10s') <name> should be absent

Where

  • <name> is the name of the binding to check
  • <timeoutSecs> is the timeout period in seconds
  • <wait|timeout> is either wait or timeout

Example

  Then this should be absent

or equivalently (as of v3.29.0)

  Then that should not be defined
<name> should[ not] be defined

Checks whether or not a named binding exists in the current scope.

With custom assertion error message:

<name> should be defined  @Message("my custom assert fail message")


Without any timeout (as of v3.73.0):

@Timeout('0s') <name> should be defined


With custom timeout (as of v3.73.0):

@Timeout('10s') <name> should be defined

Where

  • <name> is the name of the binding to check
  • not negates the check (for absence/non existence)
  • <timeoutSecs> is the timeout period in seconds
  • <wait|timeout> is either wait or timeout

Example

To check for the presence of a binding

  Then this should be defined

To check for the absence of a binding

  Then that should not be defined

or equivalently

  Then that should be absent