Skip to content

Commit 679b4d9

Browse files
Merge pull request #12 from theseus-rs/improve-code-coverage
test: update test code coverage
2 parents 58ca52f + 7ff20b8 commit 679b4d9

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

postgresql_embedded/tests/blocking.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,9 @@ use test_log::test;
99
#[test]
1010
fn test_lifecycle() -> Result<()> {
1111
let mut postgresql = PostgreSQL::default();
12-
let settings = postgresql.settings();
1312

14-
if settings.installation_dir.exists() {
15-
assert_eq!(Status::Installed, postgresql.status());
16-
} else {
17-
assert_eq!(Status::NotInstalled, postgresql.status());
18-
}
13+
let initial_statuses = [Status::NotInstalled, Status::Installed, Status::Stopped];
14+
assert!(initial_statuses.contains(&postgresql.status()));
1915

2016
postgresql.setup()?;
2117
assert_eq!(Status::Stopped, postgresql.status());

postgresql_embedded/tests/postgresql.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,9 @@ use test_log::test;
66

77
async fn lifecycle() -> Result<()> {
88
let mut postgresql = PostgreSQL::default();
9-
let settings = postgresql.settings();
109

11-
if settings.installation_dir.exists() {
12-
assert_eq!(Status::Installed, postgresql.status());
13-
} else {
14-
assert_eq!(Status::NotInstalled, postgresql.status());
15-
}
10+
let initial_statuses = [Status::NotInstalled, Status::Installed, Status::Stopped];
11+
assert!(initial_statuses.contains(&postgresql.status()));
1612

1713
postgresql.setup().await?;
1814
assert_eq!(Status::Stopped, postgresql.status());

0 commit comments

Comments
 (0)