mirror of
https://github.com/chatmail/core.git
synced 2026-05-01 20:36:31 +03:00
Refactor context creation to a builder pattern
This mainly refactors context creation to use a builder pattern. It also adds a logdir option to this builder patter but doesn't yet use this.
This commit is contained in:
@@ -219,7 +219,9 @@ struct TestContext {
|
||||
fn create_test_context() -> TestContext {
|
||||
let dir = tempdir().unwrap();
|
||||
let dbfile = dir.path().join("db.sqlite");
|
||||
let ctx = Context::new(Box::new(cb), "FakeOs".into(), dbfile).unwrap();
|
||||
let ctx = ContextBuilder::new(Box::new(cb), "FakeOs".into(), dbfile)
|
||||
.create()
|
||||
.unwrap();
|
||||
TestContext { ctx, dir }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user