title: Using sinon mocks with nodeunit
body: <p>I'm learning to use sinon with <a href="https://github.com/caolan/nodeunit" rel="nofollow">nodeunit</a>, specifically to do mocking.  The <a href="http://sinonjs.org/nodeunit/" rel="nofollow">recommended approach</a> is to use <a href="https://github.com/cjohansen/sinon-nodeunit" rel="nofollow">sinon-nodeunit</a>.  According to <a href="http://sinonjs.org/nodeunit/#mocks" rel="nofollow">the documentation</a>, mocks should be available via the <code>mock</code> method of the <code>test</code> parameter to each test function.</p>
  
  <p>However, this doesn't seem to work.  If I run <code>nodeunit</code> on a file containing the following —</p>
  
  <pre><code>require('sinon-nodeunit');
  
  exports['test sinon-nodeunit'] = function (test) {
      mock = test.mock({});
      test.done();
  };
  </code></pre>
  
  <p>— I get this:</p>
  
  <pre><code>$ nodeunit test/test-sinon-nodeunit.js 
  
  test-sinon-nodeunit.js
  ✖ test sinon-nodeunit
  
  TypeError: Object #&lt;Object&gt; has no method 'mock'
      at /home/malkovich/test/test-sinon-nodeunit.js:4:17
      at Object.runTest (/usr/local/lib/node/.npm/nodeunit/0.5.1/package/lib/core.js:54:9)
      at /usr/local/lib/node/.npm/nodeunit/0.5.1/package/lib/core.js:90:21
      at /usr/local/lib/node/.npm/nodeunit/0.5.1/package/deps/async.js:508:13
      at /usr/local/lib/node/.npm/nodeunit/0.5.1/package/deps/async.js:118:13
      at /usr/local/lib/node/.npm/nodeunit/0.5.1/package/deps/async.js:134:9
      at /usr/local/lib/node/.npm/nodeunit/0.5.1/package/deps/async.js:507:9
      at Object.concatSeries (/usr/local/lib/node/.npm/nodeunit/0.5.1/package/deps/async.js:147:23)
      at Object.runSuite (/usr/local/lib/node/.npm/nodeunit/0.5.1/package/lib/core.js:79:11)
      at Object.runModule (/usr/local/lib/node/.npm/nodeunit/0.5.1/package/lib/core.js:114:13)
  
  
  FAILURES: 1/1 assertions failed (84ms)
  </code></pre>
  
  <p>I've installed current versions of both <code>sinon</code> (1.1.1) and <code>sinon-nodeunit</code> (0.1.2) via <code>npm install</code>.</p>