Skip to content

Commit

Permalink
Missing token file data test.
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAdam committed May 26, 2014
1 parent 10dc83e commit 36b0a64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@ import (
"testing"
)

func TestAuthenticateMissingTokenDataError(t *testing.T) {
client := NewClient()

file := "test_data/tokens.json"
err := client.Authenticate(&file)
if err.Error() != "Missing App token" {
t.Errorf("Expecting error \"Missing App token\", got %v", err)
}
}

func TestTwitterErrorOutput(t *testing.T) {
err := &TwitterError{
Id: 101,
Msg: "Error message",
}

if err.Error() != "Error message (101)" {
t.Errorf("Expecting %v, got %v", err, "Error message (101)")
t.Errorf("Expecting \"Error message (101)\", got %v", err)
}
}
1 change: 1 addition & 0 deletions test_data/tokens.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}

0 comments on commit 36b0a64

Please sign in to comment.