summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Grunert <Sascha.Grunert@rohde-schwarz.com>2016-09-14 10:11:43 +0200
committerSascha Grunert <Sascha.Grunert@rohde-schwarz.com>2016-09-14 10:11:43 +0200
commit2e802ba9c99a6b05b03173fb435a3e486c9f7731 (patch)
treef0664bc8da5eaabb1766f954673f416956414d10
parent46a73f3bb9d93f492f18527595c0841f0482885e (diff)
Added more unit tests for preparation and hook installation
-rw-r--r--src/lib.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index de8ef87..773d986 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -661,7 +661,7 @@ mod tests {
#[test]
fn prepare_message_success_3() {
let journal = GitJournal::new(".").unwrap();
- assert!(journal.prepare("./tests/commit_messages/success_2").is_ok());
+ assert!(journal.prepare("./tests/commit_messages/failure_2").is_ok());
}
#[test]
@@ -669,4 +669,12 @@ mod tests {
let journal = GitJournal::new(".").unwrap();
assert!(journal.prepare("TEST").is_err());
}
+
+ #[test]
+ fn install_git_hook() {
+ let journal = GitJournal::new(".").unwrap();
+ assert!(journal.install_git_hook("test", "echo 1\n").is_ok());
+ assert!(journal.install_git_hook("test", "echo 1\n").is_ok());
+ assert!(journal.install_git_hook("test", "echo 2\n").is_ok());
+ }
}