title: Can I use google mocks to check method parameters without setting an expectation in advance?
body: <p>I have a situation where I want to check if a mock object method was called with parameter X, but the test gets access to X only <em>after</em> the mock is invoked, so I can't set an EXPECT_CALL beforehand.</p>
  
  <p>E.g.</p>
  
  <pre><code>// The class I'm testing.
  class Maker
  {
      void register(Listener&amp; lis);
      Obj&amp; make()
      {
          // make new Obj o
          // call created(o) on registered Listener  
          // return o
      }
  }
  
  class Listener
  {
      virtual void created(Obj&amp; o) = 0;
  }
  
  // The test
  Listener lis;
  Maker maker;
  maker.register(lis);
  
  Obj&amp; o = maker.make();
  
  // Check that lis was invoked using param o...how?
  </code></pre>
  
  <p>Can i do this with google mocks? What is the most elegant / readable way of doing this using google mocks?</p>
  
  <p>Obviously I can make my own MockListener which will record invocation parameters, instead of using google mocks. But I'm hoping google mocks would preesnt a more readable mechanism, similar to EXPECT_CALL.</p>