// OCHamcrest by Jon Reid, https://qualitycoding.org/ // Copyright 2019 hamcrest.org. See LICENSE.txt #import NS_ASSUME_NONNULL_BEGIN /*! * @abstract Matches objects whose description satisfies a nested matcher. */ @interface HCHasDescription : HCInvocationMatcher - (instancetype)initWithDescription:(id )descriptionMatcher NS_DESIGNATED_INITIALIZER; - (instancetype)initWithInvocation:(NSInvocation *)anInvocation matching:(id )aMatcher NS_UNAVAILABLE; @end FOUNDATION_EXPORT id HC_hasDescription(id descriptionMatcher); #ifndef HC_DISABLE_SHORT_SYNTAX /*! * @abstract Creates a matcher that matches when the examined object's -description * satisfies the specified matcher. * @param descriptionMatcher The matcher used to verify the description result, or an expected value * for equalTo matching. * @discussion If descriptionMatcher is not a matcher, it is implicitly wrapped in * an equalTo matcher to check for equality. * * Examples
*
assertThat(myObject, hasDescription(equalTo(\@"foo"))
*
assertThat(myObject, hasDescription(\@"foo"))
* * Name Clash
* In the event of a name clash, #define HC_DISABLE_SHORT_SYNTAX and use the synonym * HC_hasDescription instead. */ static inline id hasDescription(id descriptionMatcher) { return HC_hasDescription(descriptionMatcher); } #endif NS_ASSUME_NONNULL_END