title: Understanding Sinon.js's yield(), yields(), and callsArg()
body: <p>What is the difference between </p>
  
  <ul>
  <li><code>stub.yield([arg1, arg2, ...])</code></li>
  <li><code>spy.yields([arg1, arg2, ...])</code></li>
  <li><code>stub.callsArg(index)</code></li>
  </ul>
  
  <p>in the <a href="http://sinonjs.org/docs/#stubs" rel="noreferrer">Sinon.js</a> stub library?</p>
  
  <p><code>stub.yield()</code> is the only one that I've been able to grasp:</p>
  
  <pre><code>  stub = sinon.stub(API, 'call_remote');
    callback = sinon.spy();
    API.call_remote('help', callback);
    @stub.yield( "solution!" );
    @stub.calledOnce.should.be.true;
    @callback.calledOnce.should.be.true;
    @callback.args[0][0].should.eql( "solution!" );
  </code></pre>
  
  <p>As tested with should.js, would have all assertions pass.</p>
  
  <p>Are there similar test patterns for <code>stub.yields()</code> and <code>stub.callsArg(index)</code>?</p>
  
  <p>The documentation does not provide any examples to clarify these other two methods but I am curious about them.</p>