import Quick
import Nimble
@testable import Sourcery
@testable import SourceryRuntime

class VerifierSpec: QuickSpec {
    override func spec() {
        describe("Verifier") {
            it("allows empty strings") {
                expect(Verifier.canParse(content: "")).to(equal(Verifier.Result.approved))
            }

            it("rejects files generated by Sourcery") {
                let content = Sourcery.generationMarker + "\n something\n is\n there"

                expect(Verifier.canParse(content: content)).to(equal(Verifier.Result.isCodeGenerated))
            }

            it("rejects file containing conflict marker") {
                let content = ["\n<<<<<\n", "\n>>>>>\n"]

                content.forEach { expect(Verifier.canParse(content: $0)).to(equal(Verifier.Result.containsConflictMarkers)) }
            }
        }
    }
}

import Quick
import Nimble
@testable import Sourcery
@testable import SourceryRuntime

class VerifierSpec: QuickSpec {
    override func spec() {
        describe("Verifier") {
            it("allows empty strings") {
                expect(Verifier.canParse(content: "", path: Path("/"))).to(equal(Verifier.Result.approved))
            }

            it("rejects files generated by Sourcery") {
                let content = Sourcery.generationMarker + "\n something\n is\n there"

                expect(Verifier.canParse(content: content, path: Path("/"))).to(equal(Verifier.Result.isCodeGenerated))
            }

            it("rejects files generated by Sourcery when a force parse extension is defined but doesn't match file") {
                let content = Sourcery.generationMarker + "\n something\n is\n there"

                expect(Verifier.canParse(content: content, path: Path("/file.swift"), forceParse: ["toparse"])).to(equal(Verifier.Result.isCodeGenerated))
            }

            it("doesn't reject files generated by Soucery but that we want to force the parsing for") {
                let content = Sourcery.generationMarker + "\n something\n is\n there"

                expect(Verifier.canParse(content: content, path: Path("/file.toparse.swift"), forceParse: ["toparse"])).to(equal(Verifier.Result.approved))
            }

            it("rejects file containing conflict marker") {
                let content = ["\n<<<<<\n", "\n>>>>>\n"]

                content.forEach { expect(Verifier.canParse(content: $0, path: Path("/"))).to(equal(Verifier.Result.containsConflictMarkers)) }
            }
        }
    }
}

Add tests for the `force-parse` feature
Add tests for the `force-parse` feature
