Rename cache drivers, add memory driver, add tests and drone integration
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Tyler
2019-10-02 20:17:34 -04:00
parent 43fe2d6511
commit b396128a23
10 changed files with 411 additions and 32 deletions

38
redis_test.go Normal file
View File

@ -0,0 +1,38 @@
package cache
import (
"testing"
"time"
)
func Test_RedisURI(t *testing.T) {
cache, err := New("redis://redis")
if err != nil {
t.Fatal("Error creating cache:", err)
}
if _, ok := cache.(*RedisCache); !ok {
t.Fatal("Cache is not instance of RedisCache")
}
}
func Test_RedisStoreGet(t *testing.T) {
cache, err := New("redis://redis")
if err != nil {
t.Fatal("Error creating cache:", err)
}
obj := "test"
cache.Set("test", obj, time.Minute)
var new string
cache.Get("test", &new)
if obj != new {
t.Fatal("Expected", obj, "got", new)
}
}