diff options
author | James Booth <boothj5@gmail.com> | 2013-12-15 23:30:09 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-12-15 23:30:09 +0000 |
commit | bf0870afe4a73521262a5363409d4f8bbf471c62 (patch) | |
tree | 81e85161f282f85d877bf92564f83fd3ca2778ee /tests | |
parent | 219780482638c7319e41c8557445fd2ff8775b57 (diff) | |
download | profani-tty-bf0870afe4a73521262a5363409d4f8bbf471c62.tar.gz |
Test "/account add" with missing arg
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_cmd_account.c | 14 | ||||
-rw-r--r-- | tests/test_cmd_account.h | 1 | ||||
-rw-r--r-- | tests/testsuite.c | 1 |
3 files changed, 16 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); +} diff --git a/tests/test_cmd_account.h b/tests/test_cmd_account.h index 4109d807..9b7a4f4b 100644 --- a/tests/test_cmd_account.h +++ b/tests/test_cmd_account.h @@ -4,3 +4,4 @@ void cmd_account_list_shows_accounts(void **state); void cmd_account_show_shows_usage_when_no_arg(void **state); void cmd_account_show_shows_message_when_account_does_not_exist(void **state); void cmd_account_show_shows_message_when_account_exists(void **state); +void cmd_account_add_shows_usage_when_no_arg(void **state); diff --git a/tests/testsuite.c b/tests/testsuite.c index 404fa1a4..2c6789be 100644 --- a/tests/testsuite.c +++ b/tests/testsuite.c @@ -34,6 +34,7 @@ int main(int argc, char* argv[]) { unit_test(cmd_account_show_shows_usage_when_no_arg), unit_test(cmd_account_show_shows_message_when_account_does_not_exist), unit_test(cmd_account_show_shows_message_when_account_exists), + unit_test(cmd_account_add_shows_usage_when_no_arg), unit_test(cmd_rooms_shows_message_when_disconnected), unit_test(cmd_rooms_shows_message_when_disconnecting), |