about summary refs log tree commit diff stats
path: root/tests/test_cmd_account.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-12-15 23:30:09 +0000
committerJames Booth <boothj5@gmail.com>2013-12-15 23:30:09 +0000
commitbf0870afe4a73521262a5363409d4f8bbf471c62 (patch)
tree81e85161f282f85d877bf92564f83fd3ca2778ee /tests/test_cmd_account.c
parent219780482638c7319e41c8557445fd2ff8775b57 (diff)
downloadprofani-tty-bf0870afe4a73521262a5363409d4f8bbf471c62.tar.gz
Test "/account add" with missing arg
Diffstat (limited to 'tests/test_cmd_account.c')
-rw-r--r--tests/test_cmd_account.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_cmd_account.c b/tests/test_cmd_account.c
index 1a14159d..842ad13f 100644
--- a/tests/test_cmd_account.c
+++ b/tests/test_cmd_account.c
@@ -120,3 +120,17 @@ void cmd_account_show_shows_message_when_account_exists(void **state)
 
     free(help);
 }
+
+void cmd_account_add_shows_usage_when_no_arg(void **state)
+{
+    CommandHelp *help = malloc(sizeof(CommandHelp));
+    help->usage = "some usage";
+    gchar *args[] = { "add", NULL };
+
+    expect_string(cons_show, output, "Usage: some usage");
+
+    gboolean result = cmd_account(args, *help);
+    assert_true(result);
+
+    free(help);
+}