From 5cd8d5fd2d26f51bf9740eab924947a3c08623e7 Mon Sep 17 00:00:00 2001 From: Mike Gaffney Date: Thu, 12 Oct 2017 15:59:32 -0700 Subject: [PATCH] Exposing skip for evaluation by onsi --- ginkgo_dsl.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ginkgo_dsl.go b/ginkgo_dsl.go index 8befd35ad..3847cf79a 100644 --- a/ginkgo_dsl.go +++ b/ginkgo_dsl.go @@ -283,6 +283,12 @@ func Describe(text string, body func()) bool { return true } +// You can wrap the method in your own meta framework and still get valid errors +func DescribeSkip(text string, skip int, body func()) bool { + globalSuite.PushContainerNode(text, body, types.FlagTypeNone, codelocation.New(skip + 1)) + return true +} + //You can focus the tests within a describe block using FDescribe func FDescribe(text string, body func()) bool { globalSuite.PushContainerNode(text, body, types.FlagTypeFocused, codelocation.New(1)) @@ -340,6 +346,12 @@ func It(text string, body interface{}, timeout ...float64) bool { return true } +// You can wrap it with your own framework +func ItSkip(text string, skip int, body interface{}, timeout ...float64) bool { + globalSuite.PushItNode(text, body, types.FlagTypeNone, codelocation.New(skip + 1), parseTimeout(timeout...)) + return true +} + //You can focus individual Its using FIt func FIt(text string, body interface{}, timeout ...float64) bool { globalSuite.PushItNode(text, body, types.FlagTypeFocused, codelocation.New(1), parseTimeout(timeout...)) @@ -352,6 +364,12 @@ func PIt(text string, _ ...interface{}) bool { return true } +// You can wrap PIt in your own framework +func PItSkip(text string, skip int, _ ...interface{}) bool { + globalSuite.PushItNode(text, func() {}, types.FlagTypePending, codelocation.New(skip + 1), 0) + return true +} + //You can mark Its as pending using XIt func XIt(text string, _ ...interface{}) bool { globalSuite.PushItNode(text, func() {}, types.FlagTypePending, codelocation.New(1), 0)