summaryrefslogtreecommitdiff
path: root/vendor/github.com/onsi/ginkgo/internal/codelocation
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/codelocation
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/codelocation')
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go13
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go80
2 files changed, 0 insertions, 93 deletions
diff --git a/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go b/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go
deleted file mode 100644
index f06abf3c5..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package codelocation_test
-
-import (
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-
- "testing"
-)
-
-func TestCodelocation(t *testing.T) {
- RegisterFailHandler(Fail)
- RunSpecs(t, "CodeLocation Suite")
-}
diff --git a/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go b/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go
deleted file mode 100644
index cca75a449..000000000
--- a/vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_test.go
+++ /dev/null
@@ -1,80 +0,0 @@
-package codelocation_test
-
-import (
- "runtime"
-
- . "github.com/onsi/ginkgo"
- "github.com/onsi/ginkgo/internal/codelocation"
- "github.com/onsi/ginkgo/types"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("CodeLocation", func() {
- var (
- codeLocation types.CodeLocation
- expectedFileName string
- expectedLineNumber int
- )
-
- caller0 := func() {
- codeLocation = codelocation.New(1)
- }
-
- caller1 := func() {
- _, expectedFileName, expectedLineNumber, _ = runtime.Caller(0)
- expectedLineNumber += 2
- caller0()
- }
-
- BeforeEach(func() {
- caller1()
- })
-
- It("should use the passed in skip parameter to pick out the correct file & line number", func() {
- Ω(codeLocation.FileName).Should(Equal(expectedFileName))
- Ω(codeLocation.LineNumber).Should(Equal(expectedLineNumber))
- })
-
- Describe("stringer behavior", func() {
- It("should stringify nicely", func() {
- Ω(codeLocation.String()).Should(ContainSubstring("code_location_test.go:%d", expectedLineNumber))
- })
- })
-
- //There's no better way than to test this private method as it
- //goes out of its way to prune out ginkgo related code in the stack trace
- Describe("PruneStack", func() {
- It("should remove any references to ginkgo and pkg/testing and pkg/runtime", func() {
- input := `/Skip/me
-Skip: skip()
-/Skip/me
-Skip: skip()
-/Users/whoever/gospace/src/github.com/onsi/ginkgo/whatever.go:10 (0x12314)
-Something: Func()
-/Users/whoever/gospace/src/github.com/onsi/ginkgo/whatever_else.go:10 (0x12314)
-SomethingInternalToGinkgo: Func()
-/usr/goroot/pkg/strings/oops.go:10 (0x12341)
-Oops: BlowUp()
-/Users/whoever/gospace/src/mycode/code.go:10 (0x12341)
-MyCode: Func()
-/Users/whoever/gospace/src/mycode/code_test.go:10 (0x12341)
-MyCodeTest: Func()
-/Users/whoever/gospace/src/mycode/code_suite_test.go:12 (0x37f08)
-TestFoo: RunSpecs(t, "Foo Suite")
-/usr/goroot/pkg/testing/testing.go:12 (0x37f08)
-TestingT: Blah()
-/usr/goroot/pkg/runtime/runtime.go:12 (0x37f08)
-Something: Func()
-`
- prunedStack := codelocation.PruneStack(input, 1)
- Ω(prunedStack).Should(Equal(`/usr/goroot/pkg/strings/oops.go:10 (0x12341)
-Oops: BlowUp()
-/Users/whoever/gospace/src/mycode/code.go:10 (0x12341)
-MyCode: Func()
-/Users/whoever/gospace/src/mycode/code_test.go:10 (0x12341)
-MyCodeTest: Func()
-/Users/whoever/gospace/src/mycode/code_suite_test.go:12 (0x37f08)
-TestFoo: RunSpecs(t, "Foo Suite")`))
- })
- })
-})