From b28ebe3007afbe3c581eb54df4c0baa26a9f508f Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 3 Aug 2022 14:39:59 +0200 Subject: test: correct DI container bind tests --- src/di_container.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/di_container.rs b/src/di_container.rs index c33d339..239a2cb 100644 --- a/src/di_container.rs +++ b/src/di_container.rs @@ -482,7 +482,7 @@ mod tests } #[test] - fn can_bind_to() + fn can_bind_to() -> error_stack::Result<(), BindingBuilderError> { let mut di_container: DIContainer = DIContainer::new(); @@ -490,9 +490,11 @@ mod tests di_container .bind::() - .to::(); + .to::()?; assert_eq!(di_container.bindings.count(), 1); + + Ok(()) } #[test] @@ -513,7 +515,7 @@ mod tests #[test] #[cfg(feature = "factory")] - fn can_bind_to_factory() + fn can_bind_to_factory() -> error_stack::Result<(), BindingBuilderError> { type IUserManagerFactory = dyn crate::interfaces::factory::IFactory<(), dyn subjects::IUserManager>; @@ -527,9 +529,11 @@ mod tests TransientPtr::new(subjects::UserManager::new()); user_manager - }); + })?; assert_eq!(di_container.bindings.count(), 1); + + Ok(()) } #[test] -- cgit v1.2.3-18-g5258