From a30d3bf4d72aef572a1794d3eb002fd518a56b2b Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 23 Apr 2024 06:14:23 -0500 Subject: [PATCH] fix(tryfn)!: Remove Action overriding, deferring to Assert overriding --- crates/tryfn/src/lib.rs | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/crates/tryfn/src/lib.rs b/crates/tryfn/src/lib.rs index e2d82f0e..14a66ff5 100644 --- a/crates/tryfn/src/lib.rs +++ b/crates/tryfn/src/lib.rs @@ -41,7 +41,6 @@ use libtest_mimic::Trial; -pub use snapbox::assert::Action; pub use snapbox::data::DataFormat; pub use snapbox::Data; @@ -102,19 +101,11 @@ where self } - /// Read the failure action from an environment variable - pub fn action_env(mut self, var_name: &str) -> Self { - self.config = self.config.action_env(var_name); - self - } - - /// Override the failure action - pub fn action(mut self, action: Action) -> Self { - self.config = self.config.action(action); - self - } - /// Customize the assertion behavior + /// + /// Includes + /// - Configuring redactions + /// - Override updating environment vaeiable pub fn with_assert(mut self, config: snapbox::Assert) -> Self { self.config = config; self @@ -156,7 +147,9 @@ where config.try_eq(case.expected.clone(), actual, Some(&case.name))?; Ok(()) }) - .with_ignored_flag(shared_config.selected_action() == Action::Ignore) + .with_ignored_flag( + shared_config.selected_action() == snapbox::assert::Action::Ignore, + ) }) .collect();