spec/ethon/multi/stack_spec.rb in ethon-0.7.0 vs spec/ethon/multi/stack_spec.rb in ethon-0.7.1
- old
+ new
@@ -13,11 +13,11 @@
end
end
context "when easy new" do
it "adds easy to multi" do
- Ethon::Curl.should_receive(:multi_add_handle).and_return(:ok)
+ expect(Ethon::Curl).to receive(:multi_add_handle).and_return(:ok)
multi.add(easy)
end
it "adds easy to easy_handles" do
multi.add(easy)
@@ -25,11 +25,11 @@
end
end
context "when multi_add_handle fails" do
it "raises multi add error" do
- Ethon::Curl.should_receive(:multi_add_handle).and_return(:bad_easy_handle)
+ expect(Ethon::Curl).to receive(:multi_add_handle).and_return(:bad_easy_handle)
expect{ multi.add(easy) }.to raise_error(Ethon::Errors::MultiAdd)
end
end
context "when multi cleaned up before" do
@@ -43,11 +43,11 @@
describe "#delete" do
context "when easy in easy_handles" do
before { multi.add(easy) }
it "deletes easy from multi" do
- Ethon::Curl.should_receive(:multi_remove_handle).and_return(:ok)
+ expect(Ethon::Curl).to receive(:multi_remove_handle).and_return(:ok)
multi.delete(easy)
end
it "deletes easy from easy_handles" do
multi.delete(easy)
@@ -55,11 +55,11 @@
end
end
context "when easy is not in easy_handles" do
it "does nothing" do
- Ethon::Curl.should_receive(:multi_add_handle).and_return(:ok)
+ expect(Ethon::Curl).to receive(:multi_add_handle).and_return(:ok)
multi.add(easy)
end
it "adds easy to easy_handles" do
multi.add(easy)
@@ -69,10 +69,10 @@
context "when multi_remove_handle fails" do
before { multi.add(easy) }
it "raises multi remove error" do
- Ethon::Curl.should_receive(:multi_remove_handle).and_return(:bad_easy_handle)
+ expect(Ethon::Curl).to receive(:multi_remove_handle).and_return(:bad_easy_handle)
expect{ multi.delete(easy) }.to raise_error(Ethon::Errors::MultiRemove)
end
end
end
end