forked from SierraSoftworks/sentry-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsendQueue_test.go
47 lines (39 loc) · 1.19 KB
/
sendQueue_test.go
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
38
39
40
41
42
43
44
45
46
47
package sentry
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func ExampleUseSendQueue() {
cl := NewClient(
// You can override the send queue on your root client
// All of its derived clients will inherit this queue
UseSendQueue(NewSequentialSendQueue(10)),
)
cl.With(
// Or you can override it on a derived client
UseSendQueue(NewSequentialSendQueue(10)),
)
}
func TestSendQueue(t *testing.T) {
Convey("SendQueue", t, func() {
Convey("UseSendQueue()", func() {
Convey("Should return an Option", func() {
q := NewSequentialSendQueue(0)
So(UseSendQueue(q), ShouldImplement, (*Option)(nil))
})
Convey("Should return nil if no queue is provided", func() {
So(UseSendQueue(nil), ShouldEqual, nil)
})
Convey("Should use the correct Class()", func() {
q := NewSequentialSendQueue(0)
So(UseSendQueue(q).Class(), ShouldEqual, "sentry-go.sendqueue")
})
Convey("Should implement Omit() and always return true", func() {
q := NewSequentialSendQueue(0)
o := UseSendQueue(q)
So(o, ShouldImplement, (*OmitableOption)(nil))
So(o.(OmitableOption).Omit(), ShouldBeTrue)
})
})
})
}