-
Notifications
You must be signed in to change notification settings - Fork 100
OCHamcrest FAQ
Jon Reid edited this page Sep 12, 2015
·
12 revisions
OCHamcrest's regular assertThat
and assertWithTimeout
is compatible with the following testing frameworks:
- XCTest
- OCUnit (SenTestingKit)
- Kiwi
- Cedar
- GHUnit
- Google Toolbox for Mac (GTM)
- OCMock
- OCMockito
Note that you can use any OCHamcrest matchers directly, apart from assertThat
.
Use withMatcher:forArgument:
to specify matchers for specific arguments. Those matchers will take precedence over what is specified later. For example:
[[verify(mockObject) withMatcher:anything() forArgument:1]
someMethod:arg someRect:CGRectZero];
Here, the matcher for the CGRect has already been specified as anything()
. The value of CGRectZero
is ignored, but some rect is necessary to create the right method signature.