From d5a3c53b0e364aed23fb48e5c89aef7efac7f6d8 Mon Sep 17 00:00:00 2001 From: Michael Jansen Date: Tue, 15 May 2018 16:46:49 -0400 Subject: [PATCH] drop test collection after test --- tests/database.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/database.rs b/tests/database.rs index 492a462..91941ab 100644 --- a/tests/database.rs +++ b/tests/database.rs @@ -63,11 +63,15 @@ fn test_has_collection() { let database = client.get_database("rust_test"); database.get_collection("created_collection").drop().unwrap_or(()); + const COLL_NAME: &'static str = "created_collection"; + let collection = database.create_collection( - "created_collection", + COLL_NAME, None ).unwrap(); - assert_eq!("created_collection", collection.get_name().to_mut()); - assert!(database.has_collection("created_collection").unwrap()); + assert_eq!(COLL_NAME, collection.get_name().to_mut()); + assert!(database.has_collection(COLL_NAME).unwrap()); + + database.command_simple(doc!{ "drop": COLL_NAME}, None).unwrap(); } \ No newline at end of file