Welcome to the documentation for the Quick library!
Getting Started
If you’re new to Quick, this section will guide you through the process of setting up and using the library.
Installation
To install Quick, you can use one of the following methods:
-
Using CocoaPods:
pod 'Quick'
-
Without CocoaPods:
import Quick
Basic Usage
To start using Quick, follow these steps:
-
Create a new file named “MyTestSpec.swift”.
-
Import Quick and XCTest in “MyTestSpec.swift”.
import Quick import XCTest
-
Write your first test:
class MyTestSpec: QuickSpec { override func spec() { describe("MyTest") { it("should pass") { XCTAssertTrue(true) } } } }
-
Run the tests.
Advanced Usage
In this section, we will cover some advanced topics in Quick.
Matchers
Quick provides a set of matchers to help you write expressive tests.
-
toBe: compares actual and expected values for equality.
-
to(beGreaterThanOrEqualTo:) checks if the actual value is greater than or equal to the expected value.
-
… and more!
Asynchronous Testing
Quick supports testing asynchronous code using expectations.
-
Create an expectation.
let myExpectation = XCTestExpectation(description: "Async test")
-
Perform asynchronous operation.
-
Use
waitForExpectations(timeout:handler:)
to wait for the expectation to be fulfilled.waitForExpectations(timeout: 3, handler: nil)
Contributing
If you’d like to contribute to Quick, please follow the guidelines in the Contributing Guide.
We appreciate all contributions!