Skip to content
Jon Reid edited this page Sep 12, 2015 · 12 revisions

Is OCHamcrest compatible with ____?

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.

How do you express "any CGRect" when verifying a method argument?

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.

Clone this wiki locally