Files
server/test/tmpdir_test.go
eternal-flame-AD e5b24f4c92 Add plugin feature
Fixed database migration
Added a plugin system based on the go plugin package
2019-02-09 12:52:01 +01:00

20 lines
429 B
Go

package test
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func TestTmpDir(t *testing.T) {
dir := NewTmpDir("test_prefix")
assert.NotEmpty(t, dir)
assert.Contains(t, dir.Path(), "test_prefix")
testFilePath := dir.Path("testfile.txt")
assert.Contains(t, testFilePath, "test_prefix")
assert.Contains(t, testFilePath, "testfile.txt")
assert.True(t, strings.HasPrefix(testFilePath, dir.Path()))
}