test(git): add more tests
This commit is contained in:
parent
896e1cba42
commit
c3a5e50ad5
2 changed files with 23 additions and 0 deletions
|
@ -9,6 +9,9 @@ mod repo_details;
|
|||
pub mod repository;
|
||||
pub mod validate;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
pub use commit::Commit;
|
||||
pub use fetch::fetch;
|
||||
pub use generation::Generation;
|
||||
|
|
20
crates/git/src/tests.rs
Normal file
20
crates/git/src/tests.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
mod commit {
|
||||
use crate::{commit, Commit};
|
||||
|
||||
#[test]
|
||||
fn should_return_sha() {
|
||||
let sha = commit::Sha::new("sha".to_string());
|
||||
let message = commit::Message::new("message".to_string());
|
||||
let commit = Commit::new(sha.clone(), message);
|
||||
|
||||
assert_eq!(commit.sha(), &sha);
|
||||
}
|
||||
#[test]
|
||||
fn should_return_message() {
|
||||
let sha = commit::Sha::new("sha".to_string());
|
||||
let message = commit::Message::new("message".to_string());
|
||||
let commit = Commit::new(sha, message.clone());
|
||||
|
||||
assert_eq!(commit.message(), &message);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue