Added minimal-responses plugin (#4417)

* Added minimal-responses plugin

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Removed unnecessary comments

* Updated tests

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Reformated imports

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Updated package name

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Removed  unnecessary comments

Co-authored-by: Miek Gieben <miek@miek.nl>

* Added changes

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* updated

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Updated comment for NextOrFailure

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Updated to test.Case for testing

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Formated imports using goimports

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

Co-authored-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Soumya Ghosh Dastidar
2021-03-15 20:07:55 +05:30
committed by GitHub
parent 74ef6e00f1
commit 7651e6c4de
9 changed files with 289 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
package minimal
import (
"testing"
"github.com/coredns/caddy"
)
func TestSetup(t *testing.T) {
c := caddy.NewTestController("dns", `minimal-response`)
if err := setup(c); err != nil {
t.Fatalf("Expected no errors, but got: %v", err)
}
c = caddy.NewTestController("dns", `minimal-response example.org`)
if err := setup(c); err == nil {
t.Fatalf("Expected errors, but got: %v", err)
}
}