PredicateStatus

public enum PredicateStatus

PredicateStatus is a trinary that indicates if a Predicate matches a given value or not

  • Matches indicates if the predicate / matcher passes with the given value

    For example, equals(1) returns .matches for expect(1).to(equal(1)).

    Declaration

    Swift

    case matches
  • DoesNotMatch indicates if the predicate / matcher fails with the given value, but would succeed if the expectation was inverted.

    For example, equals(2) returns .doesNotMatch for expect(1).toNot(equal(2)).

    Declaration

    Swift

    case doesNotMatch
  • Fail indicates the predicate will never satisfy with the given value in any case. A perfect example is that most matchers fail whenever given nil.

    Using equal(1) fails both expect(nil).to(equal(1)) and expect(nil).toNot(equal(1)). Note: Predicate’s requireNonNil property will also provide this feature mostly for free. Your predicate will still need to guard against nils, but error messaging will be handled for you.

    Declaration

    Swift

    case fail
  • Converts a boolean to either .matches (if true) or .doesNotMatch (if false).

    Declaration

    Swift

    public init(bool matches: Bool)
  • Undocumented

    Declaration

    Swift

    public func toObjectiveC() -> NMBPredicateStatus