From 2cbd402bae9f7507f18bc935989654ec813688a9 Mon Sep 17 00:00:00 2001 From: Chris Rhodes Date: Wed, 20 Jan 2016 23:45:36 -0800 Subject: [PATCH] Make InvalidToken test useful again. --- discord_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/discord_test.go b/discord_test.go index 28c21e9..1fe7e90 100644 --- a/discord_test.go +++ b/discord_test.go @@ -86,10 +86,16 @@ func TestNew(t *testing.T) { // TestInvalidToken tests the New() function with an invalid token func TestInvalidToken(t *testing.T) { - _, err := New("asjkldhflkjasdh") + d, err := New("asjkldhflkjasdh") if err != nil { t.Fatalf("New(InvalidToken) returned error: %+v", err) } + + // New with just a token does not do any communication, so attempt an api call. + _, err = d.UserSettings() + if err == nil { + t.Errorf("New(InvalidToken), d.UserSettings returned nil error.") + } } // TestInvalidUserPass tests the New() function with an invalid Email and Pass