Added cmd_sub tests

This commit is contained in:
James Booth
2014-12-25 00:05:13 +00:00
parent c47b4261f3
commit 9537592b52
3 changed files with 6 additions and 7 deletions

View File

@@ -7,20 +7,18 @@
#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 "command/commands.h"
void cmd_sub_shows_message_when_not_connected(void **state)
{
mock_cons_show();
CommandHelp *help = malloc(sizeof(CommandHelp));
gchar *args[] = { NULL };
mock_connection_status(JABBER_DISCONNECTED);
will_return(jabber_get_connection_status, JABBER_DISCONNECTED);
expect_cons_show("You are currently not connected.");
@@ -32,12 +30,11 @@ void cmd_sub_shows_message_when_not_connected(void **state)
void cmd_sub_shows_usage_when_no_arg(void **state)
{
mock_cons_show();
CommandHelp *help = malloc(sizeof(CommandHelp));
help->usage = "Some usage";
gchar *args[] = { NULL };
mock_connection_status(JABBER_CONNECTED);
will_return(jabber_get_connection_status, JABBER_CONNECTED);
expect_cons_show("Usage: Some usage");