Beispiel #1
0
package redis_test

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/app-kit/go-appkit/caches/redis"
	"github.com/app-kit/go-appkit/caches/tests"
)

var _ = Describe("Redis", func() {

	var redisCache *redis.Redis
	config := redis.Config{
		Address: "localhost:9999",
	}
	redisCache, _ = redis.New(config)

	It("Should create", func() {
		var err error
		redisCache, err = redis.New(config)
		Expect(err).ToNot(HaveOccurred())
	})

	tests.TestCache(redisCache)
})
Beispiel #2
0
package fs_test

import (
	"os"
	"path"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	"github.com/app-kit/go-appkit/caches/fs"
	"github.com/app-kit/go-appkit/caches/tests"
)

var _ = Describe("Redis", func() {
	tmpDir := path.Join(os.TempDir(), "appkit_caches_fs_test")
	cache, err := fs.New(tmpDir)
	if err != nil {
		panic(err)
	}

	It("Should create", func() {
		_, err := fs.New(tmpDir)
		Expect(err).ToNot(HaveOccurred())
	})

	tests.TestCache(cache)
})