Show message when alias already exists in /alias add

This commit is contained in:
James Booth
2014-01-23 22:38:12 +00:00
parent 8dbe300d72
commit e089ffb15c
6 changed files with 34 additions and 6 deletions

View File

@@ -94,6 +94,22 @@ void cmd_alias_add_adds_alias(void **state)
free(help);
}
void cmd_alias_add_shows_message_when_exists(void **state)
{
mock_cons_show();
CommandHelp *help = malloc(sizeof(CommandHelp));
gchar *args[] = { "add", "hc", "/help commands", NULL };
prefs_add_alias("hc", "/help commands");
expect_cons_show("Command alias /hc already exists.");
gboolean result = cmd_alias(args, *help);
assert_true(result);
free(help);
}
void cmd_alias_remove_removes_alias(void **state)
{
mock_cons_show();