From f2ac8f66358bac4bcc6f3588bb55ffba9d9fecac Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 21 Apr 2016 15:59:50 -0400 Subject: Add a test for the `AliasSearchError::NotFound` case When the given alias being searched for does not appear in the alias file, a `NotFound` error should be returned. --- src/tests.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src') diff --git a/src/tests.rs b/src/tests.rs index a6f2777..0a512a1 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -55,3 +55,18 @@ fn find_alias_in_file_email_already_exists() { ) ); } + +#[test] +fn find_alias_in_file_alias_is_new() { + assert_eq!( + Err(AliasSearchError::NotFound), + find_alias_in_file( + &Alias { + alias: "fry-philip".to_owned(), + name: "Philip Fry".to_owned(), + email: "".to_owned() + }, + "./testdata/aliases" + ) + ); +} -- cgit v1.2.3