title: Stub a Method That Returns a BOOL with OCMock
body: <p>I'm using OCMock 1.70 and am having a problem mocking a simple method that returns a BOOL value. Here's my code:</p>
  
  <pre><code>@interface MyClass : NSObject
  - (void)methodWithArg:(id)arg;
  - (BOOL)methodWithBOOLResult;
  @end
  @implementation MyClass
  - (void)methodWithArg:(id)arg {
      NSLog(@"methodWithArg: %@", arg);
  }
  - (BOOL)methodWithBOOLResult {
      NSLog(@"methodWithBOOLResult");
      return YES;
  }
  @end
  
  - (void)testMock {
      id real = [[[MyClass alloc] init] autorelease];
      [real methodWithArg:@"foo"];
      //=&gt; SUCCESS: logs "methodWithArg: foo"
  
      id mock = [OCMockObject mockForClass:[MyClass class]];
      [[mock stub] methodWithArg:[OCMArg any]];
      [mock methodWithArg:@"foo"];
      //=&gt; SUCCESS: "nothing" happens
  
      NSAssert([real methodWithBOOLResult], nil);
      //=&gt; SUCCESS: logs "methodWithBOOLResult", YES returned
  
      BOOL boolResult = YES;
      [[[mock stub] andReturn:OCMOCK_VALUE(boolResult)] methodWithBOOLResult];
      NSAssert([mock methodWithBOOLResult], nil);
      //=&gt; FAILURE: raises an NSInvalidArgumentException:
      //   Expected invocation with object return type.
  }
  </code></pre>
  
  <p>What am I doing wrong?</p>