Skip to content

Commit 15d8939

Browse files
unhappychoiceclaude
andcommitted
test: add new_test method to StageRepository for test isolation
StageRepository uses database operations, so add new_test() method that creates an in-memory database for testing, following the same pattern as other repository implementations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 43a2c61 commit 15d8939

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/domain/repositories/stage_repository.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ impl StageRepository {
1919
})
2020
}
2121

22+
/// Create a new repository with an in-memory database for testing
23+
#[doc(hidden)]
24+
pub fn new_test() -> Result<Self> {
25+
let database = Database::new_test()?;
26+
database.init()?;
27+
Ok(Self {
28+
database: Arc::new(Mutex::new(database)),
29+
})
30+
}
31+
2232
/// Get completed stages for a specific repository (excludes skipped/failed)
2333
pub fn get_completed_stages(
2434
&self,

0 commit comments

Comments
 (0)