title: Ignoring mock calls during setup phase
body: <p>I often face the problem that mock objects need to be brought in a certain state before the "interesting" part of a test can start.</p>
  
  <p>For example, let's say I want to test the following class:</p>
  
  <pre><code>struct ToTest
  {
      virtual void onEnable();
      virtual void doAction();
  };
  </code></pre>
  
  <p>Therefore, I create the following mock class:</p>
  
  <pre><code>struct Mock : ToTest
  {
      MOCK_METHOD0(onEnable, void());
      MOCK_METHOD0(doAction, void());
  };
  </code></pre>
  
  <p>The first test is that <code>onEnable</code> is called when the system that uses a <code>ToTest</code> object is enabled:</p>
  
  <pre><code>TEST(SomeTest, OnEnable)
  {
      Mock mock;
      // register mock somehow
  
      // interesting part of the test
      EXPECT_CALL(mock, onEnable());
      EnableSystem();
  }
  </code></pre>
  
  <p>So far, so good. The second test is that <code>doAction</code> is called when the system performs an action <em>and is enabled</em>. Therefore, the system should be enabled before the interesting part of  the test can start:</p>
  
  <pre><code>TEST(SomeTest, DoActionWhenEnabled)
  {
      Mock mock;
      // register mock somehow
  
      // initialize system
      EnableSystem();
  
      // interesting part of the test
      EXPECT_CALL(mock, doAction());
      DoSomeAction();
  
  }
  </code></pre>
  
  <p>This works but gives an annoying warning about an uninteresting call to <code>onEnable</code>. There seem to be two common fixes of this problem:</p>
  
  <ol>
  <li>Using <code>NiceMock&lt;Mock&gt;</code> to suppress all such warnings; and</li>
  <li>Add an <code>EXPECT_CALL(mock, onEnable())</code> statement.</li>
  </ol>
  
  <p>I don't want to use the first method since there might be other uninteresting calls that really should not happen. I also don't like the second method since I already tested (in the first test) that <code>onEnable</code> is called when the system is enabled; hence, I don't want to repeat that expectation in all tests that work on enabled systems.</p>
  
  <p>What I would like to be able to do is say that all mock calls up to a certain point should be completely ignored. In this example, I want expectations to be only checked starting from the "interesting part of the test" comment.</p>
  
  <p>Is there a way to accomplish this using Google Mock?</p>