mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 16:54:15 -04:00
19
middleware/fs_test.go
Normal file
19
middleware/fs_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user