-
Notifications
You must be signed in to change notification settings - Fork 8
/
queue_test.go
38 lines (33 loc) · 896 Bytes
/
queue_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
package curlyq
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Queue", func() {
Describe("NewQueue", func() {
var q *queue
Context("When provided with a name", func() {
BeforeEach(func() {
q = newQueue(&queueOpts{
Name: "name",
})
})
It("Sets the correct path values", func() {
Expect(q.activeJobsList).To(Equal("name:active"))
Expect(q.consumersSet).To(Equal("name:consumers"))
Expect(q.deadJobsSet).To(Equal("name:dead"))
Expect(q.inflightJobsPrefix).To(Equal("name:inflight"))
Expect(q.jobDataHash).To(Equal("name:data"))
Expect(q.scheduledJobsSet).To(Equal("name:scheduled"))
Expect(q.signalList).To(Equal("name:signal"))
})
})
Context("When not provided with a name", func() {
It("Panics", func() {
Expect(func() {
newQueue(&queueOpts{})
}).To(Panic())
})
})
})
})