Permalink
Browse files

30DaysOfTests: unknown command returns None internally

  • Loading branch information...
conradkdotcom committed Aug 28, 2017
1 parent 148b70c commit 667926137d9c53183574b5ad04da9191f1bed879
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/main-rooster.rs
View
@@ -160,6 +160,21 @@ fn command_from_name(name: &str) -> Option<&'static Command> {
None
}
mod test {
use super::command_from_name;
#[test]
fn test_command_from_name_returns_none_if_not_exists() {
assert!(command_from_name("haha").is_none());
}
#[test]
fn test_command_from_name_returns_some_if_exists() {
assert!(command_from_name("get").is_some());
}
}
fn open_password_file(filename: &str, create: bool) -> IoResult<File> {
let mut options = std::fs::OpenOptions::new();
options.read(true);

0 comments on commit 6679261

Please sign in to comment.