diff options
author | James Booth <boothj5@gmail.com> | 2014-01-18 22:45:24 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-01-18 22:45:24 +0000 |
commit | 21f0bd04a8a994dc71e45b8d4c8e98dcc225c68a (patch) | |
tree | 924081f386d86a007214878bdcc38b3ff7cdd2a3 /tests/test_cmd_connect.c | |
parent | 0ee6c7a6f1aff74c25821c8559998721f0b3b772 (diff) | |
download | profani-tty-21f0bd04a8a994dc71e45b8d4c8e98dcc225c68a.tar.gz |
Added cmd_connect test for repeated server property
Diffstat (limited to 'tests/test_cmd_connect.c')
-rw-r--r-- | tests/test_cmd_connect.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_cmd_connect.c b/tests/test_cmd_connect.c index 479e59f2..5f907e26 100644 --- a/tests/test_cmd_connect.c +++ b/tests/test_cmd_connect.c @@ -200,6 +200,25 @@ void cmd_connect_shows_message_when_port_contains_chars(void **state) free(help); } +void cmd_connect_shows_usage_when_server_provided_twice(void **state) +{ + stub_ui_ask_password(); + mock_cons_show(); + CommandHelp *help = malloc(sizeof(CommandHelp)); + help->usage = "some usage"; + gchar *args[] = { "user@server.org", "server", "server1", "server", "server2", NULL }; + + mock_connection_status(JABBER_DISCONNECTED); + + expect_cons_show("Usage: some usage"); + expect_cons_show(""); + + gboolean result = cmd_connect(args, *help); + assert_true(result); + + free(help); +} + void cmd_connect_when_no_account(void **state) { mock_cons_show(); |