How to use spec method of QuickDescribeTests class

Best Quick code snippet using QuickDescribeTests.spec

Run Quick automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.


Source: DescribeTests.swift Github

1import XCTest
2import Nimble
3import Quick
5#if _runtime(_ObjC) && !SWIFT_PACKAGE
7final class DescribeTests: XCTestCase, XCTestCaseProvider {
8    static var allTests: [(String, (DescribeTests) -> () throws -> Void)] {
9        return [
10            ("testDescribeThrowsIfUsedOutsideOfQuickSpec", testDescribeThrowsIfUsedOutsideOfQuickSpec)
11        ]
12    }
14    func testDescribeThrowsIfUsedOutsideOfQuickSpec() {
15        expect { describe("this should throw an exception", {}) }.to(raiseException())
16    }
19class QuickDescribeTests: QuickSpec {
20    override func spec() {
21        describe("Describe") {
22            it("should throw an exception if used in an it block") {
23                expect {
24                    describe("A nested describe that should throw") { }
25                }.to(raiseException { (exception: NSException) in
26                    expect(
27                    expect(exception.reason).to(equal("'describe' cannot be used inside 'it', 'describe' may only be used inside 'context' or 'describe'. "))
28                })
29            }
30        }
31    }
Full Screen

Accelerate Your Automation Test Cycles With LambdaTest

Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.

Try LambdaTest

Most used method in QuickDescribeTests

Trigger spec code on LambdaTest Cloud Grid

Execute automation tests with spec on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

We use cookies to give you the best experience. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. Learn More in our Cookies policy, Privacy & Terms of service

Allow Cookie

I hope you find the best code examples for your project.

If you want to accelerate automated browser testing, try LambdaTest. Your first 100 automation testing minutes are FREE.

Sarah Elson (Product & Growth Lead)