Skip to content

Commit 85fc458

Browse files
committed
Move todo_file testutils to test_helpers
1 parent c3c646f commit 85fc458

File tree

7 files changed

+8
-10
lines changed

7 files changed

+8
-10
lines changed

src/module/modules.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl ModuleProvider for Modules {
6969
#[cfg(test)]
7070
mod tests {
7171
use super::*;
72-
use crate::{test_helpers::with_temp_repository, todo_file::testutil::with_todo_file};
72+
use crate::test_helpers::{with_temp_repository, with_todo_file};
7373

7474
pub(crate) fn modules_test<C>(callback: C)
7575
where C: FnOnce(Modules) {

src/test_helpers.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ mod with_event_handler;
1010
mod with_git_config;
1111
mod with_temp_bare_repository;
1212
mod with_temp_repository;
13+
mod with_todo_file;
1314

1415
pub(crate) static JAN_2021_EPOCH: i64 = 1_609_459_200;
1516

@@ -23,4 +24,5 @@ pub(crate) use self::{
2324
with_git_config::with_git_config,
2425
with_temp_bare_repository::with_temp_bare_repository,
2526
with_temp_repository::with_temp_repository,
27+
with_todo_file::{with_todo_file, TodoFileTestContext},
2628
};

src/todo_file/testutil.rs renamed to src/test_helpers/with_todo_file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl Debug for TodoFileTestContext {
1919
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
2020
f.debug_struct("TodoFileTestContext")
2121
.field("todo_file", &self.todo_file)
22-
.field("filepath", &self.todo_file.filepath)
22+
.field("filepath", &self.todo_file.get_filepath())
2323
.finish_non_exhaustive()
2424
}
2525
}

src/testutil/module_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use crate::{
44
input::Event,
55
module::{Module, State},
66
process::Results,
7-
test_helpers::{with_event_handler, EventHandlerTestContext},
8-
todo_file::{testutil::with_todo_file, TodoFile},
7+
test_helpers::{with_event_handler, with_todo_file, EventHandlerTestContext},
8+
todo_file::TodoFile,
99
view::{
1010
testutil::{with_view_state, TestContext as ViewContext},
1111
RenderContext,

src/testutil/process_test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ use crate::{
88
module::{self, ModuleHandler},
99
process::Process,
1010
runtime::ThreadStatuses,
11-
test_helpers::{with_event_handler, EventHandlerTestContext},
11+
test_helpers::{with_event_handler, with_todo_file, EventHandlerTestContext},
1212
testutil::{with_search, SearchTestContext},
13-
todo_file::testutil::with_todo_file,
1413
view::testutil::{with_view_state, TestContext as ViewContext},
1514
};
1615

src/todo_file.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ mod history;
1010
mod line;
1111
mod line_parser;
1212
mod search;
13-
#[cfg(test)]
14-
#[cfg(not(tarpaulin_include))]
15-
pub(crate) mod testutil;
1613
mod todo_file_options;
1714
mod utils;
1815

src/todo_file/search.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ mod tests {
160160
use claims::{assert_none, assert_some_eq};
161161

162162
use super::*;
163-
use crate::todo_file::testutil::with_todo_file;
163+
use crate::test_helpers::with_todo_file;
164164

165165
#[test]
166166
fn search_empty_rebase_file() {

0 commit comments

Comments
 (0)