Sha256: 56b0871759a86905528fe57bbd1b70f2ba88e532833ca7c63f936c097b3baee8

Contents?: true

Size: 726 Bytes

Versions: 5

Compression:

Stored size: 726 Bytes

Contents

require 'spec_helper'

describe Typhoeus::Hydra::Addable do
  let(:hydra) { Typhoeus::Hydra.new() }
  let(:request) { Typhoeus::Request.new("localhost:3001", {:method => :get}) }

  it "asks easy factory for an easy" do
    multi = double
    Typhoeus::EasyFactory.should_receive(:new).with(request, hydra).and_return(double(:get => 1))
    hydra.should_receive(:multi).and_return(multi)
    multi.should_receive(:add).with(1)
    hydra.add(request)
  end

  it "adds easy to multi" do
    multi = double
    Typhoeus::EasyFactory.should_receive(:new).with(request, hydra).and_return(double(:get => 1))
    hydra.should_receive(:multi).and_return(multi)
    multi.should_receive(:add).with(1)
    hydra.add(request)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
typhoeus-0.6.8 spec/typhoeus/hydra/addable_spec.rb
typhoeus-0.6.7 spec/typhoeus/hydra/addable_spec.rb
typhoeus-0.6.6 spec/typhoeus/hydra/addable_spec.rb
typhoeus-0.6.5 spec/typhoeus/hydra/addable_spec.rb
typhoeus-0.6.4 spec/typhoeus/hydra/addable_spec.rb