title: Mocking/stubbing a method that's included from "instance.extend(DecoratorModule)"
body: <p>I use a decorator module that get's included in a model instance (through the "extends" method). So for example :</p>
  
  <pre class="lang-rb prettyprint-override"><code>module Decorator
    def foo
    end
  end
  
  class Model &lt; ActiveRecord::Base
  end
  
  class ModelsController &lt; ApplicationController
    def bar
      @model = Model.find(params[:id])
      @model.extend(Decorator)
      @model.foo
    end
  end
  </code></pre>
  
  <p>Then I would like in the tests to do the following (using Mocha) :</p>
  
  <pre class="lang-rb prettyprint-override"><code>test "bar" do
    Model.any_instance.expects(:foo).returns("bar")
    get :bar
  end 
  </code></pre>
  
  <p>Is this possible somehow, or do you have in mind any other way to get this functionality???</p>