From 0065feab2673862d168a6271e680c6115a7e9a73 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Fri, 16 May 2025 22:05:55 +0200 Subject: Add tests for blog_status --- src/command/status/mod.rs | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src/command/status/mod.rs') diff --git a/src/command/status/mod.rs b/src/command/status/mod.rs index 3bad923..5b547bb 100644 --- a/src/command/status/mod.rs +++ b/src/command/status/mod.rs @@ -41,3 +41,51 @@ impl super::Command for Status { fn available_status_providers() -> Vec Result> { vec![configuration_status::status, blog_status::status] } + +#[cfg(test)] +mod tests { + + use super::*; + use crate::command::Command; + use crate::configuration::Configuration; + + #[test] + fn test_status_command() { + let status = Status::new(); + + let configuration = Configuration::new().unwrap(); + status + .execute(None, &configuration, "") + .expect("Could not call status"); + } + + #[test] + fn status_before_dependencies() { + let status = Status::new(); + let dependencies = status.before_dependencies(); + + assert_eq!(dependencies.len(), 0); + } + + #[test] + fn status_after_dependencies() { + let status = Status::new(); + let dependencies = status.after_dependencies(); + + assert_eq!(dependencies.len(), 0); + } + + // These two tests feel pointless but I'm doing it for the coverage :p + + #[test] + fn status_command_output() { + let status = Status::new(); + status.command(); + } + + #[test] + fn status_help_output() { + let status = Status::new(); + status.help(); + } +} -- cgit