diff options
author | James Booth <boothj5@gmail.com> | 2014-03-08 00:19:21 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-03-08 00:19:21 +0000 |
commit | 2d54c565ce1fbcca5f14436e503ccced1495f2b5 (patch) | |
tree | 447b34414de2b8dc45cbc709f2db9ff08f6abd22 /tests/test_cmd_join.c | |
parent | f3fe1d34d2608bed06bdf0302656cde5b0107183 (diff) | |
download | profani-tty-2d54c565ce1fbcca5f14436e503ccced1495f2b5.tar.gz |
Added test to show usage when no room supplied to /join
Diffstat (limited to 'tests/test_cmd_join.c')
-rw-r--r-- | tests/test_cmd_join.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_cmd_join.c b/tests/test_cmd_join.c index ec9dfb58..88ca8c17 100644 --- a/tests/test_cmd_join.c +++ b/tests/test_cmd_join.c @@ -48,6 +48,25 @@ void cmd_join_shows_message_when_undefined(void **state) { test_with_connection_status(JABBER_UNDEFINED); } + +void cmd_join_shows_usage_when_no_args(void **state) +{ + mock_cons_show(); + CommandHelp *help = malloc(sizeof(CommandHelp)); + help->usage = "some usage"; + gchar *args[] = { NULL }; + + mock_connection_status(JABBER_CONNECTED); + + expect_cons_show("Usage: some usage"); + expect_cons_show(""); + + gboolean result = cmd_join(args, *help); + assert_true(result); + + free(help); +} + /* void cmd_connect_shows_usage_when_no_server_value(void **state) { |