test/collection_test.rb in jmongo-1.1.3 vs test/collection_test.rb in jmongo-1.1.4
- old
+ new
@@ -902,11 +902,20 @@
tail = Mongo::Cursor.new(col, :tailable => true, :order => [['$natural', 1]])
assert_raises Mongo::OperationFailure do
tail.next_document
end
end
-
+
it "should find using a tailable cursor" do
+ tail = Mongo::Cursor.new(@capped, :timeout => false, :tailable => true, :order => [['$natural', 1]])
+ 1000.times do
+ assert tail.next_document
+ end
+ assert true, tail.has_next?
+ assert_nil tail.next_document
+ end
+
+ it "should find using a tailable cursor with await_data" do
tail = Mongo::Cursor.new(@capped, :timeout => false, :tailable => true, :await_data => true, :order => [['$natural', 1]])
1000.times do
assert tail.next_document
end
assert true, tail.has_next?