Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

45 lines (35 sloc) 0.871 kB
require 'spec_helper'
describe Typhoeus::Requests::Operations do
let(:url) { "localhost:3001" }
let(:request) { Typhoeus::Request.new(url) }
describe "#run" do
let(:easy) { Ethon::Easy.new }
before { Typhoeus.expects(:get_easy).returns(easy) }
it "grabs an easy" do
request.run
end
it "generates settings" do
easy.expects(:http_request)
request.run
end
it "prepares" do
easy.expects(:prepare)
request.run
end
it "performs" do
easy.expects(:perform)
request.run
end
it "releases easy" do
Typhoeus.expects(:release_easy)
request.run
end
it "calls on_complete" do
request.instance_variable_set(:@on_complete, mock(:call))
request.run
end
it "returns a response" do
request.run.should be_a(Typhoeus::Response)
end
end
end
Jump to Line
Something went wrong with that request. Please try again.