aboutsummaryrefslogtreecommitdiff
path: root/src/command/help.rs
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-01-18 13:27:03 +0100
committerRuben Beltran del Rio <git@r.bdr.sh>2025-01-18 13:27:03 +0100
commit64296ca9c83011e3de4d9f1be02335d8eb1bfe95 (patch)
tree21d13b4689a2f52fc9d0b9077151cab0159d3cc6 /src/command/help.rs
parent760b30e71e565d4db2a3d8f25af0d05fa174e871 (diff)
Add tests for
Diffstat (limited to 'src/command/help.rs')
-rw-r--r--src/command/help.rs47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/command/help.rs b/src/command/help.rs
index b682fc0..da5831c 100644
--- a/src/command/help.rs
+++ b/src/command/help.rs
@@ -38,3 +38,50 @@ impl super::Command for Help {
"\t\t\t\tPrints this help"
}
}
+
+#[cfg(test)]
+mod tests {
+
+ use super::*;
+ use crate::command::Command;
+ use crate::configuration::Configuration;
+
+ #[test]
+ fn test_add_command() {
+ let help = Help::new();
+
+ let configuration = Configuration::new();
+ help.execute(None, &configuration, "")
+ .expect("Could not call help");
+ }
+
+ #[test]
+ fn help_before_dependencies() {
+ let help = Help::new();
+ let dependencies = help.before_dependencies();
+
+ assert_eq!(dependencies.len(), 0);
+ }
+
+ #[test]
+ fn help_after_dependencies() {
+ let help = Help::new();
+ let dependencies = help.after_dependencies();
+
+ assert_eq!(dependencies.len(), 0);
+ }
+
+ // These two tests feel pointless but I'm doing it for the coverage :p
+
+ #[test]
+ fn help_command_output() {
+ let help = Help::new();
+ help.command();
+ }
+
+ #[test]
+ fn help_help_output() {
+ let help = Help::new();
+ help.help();
+ }
+}