title: How to init an object with stubbed values with OCMock
body: <p>Ho do I stub a method used in the init method?</p>
  
  <p>The related methods in my class:</p>
  
  <pre><code>- (id)init
  {
      self = [super init];
      if (self) {
          if (self.adConfigurationType == AdConfigurationTypeDouble) {
               [self configureForDoubleConfiguration];
          }
          else {
              [self configureForSingleConfiguration];
          }
      }
      return self;
  }
  
  - (AdConfigurationType)adConfigurationType
  {
      if (adConfigurationType == NSNotFound) {
          if ((random()%2)==1) {
              adConfigurationType = AdConfigurationTypeSingle;
          }
          else {
              adConfigurationType = AdConfigurationTypeDouble;
          }
      }
      return adConfigurationType;
  }
  </code></pre>
  
  <p>My test:</p>
  
  <pre><code>- (void)testDoubleConfigurationLayout
  {
      id mockController = [OCMockObject mockForClass:[AdViewController class]];
      AdConfigurationType type = AdConfigurationTypeDouble;
      [[[mockController stub] andReturnValue:OCMOCK_VALUE(type)] adConfigurationType];
  
      id controller = [mockController init];
  
      STAssertNotNil([controller smallAdRight], @"Expected a value here");
      STAssertNotNil([controller smallAdRight], @"Expected a value here");
      STAssertNil([controller largeAd], @"Expected nil here");
  }
  </code></pre>
  
  <p>My result:</p>
  
  <p>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'OCMockObject[AdViewController]: unexpected method invoked: smallAdRight '</p>
  
  <p>So how will I access the AdViewController in the OCMockObject?</p>