Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriciojs committed Dec 27, 2022
1 parent 4754670 commit c757807
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion services/checker/checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}

Expand All @@ -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) {
Expand Down

0 comments on commit c757807

Please sign in to comment.