diff options
author | Tim Oram <dev@mitmaro.ca> | 2024-02-12 09:24:13 -0330 |
---|---|---|
committer | Tim Oram <dev@mitmaro.ca> | 2024-02-15 20:27:06 -0330 |
commit | 6d01674bc69b499412f5bc07712e3e4a02bfc9e8 (patch) | |
tree | 5b7f29351ffa3fa9e949ab2a072b5782c8e52222 | |
parent | fb22b8da99e1c8bf3b787844be8af3232d9c3aec (diff) |
Move create_commit to test_helpers
-rw-r--r-- | src/git/commit.rs | 4 | ||||
-rw-r--r-- | src/git/commit_diff_loader.rs | 5 | ||||
-rw-r--r-- | src/git/repository.rs | 5 | ||||
-rw-r--r-- | src/git/testutil.rs | 6 | ||||
-rw-r--r-- | src/test_helpers.rs | 7 | ||||
-rw-r--r-- | src/test_helpers/create_commit.rs (renamed from src/git/testutil/create_commit.rs) | 2 |
6 files changed, 15 insertions, 14 deletions
diff --git a/src/git/commit.rs b/src/git/commit.rs index 0d5cea5..195abae 100644 --- a/src/git/commit.rs +++ b/src/git/commit.rs @@ -120,9 +120,11 @@ mod tests { use super::*; use crate::{ - git::testutil::{create_commit, with_temp_repository, CreateCommitOptions}, + git::testutil::with_temp_repository, test_helpers::{ builders::{CommitBuilder, ReferenceBuilder}, + create_commit, + CreateCommitOptions, JAN_2021_EPOCH, }, }; diff --git a/src/git/commit_diff_loader.rs b/src/git/commit_diff_loader.rs index a43472f..60d48b4 100644 --- a/src/git/commit_diff_loader.rs +++ b/src/git/commit_diff_loader.rs @@ -165,10 +165,7 @@ mod tests { }; use super::*; - use crate::git::{ - testutil::{add_path_to_index, with_temp_repository}, - Origin, - }; + use crate::git::{testutil::with_temp_repository, Origin}; fn _format_status(status: &FileStatus) -> String { let s = match status.status() { diff --git a/src/git/repository.rs b/src/git/repository.rs index 545390d..3239d74 100644 --- a/src/git/repository.rs +++ b/src/git/repository.rs @@ -193,7 +193,10 @@ mod tests { use testutils::assert_err_eq; use super::*; - use crate::git::testutil::{create_commit, with_temp_bare_repository, with_temp_repository}; + use crate::{ + git::testutil::{with_temp_bare_repository, with_temp_repository}, + test_helpers::create_commit, + }; #[test] #[serial_test::serial] diff --git a/src/git/testutil.rs b/src/git/testutil.rs index 0d869a5..85de3ee 100644 --- a/src/git/testutil.rs +++ b/src/git/testutil.rs @@ -1,7 +1,3 @@ -mod create_commit; mod with_temp_repository; -pub(crate) use self::{ - create_commit::{create_commit, CreateCommitOptions}, - with_temp_repository::{with_temp_bare_repository, with_temp_repository}, -}; +pub(crate) use self::with_temp_repository::{with_temp_bare_repository, with_temp_repository}; diff --git a/src/test_helpers.rs b/src/test_helpers.rs index 81f04a9..68d8e0b 100644 --- a/src/test_helpers.rs +++ b/src/test_helpers.rs @@ -1,8 +1,13 @@ pub(crate) mod builders; +mod create_commit; mod create_invalid_utf; pub(crate) mod mocks; mod with_git_config; pub(crate) static JAN_2021_EPOCH: i64 = 1_609_459_200; -pub(crate) use self::{create_invalid_utf::invalid_utf, with_git_config::with_git_config}; +pub(crate) use self::{ + create_commit::{create_commit, CreateCommitOptions}, + create_invalid_utf::invalid_utf, + with_git_config::with_git_config, +}; diff --git a/src/git/testutil/create_commit.rs b/src/test_helpers/create_commit.rs index 9b1062e..03f51fa 100644 --- a/src/git/testutil/create_commit.rs +++ b/src/test_helpers/create_commit.rs @@ -1,5 +1,3 @@ -#![cfg(not(tarpaulin_include))] - use std::path::Path; use lazy_static::lazy_static; |