From ef507c7dd56144eef9d424791d24a90dd8aca276 Mon Sep 17 00:00:00 2001 From: Per-Olof Bengtsson Date: Wed, 15 Jan 2020 21:43:12 +0100 Subject: [PATCH] Added empty default flags to xdescribe and xcontext --- Sources/Quick/DSL/DSL.swift | 4 ++-- .../QuickTests/FunctionalTests/PendingTests.swift | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Sources/Quick/DSL/DSL.swift b/Sources/Quick/DSL/DSL.swift index 284ffe1d3..3093e1ed6 100644 --- a/Sources/Quick/DSL/DSL.swift +++ b/Sources/Quick/DSL/DSL.swift @@ -198,7 +198,7 @@ public func pending(_ description: String, closure: () -> Void) { Use this to quickly mark a `describe` closure as pending. This disables all examples within the closure. */ -public func xdescribe(_ description: String, flags: FilterFlags, closure: () -> Void) { +public func xdescribe(_ description: String, flags: FilterFlags = [:], closure: () -> Void) { World.sharedWorld.xdescribe(description, flags: flags, closure: closure) } @@ -206,7 +206,7 @@ public func xdescribe(_ description: String, flags: FilterFlags, closure: () -> Use this to quickly mark a `context` closure as pending. This disables all examples within the closure. */ -public func xcontext(_ description: String, flags: FilterFlags, closure: () -> Void) { +public func xcontext(_ description: String, flags: FilterFlags = [:], closure: () -> Void) { xdescribe(description, flags: flags, closure: closure) } diff --git a/Tests/QuickTests/QuickTests/FunctionalTests/PendingTests.swift b/Tests/QuickTests/QuickTests/FunctionalTests/PendingTests.swift index 5334200d7..b5c75f087 100644 --- a/Tests/QuickTests/QuickTests/FunctionalTests/PendingTests.swift +++ b/Tests/QuickTests/QuickTests/FunctionalTests/PendingTests.swift @@ -28,6 +28,18 @@ class FunctionalTests_PendingSpec: QuickSpec { beforeEach { onlyPendingExamplesBeforeEachExecutedCount += 1 } pending("an example that will not run") {} } + describe("a describe block with a disabled context that will not run") { + xcontext("these examples will not run") { + it("does not run") { + fail() + } + } + } + xdescribe("a describe block that will not run") { + it("does not run") { + fail() + } + } } }