-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsendQueue_test.go
35 lines (28 loc) · 1.02 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
package sentry
import (
"testing"
"github.com/stretchr/testify/assert"
)
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) {
assert.Nil(t, UseSendQueue(nil), "it should return nil if no transport is provided")
q := NewSequentialSendQueue(0)
o := UseSendQueue(q)
assert.NotNil(t, o, "should not return a nil option")
assert.Implements(t, (*Option)(nil), o, "it should implement the Option interface")
assert.Equal(t, "sentry-go.sendqueue", o.Class(), "it should use the right option class")
if assert.Implements(t, (*Option)(nil), o, "it should implement the OmitableOption interface") {
oo := o.(OmitableOption)
assert.True(t, oo.Omit(), "it should always return true for calls to Omit()")
}
}