Skip to content

Commit

Permalink
Merge pull request Quick#944 from pobengtsson/add-empty-default-flags…
Browse files Browse the repository at this point in the history
…-to-xdescribe-xcontext

Added empty default flags to xdescribe and xcontext
  • Loading branch information
ikesyo committed Feb 12, 2020
2 parents f26a21e + ef507c7 commit 1e66350
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Quick/DSL/DSL.swift
Expand Up @@ -198,15 +198,15 @@ 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)
}

/**
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)
}

Expand Down
12 changes: 12 additions & 0 deletions Tests/QuickTests/QuickTests/FunctionalTests/PendingTests.swift
Expand Up @@ -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()
}
}
}
}

Expand Down

0 comments on commit 1e66350

Please sign in to comment.