Skip to content

Commit

Permalink
Merge pull request #1237 from cloudskiff/fix_version_check_test
Browse files Browse the repository at this point in the history
Make version check test more dynamic
  • Loading branch information
eliecharra authored Nov 29, 2021
2 parents ca60550 + 4b3778a commit cbc6fd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
17 changes: 0 additions & 17 deletions pkg/cmd/driftctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,6 @@ func TestDriftctlCmd_Help(t *testing.T) {
}
}

func TestDriftctlCmd_Version(t *testing.T) {
cmd := NewDriftctlCmd(mocks.MockBuild{})

output, err := test.Execute(&cmd.Command, "version")
if output == "" {
t.Errorf("Unexpected output: %v", output)
}
if err != nil {
t.Errorf("Unexpected error: %v", err)
}

expected := "dev-dev\n"
if output != expected {
t.Errorf("Expected %v, got %v", expected, output)
}
}

func TestDriftctlCmd_Completion(t *testing.T) {
cmd := NewDriftctlCmd(mocks.MockBuild{})

Expand Down
4 changes: 3 additions & 1 deletion pkg/cmd/version_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package cmd

import (
"fmt"
"testing"

"github.com/cloudskiff/driftctl/pkg/version"
"github.com/cloudskiff/driftctl/test"

"github.com/spf13/cobra"
Expand All @@ -20,7 +22,7 @@ func TestVersionCmd(t *testing.T) {
t.Errorf("Unexpected error: %v", err)
}

expected := "dev-dev\n"
expected := fmt.Sprintf("%s\n", version.Current())
if output != expected {
t.Errorf("Expected %v, got %v", expected, output)
}
Expand Down

0 comments on commit cbc6fd7

Please sign in to comment.