reshape/tests/common.rs
2021-10-26 00:31:09 +02:00

16 lines
530 B
Rust

use postgres::{Client, NoTls};
use reshape::Reshape;
pub fn setup() -> (Reshape, Client, Client) {
let connection_string = std::env::var("POSTGRES_CONNECTION_STRING")
.unwrap_or("postgres://postgres:postgres@localhost/reshape_test".to_string());
let old_db = Client::connect(&connection_string, NoTls).unwrap();
let new_db = Client::connect(&connection_string, NoTls).unwrap();
let mut reshape = Reshape::new(&connection_string).unwrap();
reshape.remove().unwrap();
(reshape, old_db, new_db)
}