Example
final public class Example : _ExampleBase
Examples, defined with the it
function, use assertions to
demonstrate how code should behave. These are like “tests” in XCTest.
-
A boolean indicating whether the example is a shared example; i.e.: whether it is an example defined with
itBehavesLike
.Declaration
Swift
public var isSharedExample: Bool
-
The site at which the example is defined. This must be set correctly in order for Xcode to highlight the correct line in red when reporting a failure.
Declaration
Swift
public var callsite: Callsite
-
Undocumented
Declaration
Swift
public override var description: String { get }
-
The example name. A name is a concatenation of the name of the example group the example belongs to, followed by the description of the example itself.
The example name is used to generate a test method selector to be displayed in Xcode’s test navigator.
Declaration
Swift
public var name: String { get }
-
Executes the example closure, as well as all before and after closures defined in the its surrounding example groups.
Declaration
Swift
public func run()
-
Returns a boolean indicating whether two Example objects are equal. If two examples are defined at the exact same callsite, they must be equal.
Declaration
Swift
@nonobjc public static func == (lhs: Example, rhs: Example) -> Bool