40 lines
986 B
Go
40 lines
986 B
Go
|
package cache
|
||
|
|
||
|
import (
|
||
|
. "github.com/onsi/ginkgo/v2"
|
||
|
. "github.com/onsi/gomega"
|
||
|
"meow.tf/go/cacheinterface/v2/driver/lru"
|
||
|
"meow.tf/go/cacheinterface/v2/driver/memcache"
|
||
|
"meow.tf/go/cacheinterface/v2/driver/memory"
|
||
|
"meow.tf/go/cacheinterface/v2/driver/redis"
|
||
|
)
|
||
|
|
||
|
var _ = Describe("Cache test", func() {
|
||
|
Context("URI Parsing", func() {
|
||
|
It("Should parse a Redis URI", func() {
|
||
|
c, err := New("redis://")
|
||
|
|
||
|
Expect(err).To(BeNil())
|
||
|
Expect(c).To(BeAssignableToTypeOf(&redis.Cache{}))
|
||
|
})
|
||
|
It("Should parse a Memcache URI", func() {
|
||
|
c, err := New("memcache://")
|
||
|
|
||
|
Expect(err).To(BeNil())
|
||
|
Expect(c).To(BeAssignableToTypeOf(&memcache.Cache{}))
|
||
|
})
|
||
|
It("Should parse a LRU URI", func() {
|
||
|
c, err := New("lru://")
|
||
|
|
||
|
Expect(err).To(BeNil())
|
||
|
Expect(c).To(BeAssignableToTypeOf(&lru.Cache{}))
|
||
|
})
|
||
|
It("Should parse a Memory URI", func() {
|
||
|
c, err := New("memory://")
|
||
|
|
||
|
Expect(err).To(BeNil())
|
||
|
Expect(c).To(BeAssignableToTypeOf(&memory.Cache{}))
|
||
|
})
|
||
|
})
|
||
|
})
|