forked from testcontainers/testcontainers-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger_test.go
31 lines (26 loc) · 677 Bytes
/
logger_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package testcontainers
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestWithLogger(t *testing.T) {
logger := TestLogger(t)
logOpt := WithLogger(logger)
t.Run("container", func(t *testing.T) {
var req GenericContainerRequest
logOpt.Customize(&req)
require.Equal(t, logger, req.Logger)
})
t.Run("provider", func(t *testing.T) {
var opts GenericProviderOptions
logOpt.ApplyGenericTo(&opts)
require.Equal(t, logger, opts.Logger)
})
t.Run("docker", func(t *testing.T) {
opts := &DockerProviderOptions{
GenericProviderOptions: &GenericProviderOptions{},
}
logOpt.ApplyDockerTo(opts)
require.Equal(t, logger, opts.Logger)
})
}