Better tests organization

This commit is contained in:
Deluan
2016-02-27 18:42:08 -05:00
parent ecc0df9e7c
commit ce240cfeff
8 changed files with 54 additions and 35 deletions
+1
View File
@@ -0,0 +1 @@
-short
+7 -5
View File
@@ -4,6 +4,7 @@ import (
. "github.com/smartystreets/goconvey/convey"
_ "github.com/deluan/gosonic/tests"
"testing"
"github.com/deluan/gosonic/tests"
)
const (
@@ -11,11 +12,7 @@ const (
)
func TestCreateCollection(t *testing.T) {
if testing.Short() {
t.Skip("skipping test in short mode.")
}
dbInstance().Drop(testCollectionName)
tests.Init(t, true)
Convey("Given an empty DB", t, func() {
@@ -50,5 +47,10 @@ func TestCreateCollection(t *testing.T) {
So(allPaths, ShouldContainKey, "Name")
})
})
Reset(func() {
dbInstance().Drop(testCollectionName)
})
})
}