From c7578070f6d12fc1afe35e64709827a2658e3475 Mon Sep 17 00:00:00 2001 From: fabriciojs Date: Tue, 27 Dec 2022 12:26:16 -0300 Subject: [PATCH] fix tests --- services/checker/checker_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/checker/checker_test.go b/services/checker/checker_test.go index 1ae4a8c5..437947ee 100644 --- a/services/checker/checker_test.go +++ b/services/checker/checker_test.go @@ -41,7 +41,7 @@ func TestDockerComposeNotInstalled(t *testing.T) { var c Checker dockerCmd := &builder.FakeCommand{} - dockerComposeCmd := &builder.FakeCommand{MockExecError: errors.New("not installed")} + dockerComposeCmd := &builder.FakeCommand{MockExecError: errors.New("is not a docker command")} s := &shell.FakeShell{} @@ -57,6 +57,12 @@ func TestDockerComposeNotInstalled(t *testing.T) { if !IsDockerComposeNotFoundError(err) { t.Errorf("Expected the message '%s', got '%s'", ErrDockerComposeNotFound.Error(), err.Error()) } + + dockerComposeCmd.MockExecError = errors.New("some other error") + + if err := c.Check(); err == nil || err.Error() != "some other error" { + t.Errorf("Expected the error message 'some other error', got '%v'", err) + } } func TestDockerNotRunning(t *testing.T) {