File: skip_fixture_test.go

package info (click to toggle)
golang-ginkgo 1.2.0%2Bgit20161006.acfa16a-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 1,324 kB
  • ctags: 1,210
  • sloc: makefile: 12
file content (72 lines) | stat: -rw-r--r-- 1,447 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package fail_fixture_test

import (
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = It("handles top level skips", func() {
	Skip("a top level skip on line 9")
	println("NEVER SEE THIS")
})

var _ = It("handles async top level skips", func(done Done) {
	Skip("an async top level skip on line 14")
	println("NEVER SEE THIS")
}, 0.1)

var _ = It("SKIP in a goroutine", func(done Done) {
	go func() {
		defer GinkgoRecover()
		Skip("a top level goroutine skip on line 21")
		println("NEVER SEE THIS")
	}()
}, 0.1)

var _ = Describe("Excercising different skip modes", func() {
	It("synchronous skip", func() {
		Skip("a sync SKIP")
		println("NEVER SEE THIS")
	})

	It("async skip", func(done Done) {
		Skip("an async SKIP")
		println("NEVER SEE THIS")
	}, 0.1)

	It("SKIP in a goroutine", func(done Done) {
		go func() {
			defer GinkgoRecover()
			Skip("a goroutine SKIP")
			println("NEVER SEE THIS")
		}()
	}, 0.1)

	Measure("a SKIP measure", func(Benchmarker) {
		Skip("a measure SKIP")
		println("NEVER SEE THIS")
	}, 1)
})


var _ = Describe("SKIP in a BeforeEach", func() {
	BeforeEach(func() {
		Skip("a BeforeEach SKIP")
		println("NEVER SEE THIS")
	})

	It("a SKIP BeforeEach", func() {
		println("NEVER SEE THIS")
	})
})

var _ = Describe("SKIP in an AfterEach", func() {
	AfterEach(func() {
		Skip("an AfterEach SKIP")
		println("NEVER SEE THIS")
	})

	It("a SKIP AfterEach", func() {
		Expect(true).To(BeTrue())
	})
})