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
Name | Description |
---|---|
| Checks if a string does not match a regular expression pattern. |
| Compares two values for equality. |
| Marks a test as failed. |
| Checks if a string matches a regular expression pattern. |
| Checks if a value is nil. |
| Compares two values for inequality. |
| Checks if a value is not nil. |
| 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.
actual
Required
- Type: str
The string to test.
expected
Required
- Type: str
The regular expression pattern to check against.
equal
bring expect;
inflight expect.equal(actual: any, expected: any);
Compares two values for equality.
actual
Required
- Type: any
The value to test.
expected
Required
- Type: any
The expected value.
fail
bring expect;
inflight expect.fail(message?: str);
Marks a test as failed.
message
Optional
- 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.
actual
Required
- Type: str
The string to test.
expected
Required
- Type: str
The regular expression pattern to match against.
nil
bring expect;
inflight expect.nil(actual: any);
Checks if a value is nil.
actual
Required
- Type: any
The value to test.
notEqual
bring expect;
inflight expect.notEqual(actual: any, expected: any);
Compares two values for inequality.
actual
Required
- Type: any
The value to test.
expected
Required
- Type: any
The expected value.
notNil
bring expect;
inflight expect.notNil(actual: any);
Checks if a value is not nil.
actual
Required
- Type: any
The value to test.
ok
bring expect;
inflight expect.ok(condition: bool, message?: str);
Asserts that a condition is truthy.
condition
Required
- Type: bool
The condition to test.
message
Optional
- Type: str
An optional message to include if the condition is falsy.