forked from SierraSoftworks/sentry-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfingerprint_test.go
More file actions
37 lines (29 loc) · 875 Bytes
/
fingerprint_test.go
File metadata and controls
37 lines (29 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package sentry
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func ExampleFingerprint() {
cl := NewClient()
cl.Capture(
// You can specify a fingerprint that extends the default behaviour
Fingerprint("{{ default }}", "http://example.com/my.url"),
// Or you can define your own
Fingerprint("myrpc", "POST", "/foo.bar"),
)
}
func TestFingerprint(t *testing.T) {
Convey("Fingerprint", t, func() {
Convey("Fingerprint()", func() {
Convey("Should return an Option", func() {
So(Fingerprint("test"), ShouldImplement, (*Option)(nil))
})
})
Convey("Should use the correct class", func() {
So(Fingerprint("test").Class(), ShouldEqual, "fingerprint")
})
Convey("MarshalJSON", func() {
So(testOptionsSerialize(Fingerprint("test")), ShouldResemble, []interface{}{"test"})
})
})
}