diff options
| -rw-r--r-- | SoraTests/FolderHierarchyTests.swift | 17 | ||||
| -rw-r--r-- | justfile | 5 | ||||
| -rw-r--r-- | project.yml | 4 |
3 files changed, 18 insertions, 8 deletions
diff --git a/SoraTests/FolderHierarchyTests.swift b/SoraTests/FolderHierarchyTests.swift index 6bf7f4a..911b8f4 100644 --- a/SoraTests/FolderHierarchyTests.swift +++ b/SoraTests/FolderHierarchyTests.swift @@ -1,5 +1,6 @@ -import XCTest +import Nimble @testable import Sora +import XCTest final class FolderHierarchyTests: XCTestCase { func testTopLevelFolderIncludesRootFolderAndNestedChildren() { @@ -17,10 +18,10 @@ final class FolderHierarchyTests: XCTestCase { ) let hierarchy = FolderHierarchy(folders: [rootFolder, nestedFolder, unrelatedFolder]) - XCTAssertTrue(hierarchy.isInTopLevelFolder(rootFolder.id, named: "Artists")) - XCTAssertTrue(hierarchy.isInTopLevelFolder(nestedFolder.id, named: "Artists")) - XCTAssertFalse(hierarchy.isInTopLevelFolder(unrelatedFolder.id, named: "Artists")) - XCTAssertFalse(hierarchy.isInTopLevelFolder(nil, named: "Artists")) + expect(hierarchy.isInTopLevelFolder(rootFolder.id, named: "Artists")) == true + expect(hierarchy.isInTopLevelFolder(nestedFolder.id, named: "Artists")) == true + expect(hierarchy.isInTopLevelFolder(unrelatedFolder.id, named: "Artists")) == false + expect(hierarchy.isInTopLevelFolder(nil, named: "Artists")) == false } func testTopLevelUncategorizedOnlyMatchesRootFolder() { @@ -34,8 +35,8 @@ final class FolderHierarchyTests: XCTestCase { ) let hierarchy = FolderHierarchy(folders: [rootFolder, nestedFolder]) - XCTAssertTrue(hierarchy.isInTopLevelUncategorized(rootFolder.id, named: "Artists")) - XCTAssertFalse(hierarchy.isInTopLevelUncategorized(nestedFolder.id, named: "Artists")) - XCTAssertFalse(hierarchy.isInTopLevelUncategorized(nil, named: "Artists")) + expect(hierarchy.isInTopLevelUncategorized(rootFolder.id, named: "Artists")) == true + expect(hierarchy.isInTopLevelUncategorized(nestedFolder.id, named: "Artists")) == false + expect(hierarchy.isInTopLevelUncategorized(nil, named: "Artists")) == false } } @@ -35,6 +35,11 @@ localize destination="platform=macOS" configuration="Debug": xcodebuild -project Sora.xcodeproj -configuration {{configuration}} -scheme {{target}} -destination '{{destination}}' CODE_SIGNING_ALLOWED=NO build _test destination="platform=iOS Simulator,name=iPhone 17 Pro" scheme="SoraTests" configuration="Debug" *xcodebuild_args: + simulator_name="$(printf '%s\n' '{{destination}}' | sed -n "s/.*name=\\([^,']*\\).*/\\1/p")"; \ + if [ -n "${simulator_name}" ]; then \ + xcrun simctl boot "${simulator_name}" >/dev/null 2>&1 || true; \ + xcrun simctl bootstatus "${simulator_name}" -b; \ + fi xcodebuild -project Sora.xcodeproj -configuration {{configuration}} -scheme {{scheme}} -destination '{{destination}}' {{xcodebuild_args}} test test destination="platform=iOS Simulator,name=iPhone 17 Pro" scheme="SoraTests" configuration="Debug": diff --git a/project.yml b/project.yml index f71376c..0a16834 100644 --- a/project.yml +++ b/project.yml @@ -31,6 +31,9 @@ packages: SkeletonUI: url: https://github.com/CSolanaM/SkeletonUI branch: master + Nimble: + url: https://github.com/Quick/Nimble + majorVersion: 13.0.0 targets: Sora: type: application @@ -113,3 +116,4 @@ targets: GENERATE_INFOPLIST_FILE: YES dependencies: - target: Sora + - package: Nimble |