about summary refs log tree commit diff stats
path: root/tests/test_cmd_alias.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-12-24 20:11:24 +0000
committerJames Booth <boothj5@gmail.com>2014-12-24 20:11:24 +0000
commit8b4c7e93b868366ca76cc630d39b71c28f1c0c9a (patch)
treecd7de3fd2c6ae183191a565ab7d6553547944bf9 /tests/test_cmd_alias.c
parent003002d6384c2a2bb73d6b33a89f82c9dfd700d0 (diff)
downloadprofani-tty-8b4c7e93b868366ca76cc630d39b71c28f1c0c9a.tar.gz
Added cmd_alias tests
Diffstat (limited to 'tests/test_cmd_alias.c')
-rw-r--r--tests/test_cmd_alias.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/tests/test_cmd_alias.c b/tests/test_cmd_alias.c
index 8666b1aa..10ab7f53 100644
--- a/tests/test_cmd_alias.c
+++ b/tests/test_cmd_alias.c
@@ -7,10 +7,9 @@
 #include <glib.h>
 
 #include "xmpp/xmpp.h"
-#include "xmpp/mock_xmpp.h"
 
 #include "ui/ui.h"
-#include "ui/mock_ui.h"
+#include "ui/stub_ui.h"
 
 #include "config/preferences.h"
 
@@ -19,7 +18,6 @@
 
 void cmd_alias_add_shows_usage_when_no_args(void **state)
 {
-    mock_cons_show();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     help->usage = "some usage";
     gchar *args[] = { "add", NULL };
@@ -34,7 +32,6 @@ void cmd_alias_add_shows_usage_when_no_args(void **state)
 
 void cmd_alias_add_shows_usage_when_no_value(void **state)
 {
-    mock_cons_show();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     help->usage = "some usage";
     gchar *args[] = { "add", "alias", NULL };
@@ -49,7 +46,6 @@ void cmd_alias_add_shows_usage_when_no_value(void **state)
 
 void cmd_alias_remove_shows_usage_when_no_args(void **state)
 {
-    mock_cons_show();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     help->usage = "some usage";
     gchar *args[] = { "remove", NULL };
@@ -64,7 +60,6 @@ void cmd_alias_remove_shows_usage_when_no_args(void **state)
 
 void cmd_alias_show_usage_when_invalid_subcmd(void **state)
 {
-    mock_cons_show();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     help->usage = "some usage";
     gchar *args[] = { "blah", NULL };
@@ -79,7 +74,6 @@ void cmd_alias_show_usage_when_invalid_subcmd(void **state)
 
 void cmd_alias_add_adds_alias(void **state)
 {
-    mock_cons_show();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "add", "hc", "/help commands", NULL };
 
@@ -97,7 +91,6 @@ void cmd_alias_add_adds_alias(void **state)
 
 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 };
 
@@ -115,7 +108,6 @@ void cmd_alias_add_shows_message_when_exists(void **state)
 
 void cmd_alias_remove_removes_alias(void **state)
 {
-    mock_cons_show();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "remove", "hn", NULL };
 
@@ -135,7 +127,6 @@ void cmd_alias_remove_removes_alias(void **state)
 
 void cmd_alias_remove_shows_message_when_no_alias(void **state)
 {
-    mock_cons_show();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "remove", "hn", NULL };
 
@@ -149,7 +140,6 @@ void cmd_alias_remove_shows_message_when_no_alias(void **state)
 
 void cmd_alias_list_shows_all_aliases(void **state)
 {
-    mock_cons_show_aliases();
     CommandHelp *help = malloc(sizeof(CommandHelp));
     gchar *args[] = { "list", NULL };
 
@@ -160,7 +150,7 @@ void cmd_alias_list_shows_all_aliases(void **state)
     prefs_add_alias("vn", "/vercheck off");
 
     // write a custom checker to check the correct list is passed
-    expect_cons_show_aliases();
+    expect_any(cons_show_aliases, aliases);
 
     gboolean result = cmd_alias(args, *help);
     assert_true(result);