Stop miniredis after each test
This commit is contained in:
parent
bc3d75a2ed
commit
7e7bfb5daf
@ -306,15 +306,19 @@ var _ = Describe("NewSessionStore", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
Context("with type 'redis'", func() {
|
Context("with type 'redis'", func() {
|
||||||
|
var mr *miniredis.Miniredis
|
||||||
BeforeEach(func() {
|
BeforeEach(func() {
|
||||||
mr, err := miniredis.Run()
|
var err error
|
||||||
if err != nil {
|
mr, err = miniredis.Run()
|
||||||
panic(err)
|
Expect(err).ToNot(HaveOccurred())
|
||||||
}
|
|
||||||
opts.Type = options.RedisSessionStoreType
|
opts.Type = options.RedisSessionStoreType
|
||||||
opts.RedisConnectionURL = "redis://" + mr.Addr()
|
opts.RedisConnectionURL = "redis://" + mr.Addr()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
AfterEach(func() {
|
||||||
|
mr.Close()
|
||||||
|
})
|
||||||
|
|
||||||
It("creates a redis.SessionStore", func() {
|
It("creates a redis.SessionStore", func() {
|
||||||
ss, err := sessions.NewSessionStore(opts, cookieOpts)
|
ss, err := sessions.NewSessionStore(opts, cookieOpts)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
|
Loading…
Reference in New Issue
Block a user