Skip to content

Commit 96e1adb

Browse files
committed
minor: ensure index tests
1 parent 8b1f20b commit 96e1adb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/collection_test.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,13 +578,16 @@ def test_ensure_index
578578
@@test.ensure_index([["x", Mongo::ASCENDING]])
579579
assert @@test.index_information.keys.include? "x_1"
580580

581+
@@test.ensure_index([["type", 1], ["date", -1]])
582+
assert @@test.index_information.keys.include? "type_1_date_-1"
583+
581584
@@test.drop_index("x_1")
582-
assert_equal 2, @@test.index_information.keys.count
585+
assert_equal 3, @@test.index_information.keys.count
583586
@@test.drop_index("x_-1")
584-
assert_equal 1, @@test.index_information.keys.count
585-
586-
@@test.ensure_index([["x", Mongo::DESCENDING]], {}) #should work as not cached.
587587
assert_equal 2, @@test.index_information.keys.count
588+
589+
@@test.ensure_index([["x", Mongo::DESCENDING]], {})
590+
assert_equal 3, @@test.index_information.keys.count
588591
assert @@test.index_information.keys.include? "x_-1"
589592

590593
# Make sure that drop_index expires cache properly

0 commit comments

Comments
 (0)