OCHamcrest
|
A matcher over acceptable values. More...
Public Member Functions | |
(BOOL) | - matches: |
Evaluates the matcher for argument item. | |
(BOOL) | - matches:describingMismatchTo: |
Evaluates the matcher for argument item. | |
(void) | - describeMismatchOf:to: |
Generates a description of why the matcher has not accepted the item. |
A matcher over acceptable values.
A matcher is able to describe itself to give feedback when it fails.
HCMatcher implementations should not directly implement this protocol. Instead, extend the HCBaseMatcher class, which will ensure that the HCMatcher API can grow to support new features and remain compatible with all HCMatcher implementations.
- (void) describeMismatchOf: | (id) | item | |
to: | (id< HCDescription >) | mismatchDescription | |
Generates a description of why the matcher has not accepted the item.
The description will be part of a larger description of why a matching failed, so it should be concise.
This method assumes that matches:item
is false, but will not check this.
item | The item that the HCMatcher has rejected. |
mismatchDescription | The description to be built or appended to. |
- (BOOL) matches: | (id) | item |
Evaluates the matcher for argument item.
item | The object against which the matcher is evaluated. |
YES
if item matches, otherwise NO
. - (BOOL) matches: | (id) | item | |
describingMismatchTo: | (id< HCDescription >) | mismatchDescription | |
Evaluates the matcher for argument item.
item | The object against which the matcher is evaluated. |
mismatchDescription | The description to be built or appended to if item does not match. |
YES
if item matches, otherwise NO
.