Skip to content

Configuration

Oleksandr Bretsko edited this page Dec 27, 2020 · 1 revision

Configuration

A configuration encapsulates various options you can use to configure Quick's behavior.

final public class Configuration: NSObject

Inheritance

NSObject

Properties

runAllWhenEverythingFiltered

Run all examples if none match the configured filters. True by default.

var runAllWhenEverythingFiltered = true

Methods

include(_:)

Registers an inclusion filter.

public func include(_ filter: @escaping ExampleFilter)

All examples are filtered using all inclusion filters. The remaining examples are run. If no examples remain, all examples are run.

Parameters

  • filter: A filter that, given an example, returns a value indicating whether that example should be included in the examples that are run.

exclude(_:)

Registers an exclusion filter.

public func exclude(_ filter: @escaping ExampleFilter)

All examples that remain after being filtered by the inclusion filters are then filtered via all exclusion filters.

Parameters

  • filter: A filter that, given an example, returns a value indicating whether that example should be excluded from the examples that are run.

beforeEach(_:)

canImport(Darwin)
@objc(beforeEachWithMetadata) public func beforeEach(_ closure: @escaping BeforeExampleWithMetadataClosure)

beforeEach(_:)

!((canImport(Darwin)))
public func beforeEach(_ closure: @escaping BeforeExampleWithMetadataClosure)

beforeEach(_:)

Like Quick.DSL.beforeEach, this configures Quick to execute the given closure before each example that is run. The closure passed to this method is executed before each example Quick runs, globally across the test suite. You may call this method multiple times across multiple +[QuickConfigure configure:​] methods in order to define several closures to run before each example.

public func beforeEach(_ closure: @escaping BeforeExampleClosure)

Note that, since Quick makes no guarantee as to the order in which +[QuickConfiguration configure:] methods are evaluated, there is no guarantee as to the order in which beforeEach closures are evaluated either. Multiple beforeEach defined on a single configuration, however, will be executed in the order they're defined.

Parameters

  • closure: The closure to be executed before each example in the test suite.

afterEach(_:)

canImport(Darwin)
@objc(afterEachWithMetadata) public func afterEach(_ closure: @escaping AfterExampleWithMetadataClosure)

afterEach(_:)

!((canImport(Darwin)))
public func afterEach(_ closure: @escaping AfterExampleWithMetadataClosure)

afterEach(_:)

Like Quick.DSL.afterEach, this configures Quick to execute the given closure after each example that is run. The closure passed to this method is executed after each example Quick runs, globally across the test suite. You may call this method multiple times across multiple +[QuickConfigure configure:​] methods in order to define several closures to run after each example.

public func afterEach(_ closure: @escaping AfterExampleClosure)

Note that, since Quick makes no guarantee as to the order in which +[QuickConfiguration configure:] methods are evaluated, there is no guarantee as to the order in which afterEach closures are evaluated either. Multiple afterEach defined on a single configuration, however, will be executed in the order they're defined.

Parameters

  • closure: The closure to be executed before each example in the test suite.

beforeSuite(_:)

Like Quick.DSL.beforeSuite, this configures Quick to execute the given closure prior to any and all examples that are run. The two methods are functionally equivalent.

public func beforeSuite(_ closure: @escaping BeforeSuiteClosure)

afterSuite(_:)

Like Quick.DSL.afterSuite, this configures Quick to execute the given closure after all examples have been run. The two methods are functionally equivalent.

