From b6e362e778fb6d07840f1b40b59940c3368149a3 Mon Sep 17 00:00:00 2001 From: o2sh Date: Sat, 31 Dec 2022 22:11:20 +0100 Subject: [PATCH] remove test mod --- src/info/mod.rs | 2 -- src/info/test.rs | 12 ------------ src/info/title.rs | 9 ++++++++- 3 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 src/info/test.rs diff --git a/src/info/mod.rs b/src/info/mod.rs index 6ee185dfd..854ea2dce 100644 --- a/src/info/mod.rs +++ b/src/info/mod.rs @@ -32,8 +32,6 @@ mod git; pub mod info_field; pub mod langs; mod repo; -#[cfg(test)] -pub mod test; pub mod title; #[derive(Serialize)] diff --git a/src/info/test.rs b/src/info/test.rs deleted file mode 100644 index f78b4b897..000000000 --- a/src/info/test.rs +++ /dev/null @@ -1,12 +0,0 @@ -#[cfg(test)] -pub mod utils { - use anyhow::Result; - use git_repository::{open, Repository, ThreadSafeRepository}; - - pub fn repo(name: &str) -> Result { - let name = name.to_string(); - let repo_path = git_testtools::scripted_fixture_read_only(name).unwrap(); - let safe_repo = ThreadSafeRepository::open_opts(repo_path, open::Options::isolated())?; - Ok(safe_repo.to_thread_local()) - } -} diff --git a/src/info/title.rs b/src/info/title.rs index 30e1c569b..3d1d9577e 100644 --- a/src/info/title.rs +++ b/src/info/title.rs @@ -85,10 +85,17 @@ impl std::fmt::Display for Title { #[cfg(test)] mod tests { use super::*; - use crate::info::test::utils::repo; use anyhow::Result; + use git_repository::{open, Repository, ThreadSafeRepository}; use owo_colors::AnsiColors; + fn repo(name: &str) -> Result { + let name = name.to_string(); + let repo_path = git_testtools::scripted_fixture_read_only(name).unwrap(); + let safe_repo = ThreadSafeRepository::open_opts(repo_path, open::Options::isolated())?; + Ok(safe_repo.to_thread_local()) + } + #[test] fn test_get_git_username() -> Result<()> { let repo = repo("basic_repo.sh")?;