forked from kubev2v/forklift
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Liran Rotenberg <lrotenbe@redhat.com>
- Loading branch information
Showing
4 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
pkg/controller/provider/container/ovirt/collector_suite_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package ovirt | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
// forkliftFailHandler call ginkgo.Fail with printing the additional information | ||
func forkliftFailHandler(message string, callerSkip ...int) { | ||
if len(callerSkip) > 0 { | ||
callerSkip[0]++ | ||
} | ||
ginkgo.Fail(message, callerSkip...) | ||
} | ||
|
||
func TestTests(t *testing.T) { | ||
defer ginkgo.GinkgoRecover() | ||
RegisterFailHandler(forkliftFailHandler) | ||
ginkgo.RunSpecs(t, "ovirt collector") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package ovirt | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/onsi/ginkgo" | ||
"github.com/onsi/ginkgo/extensions/table" | ||
. "github.com/onsi/gomega" | ||
gtypes "github.com/onsi/gomega/types" | ||
) | ||
|
||
var _ = ginkgo.Describe("ovirt collector", func() { | ||
table.DescribeTable("should", func(version string, matchVersion gtypes.GomegaMatcher) { | ||
major, minor, build, revision := parseVersion(version) | ||
Expect(strings.Join([]string{major, minor, build, revision}, ".")).Should(matchVersion) | ||
}, | ||
table.Entry("get version when revision is in the 3rd element", "4.5.5-1.el8", Equal("4.5.5.1")), | ||
table.Entry("get version when revision is in the 4th element", "4.5.3.4-1.el8ev", Equal("4.5.3.4")), | ||
) | ||
}) |