diff options
author | 2016-09-05 09:32:11 +0100 | |
---|---|---|
committer | 2016-09-05 09:32:11 +0100 | |
commit | eea77cc97c5a9c8b6dc627cded263167e2da0efd (patch) | |
tree | d06bd297d79fe0745fdba5093cb5f0148d925ea5 /middleware/fs_test.go | |
parent | e750a4c1bde5e173b173a4b2d348d88a61f9caca (diff) | |
download | coredns-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.go | 19 |
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) + } +} |