From 96e1adbb2370563e0f0123e2706272c2a774adda Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Wed, 15 Dec 2010 15:16:36 -0500 Subject: [PATCH] minor: ensure index tests --- test/collection_test.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/test/collection_test.rb b/test/collection_test.rb index 807c534..5f08a83 100644 --- a/test/collection_test.rb +++ b/test/collection_test.rb @@ -578,13 +578,16 @@ class TestCollection < Test::Unit::TestCase @@test.ensure_index([["x", Mongo::ASCENDING]]) assert @@test.index_information.keys.include? "x_1" - @@test.drop_index("x_1") - assert_equal 2, @@test.index_information.keys.count - @@test.drop_index("x_-1") - assert_equal 1, @@test.index_information.keys.count + @@test.ensure_index([["type", 1], ["date", -1]]) + assert @@test.index_information.keys.include? "type_1_date_-1" - @@test.ensure_index([["x", Mongo::DESCENDING]], {}) #should work as not cached. + @@test.drop_index("x_1") + assert_equal 3, @@test.index_information.keys.count + @@test.drop_index("x_-1") assert_equal 2, @@test.index_information.keys.count + + @@test.ensure_index([["x", Mongo::DESCENDING]], {}) + assert_equal 3, @@test.index_information.keys.count assert @@test.index_information.keys.include? "x_-1" # Make sure that drop_index expires cache properly