File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed
postgresql_embedded/tests Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,9 @@ use test_log::test;
9
9
#[ test]
10
10
fn test_lifecycle ( ) -> Result < ( ) > {
11
11
let mut postgresql = PostgreSQL :: default ( ) ;
12
- let settings = postgresql. settings ( ) ;
13
12
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( ) ) ) ;
19
15
20
16
postgresql. setup ( ) ?;
21
17
assert_eq ! ( Status :: Stopped , postgresql. status( ) ) ;
Original file line number Diff line number Diff line change @@ -6,13 +6,9 @@ use test_log::test;
6
6
7
7
async fn lifecycle ( ) -> Result < ( ) > {
8
8
let mut postgresql = PostgreSQL :: default ( ) ;
9
- let settings = postgresql. settings ( ) ;
10
9
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( ) ) ) ;
16
12
17
13
postgresql. setup ( ) . await ?;
18
14
assert_eq ! ( Status :: Stopped , postgresql. status( ) ) ;
You can’t perform that action at this time.
0 commit comments