do a db.error at the end of each teardown. hopefully this will fix the out of order messages that we've been experiencing

This commit is contained in:
Mike Dirolf 2009-03-13 17:09:19 -04:00
parent 1840c23364
commit 8bc4bb9962
8 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,7 @@ class AdminTest < Test::Unit::TestCase
def teardown def teardown
@admin.profiling_level = :off @admin.profiling_level = :off
@@coll.clear if @@coll @@coll.clear if @@coll
@@db.error
end end
def test_default_profiling_level def test_default_profiling_level

View File

@ -24,6 +24,7 @@ class ChunkTest < Test::Unit::TestCase
def teardown def teardown
@@chunks.clear @@chunks.clear
@@files.clear @@files.clear
@@db.error
end end
def test_pos def test_pos

View File

@ -19,6 +19,7 @@ class CursorTest < Test::Unit::TestCase
def teardown def teardown
@@coll.clear @@coll.clear
@@db.error
end end
def test_explain def test_explain

View File

@ -29,6 +29,7 @@ class DBTest < Test::Unit::TestCase
def teardown def teardown
@@users.clear if @@users @@users.clear if @@users
@@db.error
end end
def test_close def test_close

View File

@ -19,6 +19,7 @@ class DBAPITest < Test::Unit::TestCase
def teardown def teardown
@@coll.clear @@coll.clear
@@db.error
end end
def test_clear def test_clear

View File

@ -13,5 +13,6 @@ class DBConnectionTest < Test::Unit::TestCase
db = Mongo.new(host, port).db('ruby-mongo-demo') db = Mongo.new(host, port).db('ruby-mongo-demo')
coll = db.collection('test') coll = db.collection('test')
coll.clear coll.clear
db.error
end end
end end

View File

@ -22,6 +22,7 @@ class GridStoreTest < Test::Unit::TestCase
def teardown def teardown
@@chunks.clear @@chunks.clear
@@files.clear @@files.clear
@@db.error
end end
def test_exist def test_exist

View File

@ -13,6 +13,10 @@ class MongoTest < Test::Unit::TestCase
@mongo = Mongo.new(@host, @port) @mongo = Mongo.new(@host, @port)
end end
def teardown
@mongo.db('ruby-mongo-test').error
end
def test_database_info def test_database_info
@mongo.drop_database('ruby-mongo-info-test') @mongo.drop_database('ruby-mongo-info-test')
@mongo.db('ruby-mongo-info-test').collection('info-test').insert('a' => 1) @mongo.db('ruby-mongo-info-test').collection('info-test').insert('a' => 1)