public func afterSuite(_ closure: @escaping AfterSuiteClosure)
Types
Protocols
Global Typealiases
Global Variables
Global Functions
  • MACH_MSGH_BITS(_:_:)
  • MACH_MSGH_BITS_REMOTE(_:)
  • QCKMain(_:configurations:testCases:)
  • __allTests()
  • afterEach(_:)
  • afterSuite(_:)
  • allPass(_:)
  • allPass(_:_:)
  • assertClose(_:_:allowedError:file:line:)
  • assertClose(_:_:allowedError:worstError:file:line:)
  • be(_:)
  • beAKindOf(_:)
  • beAnInstanceOf(_:)
  • beCloseTo(_:within:)
  • beEmpty()
  • beFalse()
  • beFalsy()
  • beGreaterThan(_:)
  • beGreaterThanOrEqualTo(_:)
  • beIdenticalTo(_:)
  • beLessThan(_:)
  • beLessThanOrEqualTo(_:)
  • beNil()
  • beTrue()
  • beTruthy()
  • beVoid()
  • beforeEach(_:)
  • beforeSuite(_:)
  • beginWith(_:)
  • catchBadInstruction(block:)
  • catchBadInstruction(in:)
  • chain(_:_:)
  • contain(_:)
  • containElementSatisfying(_:_:)
  • context(_:flags:closure:)
  • crashIf(_:_:)
  • crashIfAnyFalse(_:_:)
  • crashIfAnyFalse(_:crashMessage:)
  • crashIfAnyFalse(_:message:)
  • crashIfAnyNotExpected(_:expected:_:)
  • crashIfAnyNotExpected(_:expected:crashMessage:)
  • crashIfAnyTrue(_:_:)
  • crashIfFalse(_:_:)
  • crashIfNegative(_:)
  • crashIfNil(_:)
  • crashIfNotEqual(_:)
  • crashIfNotEqual(_:_:)
  • crashIfNotExpected(_:expected:_:)
  • crashIfNotNil(_:)
  • describe(_:flags:closure:)
  • doubleForLoop(_:_:)
  • elementsEqual(_:)
  • elementsEqual(_:by:)
  • encode(encodable:)
  • endWith(_:)
  • equal(_:)
  • expect(_:file:line:)
  • expect(_:line:expression:)
  • fail(_:file:line:)
  • fail(_:line:)
  • fail(_:location:)
  • fcontext(_:flags:closure:)
  • fdescribe(_:flags:closure:)
  • fit(_:flags:file:line:closure:)
  • fitBehavesLike(_:flags:file:line:)
  • fitBehavesLike(_:flags:file:line:context:)
  • fitBehavesLike(_:flags:file:line:sharedExampleContext:)
  • gatherExpectations(silently:closure:)
  • gatherFailingExpectations(silently:closure:)
  • haveCount(_:)
  • isValidLength(_:)
  • it(_:flags:file:line:closure:)
  • itBehavesLike(_:flags:file:line:)
  • itBehavesLike(_:flags:file:line:context:)
  • itBehavesLike(_:flags:file:line:sharedExampleContext:)
  • match(_:)
  • matchError(_:)
  • pending(_:closure:)
  • postNotifications(_:fromNotificationCenter:)
  • prettyCollectionType(_:)
  • product(_:_:)
  • raiseException(named:reason:userInfo:closure:)
  • recordFailure(_:location:)
  • satisfyAllOf(_:)
  • satisfyAnyOf(_:)
  • sharedExamples(_:closure:)
  • stringify(_:)
  • succeed()
  • threadSingleton(_:)
  • throwAssertion()
  • throwError()
  • throwError(_:closure:)
  • throwError(closure:)
  • throwError(errorType:closure:)
  • uuid()
  • waitUntil(timeout:file:line:action:)
  • withAssertionHandler(_:file:line:closure:)
  • xcontext(_:flags:closure:)
  • xdescribe(_:flags:closure:)
  • xit(_:flags:file:line:closure:)
  • xitBehavesLike(_:flags:file:line:context:)
Operators
  • !=(lhs:rhs:)
  • !==(lhs:rhs:)
  • &&(left:right:)
  • **(lhs:rhs:)
  • <(lhs:rhs:)
  • <=(lhs:rhs:)
  • ==(lhs:rhs:)
  • ===(lhs:rhs:)
  • >(lhs:rhs:)
  • >=(lhs:rhs:)
  • ||(left:right:)
  • ~=(regex:input:)
  • ±(Float:)
  • ±(double:)
  • ±(lhs:rhs:)
  • √(double:)
  • ≈(lhs:rhs:)

Clone this wiki locally