cli/command: TestHooksEnabled: fix test when config file is present
This test verifies the default behavior, but when running the test in an environment that already has a ~/.docker/config.json present, it may fail. This patch updates the test to configure the config-directory to point to an empty directory, making sure it's not affected by state. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
6523832c73
commit
f66c5a33d0
@ -302,6 +302,8 @@ func TestInitializeShouldAlwaysCreateTheContextStore(t *testing.T) {
|
||||
|
||||
func TestHooksEnabled(t *testing.T) {
|
||||
t.Run("disabled by default", func(t *testing.T) {
|
||||
// Make sure we don't depend on any existing ~/.docker/config.json
|
||||
config.SetDir(t.TempDir())
|
||||
cli, err := NewDockerCli()
|
||||
assert.NilError(t, err)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user