aboutsummaryrefslogtreecommitdiff
path: root/macros/src/injectable/implementation.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-09-26 19:46:15 +0200
committerHampusM <hampus@hampusmat.com>2023-09-26 19:46:15 +0200
commitfe4255d765d24b3a62094a02d35077a1022887bb (patch)
treeee47f81339f569ec3b42d56778c9be514cb80ae4 /macros/src/injectable/implementation.rs
parent267ab1dc45c7e2cb68d8238c04376a258dcf61c9 (diff)
test: make unit tests not return Result
Diffstat (limited to 'macros/src/injectable/implementation.rs')
-rw-r--r--macros/src/injectable/implementation.rs49
1 files changed, 24 insertions, 25 deletions
diff --git a/macros/src/injectable/implementation.rs b/macros/src/injectable/implementation.rs
index b3e57c2..74a907e 100644
--- a/macros/src/injectable/implementation.rs
+++ b/macros/src/injectable/implementation.rs
@@ -870,7 +870,7 @@ mod tests
}
#[test]
- fn can_create_single_get_dep_method_call() -> Result<(), Box<dyn Error>>
+ fn can_create_single_get_dep_method_call()
{
let mut mock_dependency = MockIDependency::new();
@@ -893,10 +893,11 @@ mod tests
InjectableImpl::<MockIDependency>::create_single_get_dep_method_call(
&mock_dependency,
false,
- )?;
+ )
+ .unwrap();
assert_eq!(
- parse2::<Expr>(output)?,
+ parse2::<Expr>(output).unwrap(),
parse2::<Expr>(quote! {
#di_container_var_ident
.get_bound::<Foo>(
@@ -912,14 +913,13 @@ mod tests
reason: err,
dependency_name: "Foo"
})?
- })?
+ })
+ .unwrap()
);
-
- Ok(())
}
#[test]
- fn can_create_single_get_dep_method_call_with_name() -> Result<(), Box<dyn Error>>
+ fn can_create_single_get_dep_method_call_with_name()
{
let mut mock_dependency = MockIDependency::new();
@@ -944,10 +944,11 @@ mod tests
InjectableImpl::<MockIDependency>::create_single_get_dep_method_call(
&mock_dependency,
false,
- )?;
+ )
+ .unwrap();
assert_eq!(
- parse2::<Expr>(output)?,
+ parse2::<Expr>(output).unwrap(),
parse2::<Expr>(quote! {
#di_container_var_ident
.get_bound::<Foo>(
@@ -963,14 +964,13 @@ mod tests
reason: err,
dependency_name: "Foo"
})?
- })?
+ })
+ .unwrap()
);
-
- Ok(())
}
#[test]
- fn can_create_single_get_dep_method_call_async() -> Result<(), Box<dyn Error>>
+ fn can_create_single_get_dep_method_call_async()
{
let mut mock_dependency = MockIDependency::new();
@@ -993,10 +993,11 @@ mod tests
InjectableImpl::<MockIDependency>::create_single_get_dep_method_call(
&mock_dependency,
true,
- )?;
+ )
+ .unwrap();
assert_eq!(
- parse2::<Expr>(output)?,
+ parse2::<Expr>(output).unwrap(),
parse2::<Expr>(quote! {
#di_container_var_ident
.get_bound::<Foo>(
@@ -1013,15 +1014,13 @@ mod tests
reason: err,
dependency_name: "Foo"
})?
- })?
+ })
+ .unwrap()
);
-
- Ok(())
}
#[test]
- fn can_create_single_get_dep_method_call_async_with_name(
- ) -> Result<(), Box<dyn Error>>
+ fn can_create_single_get_dep_method_call_async_with_name()
{
let mut mock_dependency = MockIDependency::new();
@@ -1046,10 +1045,11 @@ mod tests
InjectableImpl::<MockIDependency>::create_single_get_dep_method_call(
&mock_dependency,
true,
- )?;
+ )
+ .unwrap();
assert_eq!(
- parse2::<Expr>(output)?,
+ parse2::<Expr>(output).unwrap(),
parse2::<Expr>(quote! {
#di_container_var_ident
.get_bound::<Foo>(
@@ -1066,9 +1066,8 @@ mod tests
reason: err,
dependency_name: "Foo"
})?
- })?
+ })
+ .unwrap()
);
-
- Ok(())
}
}