title: Can't stub Curl method
body: <p>Here's my test:</p>
  
  <pre><code># Custom validation method tests
    describe "#ticker_symbol" do
      before(:each) do
        o = OpenStruct.new(:body =&gt; '')
        Curl::Easy.any_instance.stub(:get).and_return(o)
      end
      it "should add an error" do
        subject
      end
    end
  </code></pre>
  
  <p>And the relevant part of my model:</p>
  
  <pre><code># Custom validation methods
    def ticker_symbol
      apiresponse = Curl.get("https://www.google.com/finance/info?infotype=infoquoteall&amp;q=" + ticker)
      debugger
      if apiresponse.body == ''
        errors.add(:ticker, "must be valid")
      end
    end
  </code></pre>
  
  <p>For some reason, apiresponse isn't what it should be:</p>
  
  <pre><code>apiresponse
  #&lt;Curl::Easy https://www.google.com/finance/info?infotype=infoq&gt;
  </code></pre>
  
  <p>Any idea why my stubbing isn't working?</p>