title: Stub a setter on RSpec instance_double
body: <p>In an RSpec unit test I have a mock defined like this:</p>
  
  <pre><code>let(:point) { instance_double("Point", :to_coords =&gt; [3,2]) }
  </code></pre>
  
  <p>In the Point class I also have a setter, which is used in the class under test (which is called <code>Robot</code>). I would like to stub that setter to test <code>Robot#move</code>. Here's the wrong code I have so far:</p>
  
  <pre><code>describe "#move" do
    it "sets @x and @y one step forward in the direction the robot is facing" do
      point.stub(:coords=).and_return([4,2])
      robot.move
      expect(robot.position).to eq([4,2])
    end
  end
  </code></pre>
  
  <p>Here's the error message I get:</p>
  
  <p><code>Double "Point (instance)" received unexpected message :stub with (:coords=)</code></p>