func TestSetup1(t *testing.T) {
	c := caddy.NewTestController("http", t2)
	err := setup(c)
	if err == nil {
		t.Errorf("Expected error but found nil")
	}
}
Bomb does not exist so the plugin must throw an error
package nobots
import (
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"regexp"
	"strconv"
	"testing"
	"github.com/caddyserver/caddy"
	"github.com/caddyserver/caddy/caddyhttp/httpserver"
)
var t1 = `nobots "nobots.go" { "Googlebot" }`
func TestSetup(t *testing.T) {
	c := caddy.NewTestController("http", t1)
	err := setup(c)
	if err != nil {
		t.Errorf("Expected no errors, but got: %v", err)
	}
	mids := httpserver.GetConfig(c).Middleware()
	if len(mids) == 0 {
		t.Fatal("Expected middleware, got 0 instead")
	}
	handler := mids[0](httpserver.EmptyNext)
	myHandler, ok := handler.(BotUA)
	if !ok {
		t.Fatalf("Expected handler to be type BotUA, got: %#v", handler)
	}
	if !httpserver.SameNext(myHandler.Next, httpserver.EmptyNext) {
		t.Error("'Next' field of handler was not set properly")
	}
	tests := []struct {
		input     string
		shouldErr bool
	}{
		{`nobots "nobots.go" { "Googlebot" }`, false},
		{`nobots "nobots.go" { regexp "Googlebot" }`, false},
		{`nobots "nobots.go" { regex "Googlebot" }`, false},
		{`nobots "nobots.go" { regexp "^Googlebot$" }`, false},
		{`nobots "nobots.go" { regexp "(?P<name>re" }`, true},
	}
	for i, test := range tests {
		_, err := parseUA(caddy.NewTestController("http", test.input))
		if test.shouldErr && err == nil {
			t.Errorf("Test %v: Expected error but found nil", i)
		} else if !test.shouldErr && err != nil {
			t.Errorf("Test %v: Expected no error but found error: %v", i, err)
		}
	}
}
var t2 = `nobots "no_exist.go" { "Googlebot" }`