refactor: move domain inline tests to separate files under tests/
Some checks failed
CI / Check / Test (push) Failing after 44s
Some checks failed
CI / Check / Test (push) Failing after 44s
Match the application crate convention: each source file references its tests via #[cfg(test)] #[path = "tests/filename.rs"] mod tests; with the test code in a sibling tests/ directory. - events.rs -> tests/events.rs - value_objects.rs -> tests/value_objects.rs - models/mod.rs -> models/tests/mod.rs (renamed from tests.rs) - models/person.rs -> models/tests/person.rs - models/goal.rs -> models/tests/goal.rs - models/watch_event.rs -> models/tests/watch_event.rs - services/review_history.rs -> services/tests/review_history.rs
This commit is contained in:
@@ -135,21 +135,5 @@ impl EventEnvelope {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::value_objects::UserId;
|
||||
|
||||
#[test]
|
||||
fn follow_accepted_matches() {
|
||||
let uid = UserId::from_uuid(uuid::Uuid::new_v4());
|
||||
let event = DomainEvent::FollowAccepted {
|
||||
local_user_id: uid.clone(),
|
||||
remote_actor_url: "https://remote.example/users/alice".to_string(),
|
||||
outbox_url: "https://remote.example/users/alice/outbox".to_string(),
|
||||
};
|
||||
let DomainEvent::FollowAccepted { outbox_url, .. } = event else {
|
||||
panic!("wrong variant");
|
||||
};
|
||||
assert_eq!(outbox_url, "https://remote.example/users/alice/outbox");
|
||||
}
|
||||
}
|
||||
#[path = "tests/events.rs"]
|
||||
mod tests;
|
||||
|
||||
Reference in New Issue
Block a user