be method

K be(
  1. T expected
)

Asserts that the value is equal to the specified expected value. expected The expected value

Implementation

K be(T expected) {
  if (isReversed) {
    if (expected == subject) {
      throw ShouldlyTestFailureError(
        'Expected $subjectLabel\n${ShouldlySettings.pads}should not be\n$expected\n${ShouldlySettings.pads}but was\n$subject',
      );
    }
  } else {
    if (expected != subject) {
      throw ShouldlyTestFailureError(
        'Expected $subjectLabel\n${ShouldlySettings.pads}should be\n$expected\n${ShouldlySettings.pads}but was\n$subject',
      );
    }
  }

  return copy(subject, subjectLabel: subjectLabel);
}