remote: adding tests

This commit is contained in:
Armon Dadgar 2014-09-30 16:28:35 -07:00 committed by Mitchell Hashimoto
parent 29b3310a49
commit 7a530cdae5
1 changed files with 36 additions and 0 deletions

36
remote/remote_test.go Normal file
View File

@ -0,0 +1,36 @@
package remote
import (
"os"
"path/filepath"
"testing"
)
func TestEnsureDirectory(t *testing.T) {
err := EnsureDirectory()
if err != nil {
t.Fatalf("Err: %v", err)
}
cwd, _ := os.Getwd()
path := filepath.Join(cwd, LocalDirectory)
_, err = os.Stat(path)
if err != nil {
t.Fatalf("err: %v", err)
}
}
func TestHiddenStatePath(t *testing.T) {
path, err := HiddenStatePath()
if err != nil {
t.Fatalf("err: %v", err)
}
cwd, _ := os.Getwd()
expect := filepath.Join(cwd, LocalDirectory, HiddenStateFile)
if path != expect {
t.Fatalf("bad: %v", path)
}
}