Skip to content

Commit 31ab0ac

Browse files
committed
tests: add tests for Provision
1 parent ef53d40 commit 31ab0ac

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

plugin_internals_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package caddy_remote_host
2+
3+
// These tests target unexported fields and methods. For tests of the
4+
// public API see package caddy_remote_host_test.
5+
6+
import (
7+
"testing"
8+
9+
"github.com/caddyserver/caddy/v2"
10+
"github.com/stretchr/testify/assert"
11+
"github.com/stretchr/testify/require"
12+
)
13+
14+
func TestMatchRemoteHost_Provision(t *testing.T) {
15+
hostRegex = nil
16+
17+
subject := MatchRemoteHost{}
18+
err := subject.Provision(caddy.Context{})
19+
require.NoError(t, err)
20+
assert.NotNil(t, subject.logger)
21+
assert.NotNil(t, subject.cache)
22+
assert.NotNil(t, hostRegex)
23+
}

0 commit comments

Comments
 (0)