mirror of
https://github.com/mas-cli/mas
synced 2024-11-24 04:23:09 +00:00
Rename MasAppLibrary
as SoftwareMapAppLibrary
.
Rename `AppLibraryMock` as `MockAppLibrary`. Partial #585 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
parent
d7072fc66d
commit
cc219fe644
17 changed files with 22 additions and 22 deletions
|
@ -23,7 +23,7 @@ extension MAS {
|
|||
|
||||
/// Runs the command.
|
||||
func run() throws {
|
||||
try run(appLibrary: MasAppLibrary())
|
||||
try run(appLibrary: SoftwareMapAppLibrary())
|
||||
}
|
||||
|
||||
func run(appLibrary: AppLibrary) throws {
|
||||
|
|
|
@ -17,7 +17,7 @@ extension MAS {
|
|||
|
||||
/// Runs the command.
|
||||
func run() throws {
|
||||
try run(appLibrary: MasAppLibrary())
|
||||
try run(appLibrary: SoftwareMapAppLibrary())
|
||||
}
|
||||
|
||||
func run(appLibrary: AppLibrary) throws {
|
||||
|
|
|
@ -25,7 +25,7 @@ extension MAS {
|
|||
|
||||
/// Runs the command.
|
||||
func run() throws {
|
||||
try run(appLibrary: MasAppLibrary(), searcher: ITunesSearchAppStoreSearcher())
|
||||
try run(appLibrary: SoftwareMapAppLibrary(), searcher: ITunesSearchAppStoreSearcher())
|
||||
}
|
||||
|
||||
func run(appLibrary: AppLibrary, searcher: AppStoreSearcher) throws {
|
||||
|
|
|
@ -23,7 +23,7 @@ extension MAS {
|
|||
|
||||
/// Runs the command.
|
||||
func run() throws {
|
||||
try run(appLibrary: MasAppLibrary(), searcher: ITunesSearchAppStoreSearcher())
|
||||
try run(appLibrary: SoftwareMapAppLibrary(), searcher: ITunesSearchAppStoreSearcher())
|
||||
}
|
||||
|
||||
func run(appLibrary: AppLibrary, searcher: AppStoreSearcher) throws {
|
||||
|
|
|
@ -20,7 +20,7 @@ extension MAS {
|
|||
|
||||
/// Runs the command.
|
||||
func run() throws {
|
||||
try run(appLibrary: MasAppLibrary())
|
||||
try run(appLibrary: SoftwareMapAppLibrary())
|
||||
}
|
||||
|
||||
func run(appLibrary: AppLibrary) throws {
|
||||
|
|
|
@ -24,7 +24,7 @@ extension MAS {
|
|||
|
||||
/// Runs the uninstall command.
|
||||
func run() throws {
|
||||
try run(appLibrary: MasAppLibrary())
|
||||
try run(appLibrary: SoftwareMapAppLibrary())
|
||||
}
|
||||
|
||||
func run(appLibrary: AppLibrary) throws {
|
||||
|
|
|
@ -22,7 +22,7 @@ extension MAS {
|
|||
|
||||
/// Runs the command.
|
||||
func run() throws {
|
||||
try run(appLibrary: MasAppLibrary(), searcher: ITunesSearchAppStoreSearcher())
|
||||
try run(appLibrary: SoftwareMapAppLibrary(), searcher: ITunesSearchAppStoreSearcher())
|
||||
}
|
||||
|
||||
func run(appLibrary: AppLibrary, searcher: AppStoreSearcher) throws {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// MasAppLibrary.swift
|
||||
// SoftwareMapAppLibrary.swift
|
||||
// mas
|
||||
//
|
||||
// Created by Ben Chatelain on 12/27/18.
|
||||
|
@ -10,7 +10,7 @@ import CommerceKit
|
|||
import ScriptingBridge
|
||||
|
||||
/// Utility for managing installed apps.
|
||||
class MasAppLibrary: AppLibrary {
|
||||
class SoftwareMapAppLibrary: AppLibrary {
|
||||
/// CommerceKit's singleton manager of installed software.
|
||||
private let softwareMap: SoftwareMap
|
||||
|
|
@ -19,7 +19,7 @@ public class InstallSpec: QuickSpec {
|
|||
xdescribe("install command") {
|
||||
xit("installs apps") {
|
||||
expect {
|
||||
try MAS.Install.parse([]).run(appLibrary: AppLibraryMock())
|
||||
try MAS.Install.parse([]).run(appLibrary: MockAppLibrary())
|
||||
}
|
||||
.toNot(throwError())
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ public class ListSpec: QuickSpec {
|
|||
it("lists apps") {
|
||||
expect {
|
||||
try captureStream(stderr) {
|
||||
try MAS.List.parse([]).run(appLibrary: AppLibraryMock())
|
||||
try MAS.List.parse([]).run(appLibrary: MockAppLibrary())
|
||||
}
|
||||
}
|
||||
== "Error: No installed apps found\n"
|
||||
|
|
|
@ -22,7 +22,7 @@ public class LuckySpec: QuickSpec {
|
|||
xdescribe("lucky command") {
|
||||
xit("installs the first app matching a search") {
|
||||
expect {
|
||||
try MAS.Lucky.parse(["Slack"]).run(appLibrary: AppLibraryMock(), searcher: searcher)
|
||||
try MAS.Lucky.parse(["Slack"]).run(appLibrary: MockAppLibrary(), searcher: searcher)
|
||||
}
|
||||
.toNot(throwError())
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class OutdatedSpec: QuickSpec {
|
|||
let searcher = MockAppStoreSearcher()
|
||||
searcher.apps[mockSearchResult.trackId] = mockSearchResult
|
||||
|
||||
let mockAppLibrary = AppLibraryMock()
|
||||
let mockAppLibrary = MockAppLibrary()
|
||||
mockAppLibrary.installedApps.append(
|
||||
SoftwareProductMock(
|
||||
appName: mockSearchResult.trackName,
|
||||
|
|
|
@ -19,7 +19,7 @@ public class PurchaseSpec: QuickSpec {
|
|||
xdescribe("purchase command") {
|
||||
xit("purchases apps") {
|
||||
expect {
|
||||
try MAS.Purchase.parse(["999"]).run(appLibrary: AppLibraryMock())
|
||||
try MAS.Purchase.parse(["999"]).run(appLibrary: MockAppLibrary())
|
||||
}
|
||||
.toNot(throwError())
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public class UninstallSpec: QuickSpec {
|
|||
bundleVersion: "1.0",
|
||||
itemIdentifier: NSNumber(value: appID)
|
||||
)
|
||||
let mockLibrary = AppLibraryMock()
|
||||
let mockLibrary = MockAppLibrary()
|
||||
|
||||
context("dry run") {
|
||||
let uninstall = try! MAS.Uninstall.parse(["--dry-run", String(appID)])
|
||||
|
|
|
@ -22,7 +22,7 @@ public class UpgradeSpec: QuickSpec {
|
|||
expect {
|
||||
try captureStream(stderr) {
|
||||
try MAS.Upgrade.parse([])
|
||||
.run(appLibrary: AppLibraryMock(), searcher: MockAppStoreSearcher())
|
||||
.run(appLibrary: MockAppLibrary(), searcher: MockAppStoreSearcher())
|
||||
}
|
||||
}
|
||||
== "Warning: Nothing found to upgrade\n"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// AppLibraryMock.swift
|
||||
// MockAppLibrary.swift
|
||||
// masTests
|
||||
//
|
||||
// Created by Ben Chatelain on 12/27/18.
|
||||
|
@ -8,7 +8,7 @@
|
|||
|
||||
@testable import mas
|
||||
|
||||
class AppLibraryMock: AppLibrary {
|
||||
class MockAppLibrary: AppLibrary {
|
||||
var installedApps: [SoftwareProduct] = []
|
||||
|
||||
func uninstallApps(atPaths appPaths: [String]) throws {
|
||||
|
@ -20,7 +20,7 @@ class AppLibraryMock: AppLibrary {
|
|||
}
|
||||
|
||||
/// Members not part of the AppLibrary protocol that are only for test state management.
|
||||
extension AppLibraryMock {
|
||||
extension MockAppLibrary {
|
||||
/// Clears out the list of installed apps.
|
||||
func reset() {
|
||||
installedApps = []
|
|
@ -1,5 +1,5 @@
|
|||
//
|
||||
// MasAppLibrarySpec.swift
|
||||
// SoftwareMapAppLibrarySpec.swift
|
||||
// masTests
|
||||
//
|
||||
// Created by Ben Chatelain on 3/1/20.
|
||||
|
@ -11,9 +11,9 @@ import Quick
|
|||
|
||||
@testable import mas
|
||||
|
||||
public class MasAppLibrarySpec: QuickSpec {
|
||||
public class SoftwareMapAppLibrarySpec: QuickSpec {
|
||||
override public func spec() {
|
||||
let library = MasAppLibrary(softwareMap: SoftwareMapMock(products: apps))
|
||||
let library = SoftwareMapAppLibrary(softwareMap: SoftwareMapMock(products: apps))
|
||||
|
||||
beforeSuite {
|
||||
MAS.initialize()
|
Loading…
Reference in a new issue