spec/qsagi/queue_spec.rb in qsagi-0.0.1 vs spec/qsagi/queue_spec.rb in qsagi-0.0.2

- old
+ new

@@ -39,9 +39,22 @@ queue.pop.should == nil end end end + describe "length" do + it "returns the number of messages in the queue" do + ExampleQueue.connect do |queue| + queue.push("message") + queue.length.should == 1 + queue.push("message") + queue.length.should == 2 + queue.pop + queue.length.should == 1 + end + end + end + describe "pop" do it "automatically acks if :auto_ack is not passed in" do ExampleQueue.connect do |queue| queue.push("message") message = queue.pop