Stop miniredis after each test

This commit is contained in:
Joel Speed 2019-05-16 17:32:54 +01:00 committed by Brian Van Klaveren
parent bc3d75a2ed
commit 7e7bfb5daf

View File

@ -306,15 +306,19 @@ var _ = Describe("NewSessionStore", func() {
})
Context("with type 'redis'", func() {
var mr *miniredis.Miniredis
BeforeEach(func() {
mr, err := miniredis.Run()
if err != nil {
panic(err)
}
var err error
mr, err = miniredis.Run()
Expect(err).ToNot(HaveOccurred())
opts.Type = options.RedisSessionStoreType
opts.RedisConnectionURL = "redis://" + mr.Addr()
})
AfterEach(func() {
mr.Close()
})
It("creates a redis.SessionStore", func() {
ss, err := sessions.NewSessionStore(opts, cookieOpts)
Expect(err).NotTo(HaveOccurred())