diff options
author | Vincent Breitmoser <look@my.amazin.horse> | 2019-01-17 11:42:49 +0100 |
---|---|---|
committer | Vincent Breitmoser <look@my.amazin.horse> | 2019-01-17 11:42:49 +0100 |
commit | f54c1b81ea64be07e75609bf919729ed4f0cf877 (patch) | |
tree | d274536ed5009d743578db713a1c49b260428263 /src/actions/calendars.rs | |
parent | 4fcfa895992fb9865e95bb96b751b25348bdf28e (diff) |
add "get" action
Diffstat (limited to 'src/actions/calendars.rs')
-rw-r--r-- | src/actions/calendars.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/actions/calendars.rs b/src/actions/calendars.rs new file mode 100644 index 0000000..0319a90 --- /dev/null +++ b/src/actions/calendars.rs @@ -0,0 +1,25 @@ +use calendars; + +pub fn action_list_calendars(_args: &[String]) -> Result<(), String> { + for calendar in calendars::calendar_list() { + khprintln!("{}", calendar); + } + + Ok(()) +} + +#[cfg(test)] +mod tests { + use super::*; + + use testutils; + + #[test] + fn test() { + let _testdir = testutils::prepare_testdir("testdir_two_cals"); + + action_list_calendars(&[]).unwrap(); + + assert_eq!("second\nsecond/second_sub\nfirst\n", testutils::test_stdout_clear()); + } +} |