-
Notifications
You must be signed in to change notification settings - Fork 166
/
all_specs_test.go
48 lines (39 loc) · 1.09 KB
/
all_specs_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
package workers
import (
"testing"
"github.com/customerio/gospec"
)
// You will need to list every spec in a TestXxx method like this,
// so that gotest can be used to run the specs. Later GoSpec might
// get its own command line tool similar to gotest, but for now this
// is the way to go. This shouldn't require too much typing, because
// there will be typically only one top-level spec per class/feature.
func TestAllSpecs(t *testing.T) {
r := gospec.NewRunner()
r.Parallel = false
r.BeforeEach = func() {
Configure(map[string]string{
"server": "localhost:6379",
"process": "1",
"database": "15",
"pool": "1",
})
conn := Config.Pool.Get()
conn.Do("flushdb")
conn.Close()
}
// List all specs here
r.AddSpec(WorkersSpec)
r.AddSpec(ConfigSpec)
r.AddSpec(MsgSpec)
r.AddSpec(FetchSpec)
r.AddSpec(WorkerSpec)
r.AddSpec(ManagerSpec)
r.AddSpec(ScheduledSpec)
r.AddSpec(EnqueueSpec)
r.AddSpec(MiddlewareSpec)
r.AddSpec(MiddlewareRetrySpec)
r.AddSpec(MiddlewareStatsSpec)
// Run GoSpec and report any errors to gotest's `testing.T` instance
gospec.MainGoTest(r, t)
}