28 lines
479 B
Go
28 lines
479 B
Go
|
package gpaste_test
|
||
|
|
||
|
import (
|
||
|
"path/filepath"
|
||
|
"testing"
|
||
|
|
||
|
"git.t-juice.club/torjus/gpaste"
|
||
|
)
|
||
|
|
||
|
func TestBoltUserStore(t *testing.T) {
|
||
|
tmpDir := t.TempDir()
|
||
|
newFunc := func() (func(), gpaste.UserStore) {
|
||
|
tmpFile := filepath.Join(tmpDir, randomString(8))
|
||
|
|
||
|
store, err := gpaste.NewBoltUserStore(tmpFile)
|
||
|
if err != nil {
|
||
|
t.Fatalf("Error creating store: %s", err)
|
||
|
}
|
||
|
cleanup := func() {
|
||
|
store.Close()
|
||
|
}
|
||
|
return cleanup, store
|
||
|
}
|
||
|
|
||
|
RunUserStoreTest(newFunc, t)
|
||
|
|
||
|
}
|