summaryrefslogtreecommitdiffstats
path: root/src/actions/calendars.rs
blob: 72a8a7da83a30f408a29837c7518f1e55cb725c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use calendars;

pub fn action_list_calendars(_args: &[String]) -> Result<(), String> {
  for calendar in calendars::calendar_list() {
    khprintln!("{}", calendar);
  }

  Ok(())
}

#[cfg(test)]
mod integration {
  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());
  }
}