Sinon: Stub and entire object and replace it with a new object
<p>Using Sinon, how does one stub an entire object and all of its methods and then replace them with another object? </p>

<p>I have tried something like this, but it doesnt seem to work:</p>

<pre><code>var stubby = sinon.stub(stubbedObj);
stubby.returns(newReplacementObj);

console.log(stubby); // this returns stub, but it would think that it should return newReplacementObj? 
</code></pre>