-
-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unique identifiers for all test examples #771
Changes from all commits
a31faef
d85f032
7b1d0d1
6f95c8c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ extension World { | |
|
||
internal func xdescribe(_ description: String, flags: FilterFlags, closure: () -> Void) { | ||
var pendingFlags = flags | ||
pendingFlags[Filter.pending] = true | ||
pendingFlags[Filter.excluded] = true | ||
self.describe(description, flags: pendingFlags, closure: closure) | ||
} | ||
|
||
|
@@ -111,10 +111,33 @@ extension World { | |
@nonobjc | ||
internal func xit(_ description: String, flags: FilterFlags, file: String, line: UInt, closure: @escaping () -> Void) { | ||
var pendingFlags = flags | ||
pendingFlags[Filter.pending] = true | ||
pendingFlags[Filter.excluded] = true | ||
self.it(description, flags: pendingFlags, file: file, line: line, closure: closure) | ||
} | ||
|
||
@nonobjc | ||
internal func pending(_ description: String, file: String, line: UInt, closure: @escaping () -> Void) { | ||
if beforesCurrentlyExecuting { | ||
raiseError("'pending' cannot be used inside 'beforeEach', 'pending' may only be used inside 'context' or 'describe'. ") | ||
} | ||
if aftersCurrentlyExecuting { | ||
raiseError("'pending' cannot be used inside 'afterEach', 'pending' may only be used inside 'context' or 'describe'. ") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line Length Violation: Line should be 120 characters or less: currently 130 characters (line_length) |
||
} | ||
guard currentExampleMetadata == nil else { | ||
raiseError("'pending' cannot be used inside 'it', 'pending' may only be used inside 'context' or 'describe'. ") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line Length Violation: Line should be 120 characters or less: currently 123 characters (line_length) |
||
} | ||
let callsite = Callsite(file: file, line: line) | ||
let example = Example( | ||
description: description, | ||
callsite: callsite, | ||
flags: [:], | ||
closure: closure | ||
) | ||
|
||
example.isPending = true | ||
currentExampleGroup.appendExample(example) | ||
} | ||
|
||
@nonobjc | ||
internal func itBehavesLike(_ name: String, sharedExampleContext: @escaping SharedExampleContext, flags: FilterFlags, file: String, line: UInt) { | ||
guard currentExampleMetadata == nil else { | ||
|
@@ -168,7 +191,7 @@ extension World { | |
|
||
internal func xitBehavesLike<C>(_ behavior: Behavior<C>.Type, context: @escaping () -> C, flags: FilterFlags, file: String, line: UInt) { | ||
var pendingFlags = flags | ||
pendingFlags[Filter.pending] = true | ||
pendingFlags[Filter.excluded] = true | ||
self.itBehavesLike(behavior, context: context, flags: pendingFlags, file: file, line: line) | ||
} | ||
|
||
|
@@ -192,11 +215,12 @@ extension World { | |
internal func objc_itBehavesLike(_ name: String, sharedExampleContext: @escaping SharedExampleContext, flags: FilterFlags, file: String, line: UInt) { | ||
itBehavesLike(name, sharedExampleContext: sharedExampleContext, flags: flags, file: file, line: line) | ||
} | ||
#endif | ||
|
||
internal func pending(_ description: String, closure: () -> Void) { | ||
print("Pending: \(description)") | ||
@objc(pendingWithDescription:file:line:closure:) | ||
internal func objc_pending(_ description: String, file: String, line: UInt, closure: @escaping () -> Void) { | ||
pending(description, file: file, line: line, closure: closure) | ||
} | ||
#endif | ||
|
||
private var currentPhase: String { | ||
if beforesCurrentlyExecuting { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line Length Violation: Line should be 120 characters or less: currently 131 characters (line_length)