spec/multi_spec.rb in em-http-request-1.0.0 vs spec/multi_spec.rb in em-http-request-1.0.1
- old
+ new
@@ -25,18 +25,26 @@
EventMachine.stop
}
}
end
+ it "should require unique keys for each deferrable" do
+ lambda do
+ multi.add :df1, EM::DefaultDeferrable.new
+ multi.add :df1, EM::DefaultDeferrable.new
+ end.should raise_error("Duplicate Multi key")
+ end
+
+
describe "#requests" do
it "should return the added requests" do
request1 = stub('request1', :callback => nil, :errback => nil)
request2 = stub('request2', :callback => nil, :errback => nil)
multi.add :a, request1
multi.add :b, request2
- multi.requests.should == [ request1, request2 ]
+ multi.requests.should == {:a => request1, :b => request2}
end
end
describe "#responses" do
it "should have an empty :callback hash" do