title: Stub unimplemented method in rspec
body: <p>I'm testing my module and I decided to test it versus anonymous class:</p>
  
  <pre><code>  subject(:klass) { Class.new { include MyModule } }
  </code></pre>
  
  <p><code>MyModule</code> uses method <code>name</code> inside <code>klass</code>. To let my specs work I need to stub this method <code>name</code> (which is unimplemented). So I wrote:</p>
  
  <pre><code>subject { klass.new }
  allow(subject).to receive(:name).and_return('SOreadytohelp') }
  </code></pre>
  
  <p>but it raises:</p>
  
  <pre><code> RSpec::Mocks::MockExpectationError: #&lt;#&lt;Class:0x007feb67a17750&gt;:0x007feb67c7adf8&gt; does not implement: name
  from spec-support-3.3.0/lib/rspec/support.rb:86:in `block in &lt;module:Support&gt;'
  </code></pre>
  
  <p>how to stub this method without defining it?</p>