21 lines
622 B
Swift
21 lines
622 B
Swift
|
|
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)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|