From c47c66f17e6f4631a2a07b2a18781860525246d6 Mon Sep 17 00:00:00 2001 From: Jim Menard Date: Thu, 5 Feb 2009 13:53:46 -0500 Subject: [PATCH] new multi-field index test; clean up after index creation --- tests/test_db_api.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_db_api.rb b/tests/test_db_api.rb index 92ad1db..255c29a 100644 --- a/tests/test_db_api.rb +++ b/tests/test_db_api.rb @@ -270,6 +270,21 @@ class DBAPITest < Test::Unit::TestCase info = list[0] assert_equal 'index_name', info[:name] assert_equal 1, info[:keys]['a'] + ensure + @@db.drop_index(@@coll.name, 'index_name') + end + + def test_multiple_index_cols + @@db.create_index(@@coll.name, 'index_name', ['a', 'b', 'c']) + list = @@db.index_information(@@coll.name) + assert_equal 1, list.length + + info = list[0] + assert_equal 'index_name', info[:name] + keys = info[:keys].keys + assert_equal ['a', 'b', 'c'], keys.sort + ensure + @@db.drop_index(@@coll.name, 'index_name') end def test_array