aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-08-01 17:56:49 +0200
committerHampusM <hampus@hampusmat.com>2023-08-01 17:56:49 +0200
commitf7975f33978142461e67f5ebb2e478aa89c42d21 (patch)
tree6aba0b9396563e59bf7a5140d934ffa81924fe0a /src
parent29df52ee4521b644ea50ce8da65032158ccb23a4 (diff)
test: clean up binding configurator unit tests
Diffstat (limited to 'src')
-rw-r--r--src/di_container/asynchronous/binding/scope_configurator.rs8
-rw-r--r--src/di_container/asynchronous/binding/when_configurator.rs8
-rw-r--r--src/di_container/blocking/binding/scope_configurator.rs5
-rw-r--r--src/di_container/blocking/binding/when_configurator.rs5
4 files changed, 10 insertions, 16 deletions
diff --git a/src/di_container/asynchronous/binding/scope_configurator.rs b/src/di_container/asynchronous/binding/scope_configurator.rs
index 2271a16..eaedcbe 100644
--- a/src/di_container/asynchronous/binding/scope_configurator.rs
+++ b/src/di_container/asynchronous/binding/scope_configurator.rs
@@ -170,9 +170,9 @@ mod tests
mocks::MockDependencyHistory::new,
);
- assert!(matches!(
- binding_scope_configurator.in_singleton_scope().await,
- Ok(_)
- ));
+ assert!(binding_scope_configurator
+ .in_singleton_scope()
+ .await
+ .is_ok());
}
}
diff --git a/src/di_container/asynchronous/binding/when_configurator.rs b/src/di_container/asynchronous/binding/when_configurator.rs
index fb14bd4..c1bb8c5 100644
--- a/src/di_container/asynchronous/binding/when_configurator.rs
+++ b/src/di_container/asynchronous/binding/when_configurator.rs
@@ -103,9 +103,9 @@ mod tests
mocks::MockDependencyHistory,
>::new(Arc::new(di_container_mock));
- assert!(matches!(
- binding_when_configurator.when_named("awesome").await,
- Ok(_)
- ));
+ assert!(binding_when_configurator
+ .when_named("awesome")
+ .await
+ .is_ok());
}
}
diff --git a/src/di_container/blocking/binding/scope_configurator.rs b/src/di_container/blocking/binding/scope_configurator.rs
index ede0f6b..af231ef 100644
--- a/src/di_container/blocking/binding/scope_configurator.rs
+++ b/src/di_container/blocking/binding/scope_configurator.rs
@@ -161,9 +161,6 @@ mod tests
mocks::MockDependencyHistory::new,
);
- assert!(matches!(
- binding_scope_configurator.in_singleton_scope(),
- Ok(_)
- ));
+ assert!(binding_scope_configurator.in_singleton_scope().is_ok());
}
}
diff --git a/src/di_container/blocking/binding/when_configurator.rs b/src/di_container/blocking/binding/when_configurator.rs
index 656d81d..82f12f2 100644
--- a/src/di_container/blocking/binding/when_configurator.rs
+++ b/src/di_container/blocking/binding/when_configurator.rs
@@ -101,9 +101,6 @@ mod tests
mocks::MockDependencyHistory,
>::new(Rc::new(di_container_mock));
- assert!(matches!(
- binding_when_configurator.when_named("cool"),
- Ok(_)
- ));
+ assert!(binding_when_configurator.when_named("cool").is_ok());
}
}