OCHamcrest
Public Member Functions | Static Public Member Functions | Protected Attributes | Properties
HCInvocationMatcher Class Reference

Supporting class for matching a feature of an object. More...

Inheritance diagram for HCInvocationMatcher:
Inheritance graph
[legend]

List of all members.

Public Member Functions

(instancetype) - initWithInvocation:matching:
 Returns an HCInvocationMatcher object initialized with an invocation and a matcher.
(id) - invokeOn:
 Invokes stored invocation on given item and returns the result.
(NSString *) - stringFromSelector
 Returns string representation of the invocation's selector.

Static Public Member Functions

(NSInvocation *) + invocationForSelector:onClass:
 Helper method for creating an invocation.

Protected Attributes

NSInvocation * invocation
id< HCMatchersubMatcher

Properties

BOOL shortMismatchDescription
 Determines whether a mismatch will be described in short form.

Detailed Description

Supporting class for matching a feature of an object.

Tests whether the result of passing a given invocation to the value satisfies a given matcher.


Member Function Documentation

- (instancetype) initWithInvocation: (NSInvocation *)  anInvocation
matching: (id< HCMatcher >)  aMatcher 

Returns an HCInvocationMatcher object initialized with an invocation and a matcher.

+ (NSInvocation *) invocationForSelector: (SEL)  selector
onClass: (Class)  aClass 

Helper method for creating an invocation.

A class is specified only so we can determine the method signature.

- (id) invokeOn: (id)  item

Invokes stored invocation on given item and returns the result.

- (NSString *) stringFromSelector

Returns string representation of the invocation's selector.


Member Data Documentation

- (NSInvocation*) invocation [protected]
- (id<HCMatcher>) subMatcher [protected]

Property Documentation

- (BOOL) shortMismatchDescription [read, write, assign]

Determines whether a mismatch will be described in short form.

Default is long form, which describes the object, the name of the invocation, and the sub-matcher's mismatch diagnosis. Short form only has the sub-matcher's mismatch diagnosis.