forked from diesel-rs/diesel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase_drop.rs
More file actions
35 lines (27 loc) · 983 Bytes
/
Copy pathdatabase_drop.rs
File metadata and controls
35 lines (27 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use support::{database, project};
#[test]
fn database_drop_drops_database() {
let p = project("database_drop").build();
let db = database(&p.database_url()).create();
assert!(db.exists());
let result = p.command("database")
.arg("drop")
.run();
assert!(result.is_success(), "Result was unsuccessful {:?}", result);
assert!(result.stdout().contains("Dropping database:"),
"Unexpected stdout {}", result.stdout());
assert!(!db.exists());
}
#[test]
fn database_drop_does_not_print_to_stdout_if_no_db_exists() {
let p = project("database_drop_no_stdout").build();
let db = database(&p.database_url());
assert!(!db.exists());
let result = p.command("database")
.arg("drop")
.run();
assert!(result.is_success(), "Result was unsuccessful {:?}", result);
assert!(!result.stdout().contains("Dropping database:"),
"Unexpected stdout {}", result.stdout());
assert!(!db.exists());
}