drop test collection after test

pull/39/head
Michael Jansen 7 years ago
parent 77cbcf340d
commit d5a3c53b0e

@ -63,11 +63,15 @@ fn test_has_collection() {
let database = client.get_database("rust_test"); let database = client.get_database("rust_test");
database.get_collection("created_collection").drop().unwrap_or(()); database.get_collection("created_collection").drop().unwrap_or(());
const COLL_NAME: &'static str = "created_collection";
let collection = database.create_collection( let collection = database.create_collection(
"created_collection", COLL_NAME,
None None
).unwrap(); ).unwrap();
assert_eq!("created_collection", collection.get_name().to_mut()); assert_eq!(COLL_NAME, collection.get_name().to_mut());
assert!(database.has_collection("created_collection").unwrap()); assert!(database.has_collection(COLL_NAME).unwrap());
database.command_simple(doc!{ "drop": COLL_NAME}, None).unwrap();
} }
Loading…
Cancel
Save