summaryrefslogtreecommitdiffstats
path: root/CLI/rust/src/game_of_life/opts/validators.rs
diff options
context:
space:
mode:
authora14m <[email protected]>2021-04-09 16:39:53 +0200
committera14m <[email protected]>2021-04-09 16:39:53 +0200
commitc9e64f9583b2d1fa4cd887ec4878b5414b2db37f (patch)
tree9410434359aecb71d171376f57ea313d3a966e9c /CLI/rust/src/game_of_life/opts/validators.rs
parent4bb3907a505ecbb29848e31aed7ced686757bf6f (diff)
Refactor terminal_size_wrapper to allow mocking in CI
Diffstat (limited to 'CLI/rust/src/game_of_life/opts/validators.rs')
-rw-r--r--CLI/rust/src/game_of_life/opts/validators.rs12
1 files changed, 2 insertions, 10 deletions
diff --git a/CLI/rust/src/game_of_life/opts/validators.rs b/CLI/rust/src/game_of_life/opts/validators.rs
index 5ea37e2..4abcc19 100644
--- a/CLI/rust/src/game_of_life/opts/validators.rs
+++ b/CLI/rust/src/game_of_life/opts/validators.rs
@@ -3,16 +3,8 @@
//! Used for validating different CLI args (like width, height and delay)
//! Ref: https://docs.rs/clap/3.0.0-beta.2/clap/struct.Arg.html#method.validator
-use terminal_size::{terminal_size, Height, Width};
-
-#[cfg(test)]
-use mocktopus::macros::mockable;
-
-/// An internal method used to allow mocking terminal size in tests
-#[cfg_attr(test, mockable)]
-fn terminal_size_wrapper() -> (Width, Height) {
- terminal_size().unwrap()
-}
+use terminal_size::{Height, Width};
+use super::terminal_size_wrapper;
/// Validator to check if width configuration can be used
///