Added cmd_connect test for repeated port property

This commit is contained in:
James Booth
2014-01-18 22:50:17 +00:00
parent 21f0bd04a8
commit 91d4097df9
4 changed files with 26 additions and 0 deletions

View File

@@ -219,6 +219,25 @@ void cmd_connect_shows_usage_when_server_provided_twice(void **state)
free(help);
}
void cmd_connect_shows_usage_when_port_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", "port", "1111", "port", "1111", 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();