aboutsummaryrefslogtreecommitdiff
path: root/middleware/fs_test.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-09-05 09:32:11 +0100
committerGravatar GitHub <noreply@github.com> 2016-09-05 09:32:11 +0100
commiteea77cc97c5a9c8b6dc627cded263167e2da0efd (patch)
treed06bd297d79fe0745fdba5093cb5f0148d925ea5 /middleware/fs_test.go
parente750a4c1bde5e173b173a4b2d348d88a61f9caca (diff)
downloadcoredns-eea77cc97c5a9c8b6dc627cded263167e2da0efd.tar.gz
coredns-eea77cc97c5a9c8b6dc627cded263167e2da0efd.tar.zst
coredns-eea77cc97c5a9c8b6dc627cded263167e2da0efd.zip
Fs (#242)
* play around with fs idea * docs and fix test * better docs
Diffstat (limited to 'middleware/fs_test.go')
-rw-r--r--middleware/fs_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/middleware/fs_test.go b/middleware/fs_test.go
new file mode 100644
index 000000000..44133c4eb
--- /dev/null
+++ b/middleware/fs_test.go
@@ -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)
+ }
+}