title: Monitoring of a library with sinon
body: <p>I have the following code to test using sinon:</p>
  
  <pre><code>var req = new MultiPartUpload({
      client: client,
      objectName: "/" + obj.func.destPath(),
      stream: obj.outStream,
      headers: headers
    }, function (err, body) {
      obj.debug('uploaded' + body);
    });
  </code></pre>
  
  <p>I have to test the creation of this object. How can I do it? I have tried with:</p>
  
  <pre><code>var MultiPartUpload = require('knox-mpu');
  var stub = sinon.createStubInstance(MultiPartUpload);
  instance(obj, function () {
    expect(stub).to.have.been.called;
    done();
  });
  </code></pre>
  
  <p>But it doesn't work as expected. Any suggestion? Thank you :)</p>
  
  <p>EDIT:</p>
  
  <p>instance is the istance of the object that creates the MultiPartUpload object. The problem is  that the instance signature cannot be changed and that the MultiPartUpload library is required in the file where instance is created.</p>
  
  <p><strong>In short:</strong> I have to spy the MultiPartUpload library, and the problem is that is not possible to communicate in any way with istance, where the library is used.</p>