Back to Quick

Behavior

docs/Classes/Behavior.html

7.6.21.3 KB
Original Source

Behavior

open class Behavior<Context>
extension Behavior: SyncDSLUser

A Behavior encapsulates a set of examples that can be re-used in several locations using the itBehavesLike function with a context instance of the generic type.

`

                name
                `

Override this variable if you want to provide custom name for this example group.

Declaration

Swift

open class var name: String { get }

`

                spec(_:)
                `

Override this method in your behavior to define a set of reusable examples.

This behaves just like an example group defines using describe or context–it may contain any number of beforeEach and afterEach closures, as well as any number of examples (defined using it).

Declaration

Swift

open class func spec(_ aContext: @escaping () -> Context)

Parameters

| aContext |

A closure that, when evaluated, returns a Context instance that provide the information on the subject.

|

© 2025 Quick Contributors. All rights reserved. (Last updated: 2025-06-26)

Generated by jazzy ♪♫ v0.15.3, a Realm project.