From 838e6e1f5bdf5b26524a2404b620fffe00394cd5 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 15 Dec 2013 23:22:22 +0000 Subject: Test "/account show" when no account does not exist --- tests/test_cmd_account.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests/test_cmd_account.c') diff --git a/tests/test_cmd_account.c b/tests/test_cmd_account.c index ee4fb673..33568bf8 100644 --- a/tests/test_cmd_account.c +++ b/tests/test_cmd_account.c @@ -84,3 +84,20 @@ void cmd_account_show_shows_usage_when_no_arg(void **state) free(help); } + +void cmd_account_show_shows_message_when_account_does_not_exist(void **state) +{ + CommandHelp *help = malloc(sizeof(CommandHelp)); + gchar *args[] = { "show", "account_name" }; + + expect_string(accounts_get_account, name, "account_name"); + will_return(accounts_get_account, NULL); + + expect_string(cons_show, output, "No such account."); + expect_string(cons_show, output, ""); + + gboolean result = cmd_account(args, *help); + assert_true(result); + + free(help); +} -- cgit 1.4.1-2-gfad0 td> Soul of a tiny new machine. More thorough tests → More comprehensible and rewrite-friendly software → More resilient society.Kartik K. Agaram <vc@akkartik.com>
about summary refs log blame commit diff stats
path: root/archive/1.vm/edit/004-programming-environment.mu
blob: dec8a2d5004751b136b28e5cd7bbf7c262e7b66b (plain) (tree)
1
2
3
4
5
6
7
8