Single Test Class
Test files should contain a single QuickSpec or XCTestCase class.
- Identifier:
single_test_class
- Enabled by default: No
- Supports autocorrection: No
- Kind: style
- Analyzer rule: No
- Minimum Swift compiler version: 5.0.0
- Default configuration:
Key Value severity warning test_parent_classes [“QuickSpec”, “XCTestCase”]
Non Triggering Examples
class FooTests { }
class FooTests: QuickSpec { }
class FooTests: XCTestCase { }
Triggering Examples
↓class FooTests: QuickSpec { }
↓class BarTests: QuickSpec { }
↓class FooTests: QuickSpec { }
↓class BarTests: QuickSpec { }
↓class TotoTests: QuickSpec { }
↓class FooTests: XCTestCase { }
↓class BarTests: XCTestCase { }
↓class FooTests: XCTestCase { }
↓class BarTests: XCTestCase { }
↓class TotoTests: XCTestCase { }
↓class FooTests: QuickSpec { }
↓class BarTests: XCTestCase { }
↓class FooTests: QuickSpec { }
↓class BarTests: XCTestCase { }
class TotoTests { }
final ↓class FooTests: QuickSpec { }
↓class BarTests: XCTestCase { }
class TotoTests { }