Browse Source

Update tests

master
Adrian Heine 9 months ago
parent
commit
136c348f01
  1. 2
      src/symbols/user.rs
  2. 4
      tests/setup.rs

2
src/symbols/user.rs

@ -74,6 +74,7 @@ mod test {
let symbol = User { let symbol = User {
user_name: "nonexisting", user_name: "nonexisting",
command_runner: StdCommandRunner, command_runner: StdCommandRunner,
home_path: "/home/nonexisting",
}; };
assert_eq!(run(symbol.target_reached()).unwrap(), false); assert_eq!(run(symbol.target_reached()).unwrap(), false);
} }
@ -83,6 +84,7 @@ mod test {
let symbol = User { let symbol = User {
user_name: "root", user_name: "root",
command_runner: StdCommandRunner, command_runner: StdCommandRunner,
home_path: "/root",
}; };
assert_eq!(run(symbol.target_reached()).unwrap(), true); assert_eq!(run(symbol.target_reached()).unwrap(), true);
} }

4
tests/setup.rs

@ -61,7 +61,7 @@ fn test(
#[test] #[test]
fn can_create_an_acme_user() { fn can_create_an_acme_user() {
let mut result = test(1, |setup| { let mut result = test(1, |setup| {
assert_eq!(&*(run(setup.add(AcmeUser)).unwrap().0).0, "acme");
assert_eq!(((run(setup.add(AcmeUser)).unwrap().0).0).0.as_ref(), "acme");
}); });
let entry = result let entry = result
.pop() .pop()
@ -127,7 +127,7 @@ fn can_create_an_acme_cert() {
.pop() .pop()
.expect("log is empty but should contain one entry"); .expect("log is empty but should contain one entry");
assert_eq!(entry.0, 3, "log entry has wrong level"); assert_eq!(entry.0, 3, "log entry has wrong level");
assert_eq!(entry.1.matches("run_symbol").count(), 19);
assert_eq!(entry.1.matches("run_symbol").count(), 18);
assert_eq!(result.len(), 0, "log has more than one entry"); assert_eq!(result.len(), 0, "log has more than one entry");
} }

Loading…
Cancel
Save