From 9dd33575e6820d6404745da928bd254fca7cb3d5 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 2 Aug 2016 16:25:04 +0800 Subject: [PATCH] remove db file before testing. Signed-off-by: Bo-Yi Wu --- storage/buntdb/buntdb_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/buntdb/buntdb_test.go b/storage/buntdb/buntdb_test.go index 2cbef12..2753f2d 100644 --- a/storage/buntdb/buntdb_test.go +++ b/storage/buntdb/buntdb_test.go @@ -3,6 +3,7 @@ package buntdb import ( c "github.com/appleboy/gorush/config" "github.com/stretchr/testify/assert" + "os" "testing" ) @@ -11,6 +12,10 @@ func TestBuntDBEngine(t *testing.T) { config := c.BuildDefaultPushConf() + if _, err := os.Stat(config.Stat.BuntDB.Path); os.IsNotExist(err) { + os.RemoveAll(config.Stat.BuntDB.Path) + } + buntDB := New(config) buntDB.Init() buntDB.Reset()