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