title: NoMethodError: undefined method `mock' with Mocha and Rails 3
body: <p>I'm trying to use mocha in my Rails 3 project but keep getting the following exception:</p>
  
  <pre><code>NoMethodError: undefined method `mock' for #&lt;MochaTest:0x00000101f434e8&gt;
      /Users/John/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.10/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'
      test/functional/mocha_test.rb:7:in `block in &lt;class:MochaTest&gt;'
  </code></pre>
  
  <p><strong>Test</strong></p>
  
  <p>I've written the simplest test possible:</p>
  
  <pre><code>require 'test_helper'
  
  class MochaTest &lt; ActionController::TestCase
    test "test mocha" do
      order = mock('order')
    end
  end
  </code></pre>
  
  <p>I run it using <code>ruby -Itest test/functional/mocha_test.rb</code></p>
  
  <p>I've tried <code>rake test</code> and it gives exactly the same exception.</p>
  
  <p><strong>test_helper.rb</strong></p>
  
  <pre><code>ENV["RAILS_ENV"] = "test"
  require File.expand_path('../../config/environment', __FILE__)
  require 'rails/test_help'
  
  class ActiveSupport::TestCase
    #....
    require 'test/unit'
    require 'mocha' 
  end
  </code></pre>
  
  <p><strong>GemFile</strong></p>
  
  <pre><code>source 'http://rubygems.org'
  
  gem 'rails', '3.0.10'
  gem 'sqlite3'
  gem 'devise', '1.4.5'
  gem 'activemerchant'
  gem 'geo_location'
  gem 'nokogiri'
  gem "nifty-generators", :group =&gt; :development
  gem 'mocha', '0.10.0'
  </code></pre>
  
  <p><strong>Things I've Tried</strong></p>
  
  <ul>
  <li>Installing mocha 0.9.5 after reading 0.9.5-7 had issues with this. I get an <code>undefined method name</code> exception instead</li>
  <li>Changing where I require mocha - at the bottom of test_helper.rb, top of test etc.</li>
  <li>Tried calling mock() in rails console test - I get the same exception</li>
  </ul>
  
  <p>I'm tearing my hair out with this. Any ideas would be gratefully received.</p>