title: How to mock OpenCV camera using GMock, or how test method that use camera with GTest?
body: <p>I have written a wrapper for OpenCV library. I create <code>Camera</code> class that allows to use hardware camera.</p>
  
  <p>The tested method is sth like this:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>bool Camera::Open(int idx) {
    cam_ = cv::VideoCapture(idx)
    if (cam_.isOpened())
      return true;
  
    return false;
  }
  </code></pre>
  
  <p>I want to test <code>Open()</code> method using GTest, but I don't want to test it with real physical camera. I think that the best way is to use GMock, but I really don't know how to mock camera.</p>