Skip to main content

API Reference

Classes

Expect

The Util class provides methods for making assertions in tests, such as comparing two strings for equality with rich error messages.

Static Functions

NameDescription
doesNotMatch
Checks if a string does not match a regular expression pattern.
equal
Compares two values for equality.
fail
Marks a test as failed.
match
Checks if a string matches a regular expression pattern.
nil
Checks if a value is nil.
notEqual
Compares two values for inequality.
notNil
Checks if a value is not nil.
ok
Asserts that a condition is truthy.

doesNotMatch
bring expect;

inflight expect.doesNotMatch(actual: str, expected: str);

Checks if a string does not match a regular expression pattern.

actualRequired
  • Type: str

The string to test.


expectedRequired
  • Type: str

The regular expression pattern to check against.


equal
bring expect;

inflight expect.equal(actual: any, expected: any);

Compares two values for equality.

actualRequired
  • Type: any

The value to test.


expectedRequired
  • Type: any

The expected value.


fail
bring expect;

inflight expect.fail(message?: str);

Marks a test as failed.

messageOptional
  • Type: str

An optional message to include with the failure.


match
bring expect;

inflight expect.match(actual: str, expected: str);

Checks if a string matches a regular expression pattern.

actualRequired
  • Type: str

The string to test.


expectedRequired
  • Type: str

The regular expression pattern to match against.


nil
bring expect;

inflight expect.nil(actual: any);

Checks if a value is nil.

actualRequired
  • Type: any

The value to test.


notEqual
bring expect;

inflight expect.notEqual(actual: any, expected: any);

Compares two values for inequality.

actualRequired
  • Type: any

The value to test.


expectedRequired
  • Type: any

The expected value.


notNil
bring expect;

inflight expect.notNil(actual: any);

Checks if a value is not nil.

actualRequired
  • Type: any

The value to test.


ok
bring expect;

inflight expect.ok(condition: bool, message?: str);

Asserts that a condition is truthy.

conditionRequired
  • Type: bool

The condition to test.


messageOptional
  • Type: str

An optional message to include if the condition is falsy.