title: RSpec: Stubbing out calls for certain parameters
body: <p>I want to stub out a method only for a certain parameter. Say I have a class</p>
  
  <pre><code>class Foo
    def bar(i)
      i*2
    end
  end
  </code></pre>
  
  <p>Now I want to stub out the method bar only for calls with a value of say 3 and return the method return value in all other cases:</p>
  
  <pre><code>&gt;&gt; foo = Foo.new
  &gt;&gt; foo.bar(2)
  =&gt; 4
  &gt;&gt; foo.stub!(:bar).with(3).and_return(:borked)
  &gt;&gt; foo.bar(3)
  =&gt; :borked
  &gt;&gt; foo.bar(2)
  NoMethodError: undefined method `bar' for #&lt;Foo:0x10538e360&gt;
  </code></pre>
  
  <p>Is there a way to delegate execution to the method being stubbed out?</p>