diff --git a/Sources/mas/Commands/Home.swift b/Sources/mas/Commands/Home.swift index d9d3b23..c9e186e 100644 --- a/Sources/mas/Commands/Home.swift +++ b/Sources/mas/Commands/Home.swift @@ -21,12 +21,12 @@ extension MAS { /// Runs the command. func run() throws { - try run(storeSearch: MasStoreSearch(), openCommand: OpenSystemCommand()) + try run(searcher: ITunesSearchAppStoreSearcher(), openCommand: OpenSystemCommand()) } - func run(storeSearch: StoreSearch, openCommand: ExternalCommand) throws { + func run(searcher: AppStoreSearcher, openCommand: ExternalCommand) throws { do { - guard let result = try storeSearch.lookup(appID: appID).wait() else { + guard let result = try searcher.lookup(appID: appID).wait() else { throw MASError.noSearchResultsFound } diff --git a/Sources/mas/Commands/Info.swift b/Sources/mas/Commands/Info.swift index e832d20..5352097 100644 --- a/Sources/mas/Commands/Info.swift +++ b/Sources/mas/Commands/Info.swift @@ -22,12 +22,12 @@ extension MAS { /// Runs the command. func run() throws { - try run(storeSearch: MasStoreSearch()) + try run(searcher: ITunesSearchAppStoreSearcher()) } - func run(storeSearch: StoreSearch) throws { + func run(searcher: AppStoreSearcher) throws { do { - guard let result = try storeSearch.lookup(appID: appID).wait() else { + guard let result = try searcher.lookup(appID: appID).wait() else { throw MASError.noSearchResultsFound } diff --git a/Sources/mas/Commands/Lucky.swift b/Sources/mas/Commands/Lucky.swift index f2a33c3..eba32b1 100644 --- a/Sources/mas/Commands/Lucky.swift +++ b/Sources/mas/Commands/Lucky.swift @@ -25,14 +25,14 @@ extension MAS { /// Runs the command. func run() throws { - try run(appLibrary: MasAppLibrary(), storeSearch: MasStoreSearch()) + try run(appLibrary: MasAppLibrary(), searcher: ITunesSearchAppStoreSearcher()) } - func run(appLibrary: AppLibrary, storeSearch: StoreSearch) throws { + func run(appLibrary: AppLibrary, searcher: AppStoreSearcher) throws { var appID: AppID? do { - let results = try storeSearch.search(for: searchTerm).wait() + let results = try searcher.search(for: searchTerm).wait() guard let result = results.first else { printError("No results found") throw MASError.noSearchResultsFound diff --git a/Sources/mas/Commands/Open.swift b/Sources/mas/Commands/Open.swift index c2369e9..a924895 100644 --- a/Sources/mas/Commands/Open.swift +++ b/Sources/mas/Commands/Open.swift @@ -16,7 +16,7 @@ extension MAS { /// https://performance-partners.apple.com/search-api struct Open: ParsableCommand { static let configuration = CommandConfiguration( - abstract: "Opens app page in AppStore.app" + abstract: "Opens app page in 'App Store.app'" ) @Argument(help: "the app ID") @@ -24,10 +24,10 @@ extension MAS { /// Runs the command. func run() throws { - try run(storeSearch: MasStoreSearch(), openCommand: OpenSystemCommand()) + try run(searcher: ITunesSearchAppStoreSearcher(), openCommand: OpenSystemCommand()) } - func run(storeSearch: StoreSearch, openCommand: ExternalCommand) throws { + func run(searcher: AppStoreSearcher, openCommand: ExternalCommand) throws { do { guard let appID else { // If no app ID is given, just open the MAS GUI app @@ -35,7 +35,7 @@ extension MAS { return } - guard let result = try storeSearch.lookup(appID: appID).wait() else { + guard let result = try searcher.lookup(appID: appID).wait() else { throw MASError.noSearchResultsFound } diff --git a/Sources/mas/Commands/Outdated.swift b/Sources/mas/Commands/Outdated.swift index 77325ba..94f5039 100644 --- a/Sources/mas/Commands/Outdated.swift +++ b/Sources/mas/Commands/Outdated.swift @@ -23,15 +23,15 @@ extension MAS { /// Runs the command. func run() throws { - try run(appLibrary: MasAppLibrary(), storeSearch: MasStoreSearch()) + try run(appLibrary: MasAppLibrary(), searcher: ITunesSearchAppStoreSearcher()) } - func run(appLibrary: AppLibrary, storeSearch: StoreSearch) throws { + func run(appLibrary: AppLibrary, searcher: AppStoreSearcher) throws { _ = try when( fulfilled: appLibrary.installedApps.map { installedApp in firstly { - storeSearch.lookup(appID: installedApp.itemIdentifier.appIDValue) + searcher.lookup(appID: installedApp.itemIdentifier.appIDValue) } .done { storeApp in guard let storeApp else { diff --git a/Sources/mas/Commands/Search.swift b/Sources/mas/Commands/Search.swift index ef14e1e..ae36163 100644 --- a/Sources/mas/Commands/Search.swift +++ b/Sources/mas/Commands/Search.swift @@ -23,12 +23,12 @@ extension MAS { var searchTerm: String func run() throws { - try run(storeSearch: MasStoreSearch()) + try run(searcher: ITunesSearchAppStoreSearcher()) } - func run(storeSearch: StoreSearch) throws { + func run(searcher: AppStoreSearcher) throws { do { - let results = try storeSearch.search(for: searchTerm).wait() + let results = try searcher.search(for: searchTerm).wait() if results.isEmpty { throw MASError.noSearchResultsFound } diff --git a/Sources/mas/Commands/Upgrade.swift b/Sources/mas/Commands/Upgrade.swift index 079550e..a0db6f8 100644 --- a/Sources/mas/Commands/Upgrade.swift +++ b/Sources/mas/Commands/Upgrade.swift @@ -22,13 +22,13 @@ extension MAS { /// Runs the command. func run() throws { - try run(appLibrary: MasAppLibrary(), storeSearch: MasStoreSearch()) + try run(appLibrary: MasAppLibrary(), searcher: ITunesSearchAppStoreSearcher()) } - func run(appLibrary: AppLibrary, storeSearch: StoreSearch) throws { + func run(appLibrary: AppLibrary, searcher: AppStoreSearcher) throws { let apps: [(installedApp: SoftwareProduct, storeApp: SearchResult)] do { - apps = try findOutdatedApps(appLibrary: appLibrary, storeSearch: storeSearch) + apps = try findOutdatedApps(appLibrary: appLibrary, searcher: searcher) } catch { throw error as? MASError ?? .searchFailed } @@ -53,7 +53,7 @@ extension MAS { private func findOutdatedApps( appLibrary: AppLibrary, - storeSearch: StoreSearch + searcher: AppStoreSearcher ) throws -> [(SoftwareProduct, SearchResult)] { let apps = appIDs.isEmpty @@ -71,7 +71,7 @@ extension MAS { let promises = apps.map { installedApp in // only upgrade apps whose local version differs from the store version firstly { - storeSearch.lookup(appID: installedApp.itemIdentifier.appIDValue) + searcher.lookup(appID: installedApp.itemIdentifier.appIDValue) } .map { result -> (SoftwareProduct, SearchResult)? in guard let storeApp = result, installedApp.isOutdatedWhenComparedTo(storeApp) else { diff --git a/Sources/mas/Commands/Vendor.swift b/Sources/mas/Commands/Vendor.swift index d3004a1..31189e3 100644 --- a/Sources/mas/Commands/Vendor.swift +++ b/Sources/mas/Commands/Vendor.swift @@ -21,12 +21,12 @@ extension MAS { /// Runs the command. func run() throws { - try run(storeSearch: MasStoreSearch(), openCommand: OpenSystemCommand()) + try run(searcher: ITunesSearchAppStoreSearcher(), openCommand: OpenSystemCommand()) } - func run(storeSearch: StoreSearch, openCommand: ExternalCommand) throws { + func run(searcher: AppStoreSearcher, openCommand: ExternalCommand) throws { do { - guard let result = try storeSearch.lookup(appID: appID).wait() else { + guard let result = try searcher.lookup(appID: appID).wait() else { throw MASError.noSearchResultsFound } diff --git a/Sources/mas/Controllers/StoreSearch.swift b/Sources/mas/Controllers/AppStoreSearcher.swift similarity index 96% rename from Sources/mas/Controllers/StoreSearch.swift rename to Sources/mas/Controllers/AppStoreSearcher.swift index 0b8194c..4e5b65e 100644 --- a/Sources/mas/Controllers/StoreSearch.swift +++ b/Sources/mas/Controllers/AppStoreSearcher.swift @@ -1,5 +1,5 @@ // -// StoreSearch.swift +// AppStoreSearcher.swift // mas // // Created by Ben Chatelain on 12/29/18. @@ -10,7 +10,7 @@ import Foundation import PromiseKit /// Protocol for searching the MAS catalog. -protocol StoreSearch { +protocol AppStoreSearcher { func lookup(appID: AppID) -> Promise func search(for searchTerm: String) -> Promise<[SearchResult]> } @@ -37,7 +37,7 @@ private enum URLAction { } // MARK: - Common methods -extension StoreSearch { +extension AppStoreSearcher { /// Builds the search URL for an app. /// /// - Parameters: diff --git a/Sources/mas/Controllers/MasStoreSearch.swift b/Sources/mas/Controllers/ITunesSearchAppStoreSearcher.swift similarity index 98% rename from Sources/mas/Controllers/MasStoreSearch.swift rename to Sources/mas/Controllers/ITunesSearchAppStoreSearcher.swift index a046778..c6de321 100644 --- a/Sources/mas/Controllers/MasStoreSearch.swift +++ b/Sources/mas/Controllers/ITunesSearchAppStoreSearcher.swift @@ -1,5 +1,5 @@ // -// MasStoreSearch.swift +// ITunesSearchAppStoreSearcher.swift // mas // // Created by Ben Chatelain on 12/29/18. @@ -12,7 +12,7 @@ import Regex import Version /// Manages searching the MAS catalog through the iTunes Search and Lookup APIs. -class MasStoreSearch: StoreSearch { +class ITunesSearchAppStoreSearcher: AppStoreSearcher { private static let appVersionExpression = Regex(#"\"versionDisplay\"\:\"([^\"]+)\""#) // CommerceKit and StoreFoundation don't seem to expose the region of the Apple ID signed diff --git a/Tests/masTests/Commands/HomeSpec.swift b/Tests/masTests/Commands/HomeSpec.swift index 46d22f6..8e04cf9 100644 --- a/Tests/masTests/Commands/HomeSpec.swift +++ b/Tests/masTests/Commands/HomeSpec.swift @@ -13,7 +13,7 @@ import Quick public class HomeSpec: QuickSpec { override public func spec() { - let storeSearch = StoreSearchMock() + let searcher = MockAppStoreSearcher() let openCommand = OpenSystemCommandMock() beforeSuite { @@ -21,17 +21,17 @@ public class HomeSpec: QuickSpec { } describe("home command") { beforeEach { - storeSearch.reset() + searcher.reset() } it("fails to open app with invalid ID") { expect { - try MAS.Home.parse(["--", "-999"]).run(storeSearch: storeSearch, openCommand: openCommand) + try MAS.Home.parse(["--", "-999"]).run(searcher: searcher, openCommand: openCommand) } .to(throwError()) } it("can't find app with unknown ID") { expect { - try MAS.Home.parse(["999"]).run(storeSearch: storeSearch, openCommand: openCommand) + try MAS.Home.parse(["999"]).run(searcher: searcher, openCommand: openCommand) } .to(throwError(MASError.noSearchResultsFound)) } @@ -41,10 +41,10 @@ public class HomeSpec: QuickSpec { trackViewUrl: "mas preview url", version: "0.0" ) - storeSearch.apps[mockResult.trackId] = mockResult + searcher.apps[mockResult.trackId] = mockResult expect { try MAS.Home.parse([String(mockResult.trackId)]) - .run(storeSearch: storeSearch, openCommand: openCommand) + .run(searcher: searcher, openCommand: openCommand) return openCommand.arguments } == [mockResult.trackViewUrl] diff --git a/Tests/masTests/Commands/InfoSpec.swift b/Tests/masTests/Commands/InfoSpec.swift index 400ddb6..3632480 100644 --- a/Tests/masTests/Commands/InfoSpec.swift +++ b/Tests/masTests/Commands/InfoSpec.swift @@ -14,24 +14,24 @@ import Quick public class InfoSpec: QuickSpec { override public func spec() { - let storeSearch = StoreSearchMock() + let searcher = MockAppStoreSearcher() beforeSuite { MAS.initialize() } describe("Info command") { beforeEach { - storeSearch.reset() + searcher.reset() } it("fails to open app with invalid ID") { expect { - try MAS.Info.parse(["--", "-999"]).run(storeSearch: storeSearch) + try MAS.Info.parse(["--", "-999"]).run(searcher: searcher) } .to(throwError()) } it("can't find app with unknown ID") { expect { - try MAS.Info.parse(["999"]).run(storeSearch: storeSearch) + try MAS.Info.parse(["999"]).run(searcher: searcher) } .to(throwError(MASError.noSearchResultsFound)) } @@ -47,10 +47,10 @@ public class InfoSpec: QuickSpec { trackViewUrl: "https://awesome.app", version: "1.0" ) - storeSearch.apps[mockResult.trackId] = mockResult + searcher.apps[mockResult.trackId] = mockResult expect { try captureStream(stdout) { - try MAS.Info.parse([String(mockResult.trackId)]).run(storeSearch: storeSearch) + try MAS.Info.parse([String(mockResult.trackId)]).run(searcher: searcher) } } == """ diff --git a/Tests/masTests/Commands/LuckySpec.swift b/Tests/masTests/Commands/LuckySpec.swift index fa73ab9..26eff44 100644 --- a/Tests/masTests/Commands/LuckySpec.swift +++ b/Tests/masTests/Commands/LuckySpec.swift @@ -14,7 +14,7 @@ import Quick public class LuckySpec: QuickSpec { override public func spec() { let networkSession = NetworkSessionMockFromFile(responseFile: "search/slack.json") - let storeSearch = MasStoreSearch(networkManager: NetworkManager(session: networkSession)) + let searcher = ITunesSearchAppStoreSearcher(networkManager: NetworkManager(session: networkSession)) beforeSuite { MAS.initialize() @@ -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(), storeSearch: storeSearch) + try MAS.Lucky.parse(["Slack"]).run(appLibrary: AppLibraryMock(), searcher: searcher) } .toNot(throwError()) } diff --git a/Tests/masTests/Commands/OpenSpec.swift b/Tests/masTests/Commands/OpenSpec.swift index 23b7119..8459f7b 100644 --- a/Tests/masTests/Commands/OpenSpec.swift +++ b/Tests/masTests/Commands/OpenSpec.swift @@ -14,7 +14,7 @@ import Quick public class OpenSpec: QuickSpec { override public func spec() { - let storeSearch = StoreSearchMock() + let searcher = MockAppStoreSearcher() let openCommand = OpenSystemCommandMock() beforeSuite { @@ -22,17 +22,17 @@ public class OpenSpec: QuickSpec { } describe("open command") { beforeEach { - storeSearch.reset() + searcher.reset() } it("fails to open app with invalid ID") { expect { - try MAS.Open.parse(["--", "-999"]).run(storeSearch: storeSearch, openCommand: openCommand) + try MAS.Open.parse(["--", "-999"]).run(searcher: searcher, openCommand: openCommand) } .to(throwError()) } it("can't find app with unknown ID") { expect { - try MAS.Open.parse(["999"]).run(storeSearch: storeSearch, openCommand: openCommand) + try MAS.Open.parse(["999"]).run(searcher: searcher, openCommand: openCommand) } .to(throwError(MASError.noSearchResultsFound)) } @@ -42,17 +42,17 @@ public class OpenSpec: QuickSpec { trackViewUrl: "fakescheme://some/url", version: "0.0" ) - storeSearch.apps[mockResult.trackId] = mockResult + searcher.apps[mockResult.trackId] = mockResult expect { try MAS.Open.parse([mockResult.trackId.description]) - .run(storeSearch: storeSearch, openCommand: openCommand) + .run(searcher: searcher, openCommand: openCommand) return openCommand.arguments } == ["macappstore://some/url"] } it("just opens MAS if no app specified") { expect { - try MAS.Open.parse([]).run(storeSearch: storeSearch, openCommand: openCommand) + try MAS.Open.parse([]).run(searcher: searcher, openCommand: openCommand) return openCommand.arguments } == ["macappstore://"] diff --git a/Tests/masTests/Commands/OutdatedSpec.swift b/Tests/masTests/Commands/OutdatedSpec.swift index 72e0f50..6ca3d01 100644 --- a/Tests/masTests/Commands/OutdatedSpec.swift +++ b/Tests/masTests/Commands/OutdatedSpec.swift @@ -33,8 +33,8 @@ public class OutdatedSpec: QuickSpec { trackViewUrl: "https://apps.apple.com/us/app/bandwidth/id490461369?mt=12&uo=4", version: "1.28" ) - let mockStoreSearch = StoreSearchMock() - mockStoreSearch.apps[mockSearchResult.trackId] = mockSearchResult + let searcher = MockAppStoreSearcher() + searcher.apps[mockSearchResult.trackId] = mockSearchResult let mockAppLibrary = AppLibraryMock() mockAppLibrary.installedApps.append( @@ -48,7 +48,7 @@ public class OutdatedSpec: QuickSpec { ) expect { try captureStream(stdout) { - try MAS.Outdated.parse([]).run(appLibrary: mockAppLibrary, storeSearch: mockStoreSearch) + try MAS.Outdated.parse([]).run(appLibrary: mockAppLibrary, searcher: searcher) } } == "490461369 Bandwidth+ (1.27 -> 1.28)\n" diff --git a/Tests/masTests/Commands/SearchSpec.swift b/Tests/masTests/Commands/SearchSpec.swift index 3984fa1..058f5c4 100644 --- a/Tests/masTests/Commands/SearchSpec.swift +++ b/Tests/masTests/Commands/SearchSpec.swift @@ -14,14 +14,14 @@ import Quick public class SearchSpec: QuickSpec { override public func spec() { - let storeSearch = StoreSearchMock() + let searcher = MockAppStoreSearcher() beforeSuite { MAS.initialize() } describe("search command") { beforeEach { - storeSearch.reset() + searcher.reset() } it("can find slack") { let mockResult = SearchResult( @@ -30,17 +30,17 @@ public class SearchSpec: QuickSpec { trackViewUrl: "mas preview url", version: "0.0" ) - storeSearch.apps[mockResult.trackId] = mockResult + searcher.apps[mockResult.trackId] = mockResult expect { try captureStream(stdout) { - try MAS.Search.parse(["slack"]).run(storeSearch: storeSearch) + try MAS.Search.parse(["slack"]).run(searcher: searcher) } } == " 1111 slack (0.0)\n" } it("fails when searching for nonexistent app") { expect { - try MAS.Search.parse(["nonexistent"]).run(storeSearch: storeSearch) + try MAS.Search.parse(["nonexistent"]).run(searcher: searcher) } .to(throwError(MASError.noSearchResultsFound)) } diff --git a/Tests/masTests/Commands/UpgradeSpec.swift b/Tests/masTests/Commands/UpgradeSpec.swift index 585e751..e2d42f6 100644 --- a/Tests/masTests/Commands/UpgradeSpec.swift +++ b/Tests/masTests/Commands/UpgradeSpec.swift @@ -22,7 +22,7 @@ public class UpgradeSpec: QuickSpec { expect { try captureStream(stderr) { try MAS.Upgrade.parse([]) - .run(appLibrary: AppLibraryMock(), storeSearch: StoreSearchMock()) + .run(appLibrary: AppLibraryMock(), searcher: MockAppStoreSearcher()) } } == "Warning: Nothing found to upgrade\n" diff --git a/Tests/masTests/Commands/VendorSpec.swift b/Tests/masTests/Commands/VendorSpec.swift index a73d1e1..8291658 100644 --- a/Tests/masTests/Commands/VendorSpec.swift +++ b/Tests/masTests/Commands/VendorSpec.swift @@ -13,7 +13,7 @@ import Quick public class VendorSpec: QuickSpec { override public func spec() { - let storeSearch = StoreSearchMock() + let searcher = MockAppStoreSearcher() let openCommand = OpenSystemCommandMock() beforeSuite { @@ -21,17 +21,17 @@ public class VendorSpec: QuickSpec { } describe("vendor command") { beforeEach { - storeSearch.reset() + searcher.reset() } it("fails to open app with invalid ID") { expect { - try MAS.Vendor.parse(["--", "-999"]).run(storeSearch: storeSearch, openCommand: openCommand) + try MAS.Vendor.parse(["--", "-999"]).run(searcher: searcher, openCommand: openCommand) } .to(throwError()) } it("can't find app with unknown ID") { expect { - try MAS.Vendor.parse(["999"]).run(storeSearch: storeSearch, openCommand: openCommand) + try MAS.Vendor.parse(["999"]).run(searcher: searcher, openCommand: openCommand) } .to(throwError(MASError.noSearchResultsFound)) } @@ -42,10 +42,10 @@ public class VendorSpec: QuickSpec { trackViewUrl: "https://apps.apple.com/us/app/awesome/id1111?mt=12&uo=4", version: "0.0" ) - storeSearch.apps[mockResult.trackId] = mockResult + searcher.apps[mockResult.trackId] = mockResult expect { try MAS.Vendor.parse([String(mockResult.trackId)]) - .run(storeSearch: storeSearch, openCommand: openCommand) + .run(searcher: searcher, openCommand: openCommand) return openCommand.arguments } == [mockResult.sellerUrl] diff --git a/Tests/masTests/Controllers/MasStoreSearchSpec.swift b/Tests/masTests/Controllers/ITunesSearchAppStoreSearcherSpec.swift similarity index 77% rename from Tests/masTests/Controllers/MasStoreSearchSpec.swift rename to Tests/masTests/Controllers/ITunesSearchAppStoreSearcherSpec.swift index 3d75ff9..3e9f9cd 100644 --- a/Tests/masTests/Controllers/MasStoreSearchSpec.swift +++ b/Tests/masTests/Controllers/ITunesSearchAppStoreSearcherSpec.swift @@ -1,5 +1,5 @@ // -// MasStoreSearchSpec.swift +// ITunesSearchAppStoreSearcherSpec.swift // masTests // // Created by Ben Chatelain on 1/4/19. @@ -11,7 +11,7 @@ import Quick @testable import mas -public class MasStoreSearchSpec: QuickSpec { +public class ITunesSearchAppStoreSearcherSpec: QuickSpec { override public func spec() { beforeSuite { MAS.initialize() @@ -19,13 +19,13 @@ public class MasStoreSearchSpec: QuickSpec { describe("url string") { it("contains the app name") { expect { - MasStoreSearch().searchURL(for: "myapp", inCountry: "US")?.absoluteString + ITunesSearchAppStoreSearcher().searchURL(for: "myapp", inCountry: "US")?.absoluteString } == "https://itunes.apple.com/search?media=software&entity=desktopSoftware&country=US&term=myapp" } it("contains the encoded app name") { expect { - MasStoreSearch().searchURL(for: "My App", inCountry: "US")?.absoluteString + ITunesSearchAppStoreSearcher().searchURL(for: "My App", inCountry: "US")?.absoluteString } == "https://itunes.apple.com/search?media=software&entity=desktopSoftware&country=US&term=My%20App" } @@ -34,10 +34,10 @@ public class MasStoreSearchSpec: QuickSpec { context("when searched") { it("can find slack") { let networkSession = NetworkSessionMockFromFile(responseFile: "search/slack.json") - let storeSearch = MasStoreSearch(networkManager: NetworkManager(session: networkSession)) + let searcher = ITunesSearchAppStoreSearcher(networkManager: NetworkManager(session: networkSession)) expect { - try storeSearch.search(for: "slack").wait() + try searcher.search(for: "slack").wait() } .to(haveCount(39)) } @@ -47,11 +47,11 @@ public class MasStoreSearchSpec: QuickSpec { it("can find slack") { let appID: AppID = 803_453_959 let networkSession = NetworkSessionMockFromFile(responseFile: "lookup/slack.json") - let storeSearch = MasStoreSearch(networkManager: NetworkManager(session: networkSession)) + let searcher = ITunesSearchAppStoreSearcher(networkManager: NetworkManager(session: networkSession)) var result: SearchResult? do { - result = try storeSearch.lookup(appID: appID).wait() + result = try searcher.lookup(appID: appID).wait() } catch { let maserror = error as! MASError if case .jsonParsing(let nserror) = maserror { diff --git a/Tests/masTests/Controllers/StoreSearchMock.swift b/Tests/masTests/Controllers/MockAppStoreSearcher.swift similarity index 88% rename from Tests/masTests/Controllers/StoreSearchMock.swift rename to Tests/masTests/Controllers/MockAppStoreSearcher.swift index 4b5143d..1df0ef6 100644 --- a/Tests/masTests/Controllers/StoreSearchMock.swift +++ b/Tests/masTests/Controllers/MockAppStoreSearcher.swift @@ -1,5 +1,5 @@ // -// StoreSearchMock.swift +// MockAppStoreSearcher.swift // masTests // // Created by Ben Chatelain on 1/4/19. @@ -10,7 +10,7 @@ import PromiseKit @testable import mas -class StoreSearchMock: StoreSearch { +class MockAppStoreSearcher: AppStoreSearcher { var apps: [AppID: SearchResult] = [:] func search(for searchTerm: String) -> Promise<[SearchResult]> { diff --git a/contrib/completion/mas.fish b/contrib/completion/mas.fish index 592218a..de9576f 100644 --- a/contrib/completion/mas.fish +++ b/contrib/completion/mas.fish @@ -46,7 +46,7 @@ complete -c mas -n "__fish_seen_subcommand_from help" -xa "list" complete -c mas -n "__fish_use_subcommand" -f -a lucky -d "Install the first result from the Mac App Store" complete -c mas -n "__fish_seen_subcommand_from help" -xa "lucky" ### open -complete -c mas -n "__fish_use_subcommand" -f -a open -d "Opens app page in AppStore.app" +complete -c mas -n "__fish_use_subcommand" -f -a open -d "Opens app page in 'App Store.app'" complete -c mas -n "__fish_seen_subcommand_from help" -xa "open" ### outdated complete -c mas -n "__fish_use_subcommand" -f -a outdated -d "Lists pending updates from the Mac App Store"