-
Notifications
You must be signed in to change notification settings - Fork 1
/
configuration_test.go
55 lines (45 loc) · 1021 Bytes
/
configuration_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
48
49
50
51
52
53
54
55
package quirk
import (
"testing"
. "github.com/franela/goblin"
)
func BenchmarkWithLogger(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = WithLogger(NewDebugLogger())
}
}
func BenchmarkWithPredicateKey(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = WithPredicateKey("key")
}
}
func TestWithLogger(t *testing.T) {
g := Goblin(t)
g.Describe("Logger", func() {
dl := NewDebugLogger()
g.It("should equal a debug logger", func() {
g.Assert(NewClient(WithLogger(dl)).logger).
Equal(dl)
})
})
}
func TestWithPredicateKey(t *testing.T) {
g := Goblin(t)
g.Describe("Predicate key", func() {
key := "customKey"
g.It("should equal customKey", func() {
g.Assert(NewClient(WithPredicateKey(key)).predicateKey).
Equal(key)
})
})
}
func TestWithMaxWorkerCount(t *testing.T) {
g := Goblin(t)
g.Describe("Client max worker count", func() {
count := 2
g.It("should equal count", func() {
g.Assert(NewClient(WithMaxWorkerCount(count)).maxWorkerCount).
Equal(count)
})
})
}