import XCTest
@testable import SaplingCore

final class SaplingRulesTests: XCTestCase {
    func testSampleWorkspacePassesValidation() throws {
        try SaplingRules.validateWorkspace(SaplingSampleData.workspace)
    }

    func testRejectsEmptySubprojectPath() {
        let subproject = Subproject(
            name: "Broken",
            path: "",
            repositoryURL: URL(fileURLWithPath: "/tmp/Broken")
        )

        XCTAssertThrowsError(try SaplingRules.validateSubproject(subproject)) { error in
            XCTAssertEqual(error as? SaplingDomainError, .subprojectPathCannotBeEmpty)
        }
    }
}
