aboutsummaryrefslogtreecommitdiff
path: root/plugin/whoami/setup_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/whoami/setup_test.go')
-rw-r--r--plugin/whoami/setup_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/plugin/whoami/setup_test.go b/plugin/whoami/setup_test.go
new file mode 100644
index 000000000..73db67d88
--- /dev/null
+++ b/plugin/whoami/setup_test.go
@@ -0,0 +1,19 @@
+package whoami
+
+import (
+ "testing"
+
+ "github.com/mholt/caddy"
+)
+
+func TestSetupWhoami(t *testing.T) {
+ c := caddy.NewTestController("dns", `whoami`)
+ if err := setupWhoami(c); err != nil {
+ t.Fatalf("Expected no errors, but got: %v", err)
+ }
+
+ c = caddy.NewTestController("dns", `whoami example.org`)
+ if err := setupWhoami(c); err == nil {
+ t.Fatalf("Expected errors, but got: %v", err)
+ }
+}