Another big refactor: Back to a single folder for persistence implementation

This commit is contained in:
Deluan
2020-01-14 18:23:29 -05:00
parent 08e096c569
commit a99c3a8af3
27 changed files with 177 additions and 171 deletions
+31
View File
@@ -0,0 +1,31 @@
package persistence
import (
"github.com/cloudsonic/sonic-server/scanner"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("ChecksumRepository", func() {
var repo scanner.CheckSumRepository
BeforeEach(func() {
Db().Delete(&Checksum{ID: checkSumId})
repo = NewCheckSumRepository()
err := repo.SetData(map[string]string{
"a": "AAA", "b": "BBB",
})
if err != nil {
panic(err)
}
})
It("can retrieve data", func() {
Expect(repo.Get("b")).To(Equal("BBB"))
})
It("persists data", func() {
newRepo := NewCheckSumRepository()
Expect(newRepo.Get("b")).To(Equal("BBB"))
})
})