mock_redirect_http (spec/spider/spider_instance_spec.rb)

    # File spec/spider/spider_instance_spec.rb, line 368
      def mock_redirect_http
        http_req = stub(:redirect? => true, :success? => false, :code => 404)
        http_req.expects(:[]).with('Location').returns('http://example.com/')
        http_req2 = stub(:redirect? => false, :success? => true, :code => 200)
        http_obj = mock(:use_ssl= => true)
        http_obj.expects(:start).
          yields(mock(:request => http_req)).returns(http_req)
        http_obj2 = mock(:use_ssl= => true)
        http_obj2.expects(:start).
          yields(mock(:request => http_req2)).returns(http_req2)
        Net::HTTP.expects(:new).times(2).returns(http_obj).then.returns(http_obj2)
      end