feat(core): add Quick/Nimble *Spec.swift to Swift group

Quick is the Swift ecosystem's RSpec analogue — the dominant BDD-style
testing framework before Apple shipped Swift Testing (Xcode 16, 2024).
Files follow the `<Subject>Spec.swift` convention and typically live
under `<Package>Tests/` (SPM) or `<AppName>Tests/` (Xcode) alongside
XCTest files, so the dir rules do catch most of them — but small
gem-style packages and CLI tools sometimes keep `*Spec.swift` at the
`Sources/` root, which the dir rules miss.

Kept as a separate opt-in glob from `*Tests.swift` so users on
XCTest-only projects (Apple's official Swift repos, Alamofire) aren't
carrying a comment for a framework they don't use. Mirrors the split
in the Ruby group between RSpec `*_spec.rb` and Minitest `*_test.rb`.
This commit is contained in:
thejesh23
2026-07-21 02:59:12 -07:00
parent 91d8690446
commit c5ec3b4d7a
2 changed files with 8 additions and 0 deletions
@@ -293,6 +293,13 @@ describe("generateStarterIgnoreFile", () => {
expect(content).toContain("# **/*Test.swift");
});
it("includes Swift Quick/Nimble BDD *Spec.swift files", () => {
const content = generateStarterIgnoreFile(testDir);
// Quick is the Swift RSpec-equivalent — dominant in codebases that
// adopted BDD styling before Swift Testing shipped.
expect(content).toContain("# **/*Spec.swift");
});
it("groups patterns under the JS / TS sub-header", () => {
const content = generateStarterIgnoreFile(testDir);
expect(content).toContain("# JS / TS");
@@ -167,6 +167,7 @@ const TEST_PATTERN_GROUPS: Array<{ label: string; patterns: string[] }> = [
patterns: [
"**/*Tests.swift",
"**/*Test.swift",
"**/*Spec.swift",
],
},
];