Skip to main content

AlephExpectation

Base class: Object

Represents an expectation created by expect inside an active Aleph test.

Expectation values hold the actual value being checked and expose matcher methods such as to_equal, to_contain, and to_throw_message. Expectations only work while a test body, before_each hook, or after_each hook is actively executing.

Example


test "expectation value" {
var expectation = expect("aleph")
expectation.to_contain("lep")
}

Members

NameDescription
notReturns a negated expectation so the next matcher records a failure when it would normally pass.
to_be_greater_or_equal_thanRecords a failure unless the actual numeric value is greater than or equal to expected.
to_be_greater_thanRecords a failure unless the actual numeric value is greater than expected.
to_be_less_or_equal_thanRecords a failure unless the actual numeric value is less than or equal to expected.
to_be_less_thanRecords a failure unless the actual numeric value is less than expected.
to_containRecords a failure unless the actual value contains the expected value.
to_equalRecords a failure unless the actual value equals the expected value.
to_have_lengthRecords a failure unless the actual value has the expected size.
to_have_typeRecords a failure unless the actual value has the expected Aleph type name.
to_satisfyRecords a failure unless the predicate returns true for the actual value.
to_throwRecords a failure unless the expected action throws.
to_throw_messageRecords a failure unless the expected action throws a matching message.