* play around with fs idea

* docs and fix test

* better docs
This commit is contained in:
Miek Gieben
2016-09-05 09:32:11 +01:00
committed by GitHub
parent e750a4c1bd
commit eea77cc97c
3 changed files with 65 additions and 1 deletions

19
middleware/fs_test.go Normal file
View File

@@ -0,0 +1,19 @@
package middleware
import (
"os"
"strings"
"testing"
)
func TestfsPath(t *testing.T) {
if actual := fsPath(); !strings.HasSuffix(actual, ".coredns") {
t.Errorf("Expected path to be a .coredns folder, got: %v", actual)
}
os.Setenv("COREDNSPATH", "testpath")
defer os.Setenv("COREDNSPATH", "")
if actual, expected := fsPath(), "testpath"; actual != expected {
t.Errorf("Expected path to be %v, got: %v", expected, actual)
}
}