Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex committed Aug 26, 2016
1 parent d8c20d2 commit 5eb509e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
22 changes: 20 additions & 2 deletions raygun4go_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,25 @@ func TestClient(t *testing.T) {
Convey("#User", func() {
u := "user"
c.User(u)
So(c.context.User, ShouldResemble, u)
So(c.context.User.Identifier, ShouldResemble, u)
})

Convey("#UserDetails", func() {
u := User {
Identifier: "user25",
IsAnonymous: false,
Email: "[email protected]",
FullName: "Robbie Raygun",
FirstName: "Robbie",
UUID: "123123-abcabc-123123",
}
c.UserDetails(u)
So(c.context.User.Identifier, ShouldEqual, u.Identifier)
So(c.context.User.IsAnonymous, ShouldEqual, u.IsAnonymous)
So(c.context.User.Email, ShouldEqual, u.Email)
So(c.context.User.FullName, ShouldEqual, u.FullName)
So(c.context.User.FirstName, ShouldEqual, u.FirstName)
So(c.context.User.UUID, ShouldEqual, u.UUID)
})

Convey("#HandleError", func() {
Expand All @@ -79,7 +97,7 @@ func TestClient(t *testing.T) {
c.context.Version = "goconvey"
c.context.Tags = []string{"golang", "test"}
c.context.CustomData = map[string]string{"foo": "bar"}
c.context.User = "Test User"
c.context.User = User { Identifier: "Test User" }
defer c.HandleError()
panic("Test: See if this works with Raygun")
})
Expand Down
2 changes: 1 addition & 1 deletion request_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type detailsData struct {
Tags []string `json:"tags"` // the tags from context
UserCustomData UserCustomData `json:"userCustomData"` // the custom data from the context
Request requestData `json:"request"` // the request from the context
User user `json:"user"` // the user from the context
User User `json:"user"` // the user from the context
Context context `json:"context"` // the identifier from the context
Client clientData `json:"client"` // information on this client
}
Expand Down
2 changes: 1 addition & 1 deletion request_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestErrorData(t *testing.T) {

func TestUser(t *testing.T) {
Convey("has an exported identifier", t, func() {
u := user{"test"}
u := User { Identifier: "test" }
So(u.Identifier, ShouldEqual, "test")
})
}
Expand Down

0 comments on commit 5eb509e

Please sign in to comment.