aboutsummaryrefslogtreecommitdiff
path: root/src/di_container/blocking/binding
diff options
context:
space:
mode:
Diffstat (limited to 'src/di_container/blocking/binding')
-rw-r--r--src/di_container/blocking/binding/builder.rs44
1 files changed, 20 insertions, 24 deletions
diff --git a/src/di_container/blocking/binding/builder.rs b/src/di_container/blocking/binding/builder.rs
index 6f873d0..cd547d4 100644
--- a/src/di_container/blocking/binding/builder.rs
+++ b/src/di_container/blocking/binding/builder.rs
@@ -299,8 +299,6 @@ where
#[cfg(test)]
mod tests
{
- use std::error::Error;
-
use mockall::predicate::eq;
use super::*;
@@ -309,7 +307,7 @@ mod tests
use crate::test_utils::subjects;
#[test]
- fn can_bind_to() -> Result<(), Box<dyn Error>>
+ fn can_bind_to()
{
let mut mock_di_container = MockDIContainer::new();
@@ -330,14 +328,12 @@ mod tests
MockDependencyHistory::new,
);
- binding_builder.to::<subjects::Number>()?;
-
- Ok(())
+ binding_builder.to::<subjects::Number>().unwrap();
}
#[test]
#[cfg(feature = "factory")]
- fn can_bind_to_factory() -> Result<(), Box<dyn Error>>
+ fn can_bind_to_factory()
{
use crate as syrette;
use crate::factory;
@@ -366,21 +362,21 @@ mod tests
MockDependencyHistory::new,
);
- binding_builder.to_factory(&|_| {
- Box::new(move |_num, _text| {
- let user_manager: TransientPtr<dyn subjects::IUserManager> =
- TransientPtr::new(subjects::UserManager::new());
+ binding_builder
+ .to_factory(&|_| {
+ Box::new(move |_num, _text| {
+ let user_manager: TransientPtr<dyn subjects::IUserManager> =
+ TransientPtr::new(subjects::UserManager::new());
- user_manager
+ user_manager
+ })
})
- })?;
-
- Ok(())
+ .unwrap();
}
#[test]
#[cfg(feature = "factory")]
- fn can_bind_to_default_factory() -> Result<(), Box<dyn Error>>
+ fn can_bind_to_default_factory()
{
use syrette_macros::declare_default_factory;
@@ -408,15 +404,15 @@ mod tests
MockDependencyHistory::new,
);
- binding_builder.to_default_factory(&|_| {
- Box::new(move || {
- let user_manager: TransientPtr<dyn subjects::IUserManager> =
- TransientPtr::new(subjects::UserManager::new());
+ binding_builder
+ .to_default_factory(&|_| {
+ Box::new(move || {
+ let user_manager: TransientPtr<dyn subjects::IUserManager> =
+ TransientPtr::new(subjects::UserManager::new());
- user_manager
+ user_manager
+ })
})
- })?;
-
- Ok(())
+ .unwrap();
}
}