summaryrefslogtreecommitdiff
path: root/vendor/github.com/onsi/ginkgo/internal/failer
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-06-24 11:29:13 +0200
committerValentin Rothberg <rothberg@redhat.com>2019-06-24 13:20:59 +0200
commitd697456dc90adbaf68224ed7c115b38d5855e582 (patch)
tree5fd88c48b34e7bead0028fa97e39f43f03880642 /vendor/github.com/onsi/ginkgo/internal/failer
parenta3211b73c62a9fcc13f09305bf629ef507b26d34 (diff)
downloadpodman-d697456dc90adbaf68224ed7c115b38d5855e582.tar.gz
podman-d697456dc90adbaf68224ed7c115b38d5855e582.tar.bz2
podman-d697456dc90adbaf68224ed7c115b38d5855e582.zip
migrate to go-modules
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/onsi/ginkgo/internal/failer')
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go141
2 files changed, 0 insertions, 154 deletions
diff --git a/vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go
deleted file mode 100644
index 8dce7be9a..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package failer_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestFailer(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "Failer Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go b/vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go
deleted file mode 100644
index 65210a40a..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/failer/failer_test.go
+++ /dev/null
@@ -1,141 +0,0 @@
-package failer_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/ginkgo/internal/failer"
- . "github.com/onsi/gomega"
-
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/types"
-)
-
-var _ = Describe("Failer", func() {
- var (
- failer *Failer
- codeLocationA types.CodeLocation
- codeLocationB types.CodeLocation
- )
-
- BeforeEach(func() {
- codeLocationA = codelocation.New(0)
- codeLocationB = codelocation.New(0)
- failer = New()
- })
-
- Context("with no failures", func() {
- It("should return success when drained", func() {
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(BeZero())
- Ω(state).Should(Equal(types.SpecStatePassed))
- })
- })
-
- Describe("Skip", func() {
- It("should handle failures", func() {
- failer.Skip("something skipped", codeLocationA)
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "something skipped",
- Location: codeLocationA,
- ForwardedPanic: "",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStateSkipped))
- })
- })
-
- Describe("Fail", func() {
- It("should handle failures", func() {
- failer.Fail("something failed", codeLocationA)
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "something failed",
- Location: codeLocationA,
- ForwardedPanic: "",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStateFailed))
- })
- })
-
- Describe("Panic", func() {
- It("should handle panics", func() {
- failer.Panic(codeLocationA, "some forwarded panic")
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "Test Panicked",
- Location: codeLocationA,
- ForwardedPanic: "some forwarded panic",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStatePanicked))
- })
- })
-
- Describe("Timeout", func() {
- It("should handle timeouts", func() {
- failer.Timeout(codeLocationA)
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "Timed out",
- Location: codeLocationA,
- ForwardedPanic: "",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStateTimedOut))
- })
- })
-
- Context("when multiple failures are registered", func() {
- BeforeEach(func() {
- failer.Fail("something failed", codeLocationA)
- failer.Fail("something else failed", codeLocationA)
- })
-
- It("should only report the first one when drained", func() {
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
-
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "something failed",
- Location: codeLocationA,
- ForwardedPanic: "",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStateFailed))
- })
-
- It("should report subsequent failures after being drained", func() {
- failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- failer.Fail("yet another thing failed", codeLocationA)
-
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
-
- Ω(failure).Should(Equal(types.SpecFailure{
- Message: "yet another thing failed",
- Location: codeLocationA,
- ForwardedPanic: "",
- ComponentType: types.SpecComponentTypeIt,
- ComponentIndex: 3,
- ComponentCodeLocation: codeLocationB,
- }))
- Ω(state).Should(Equal(types.SpecStateFailed))
- })
-
- It("should report sucess on subsequent drains if no errors occur", func() {
- failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- failure, state := failer.Drain(types.SpecComponentTypeIt, 3, codeLocationB)
- Ω(failure).Should(BeZero())
- Ω(state).Should(Equal(types.SpecStatePassed))
- })
- })
-})