mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 11:33:13 +00:00
👌🏻Address review comments
This commit is contained in:
parent
a955ff6bca
commit
8ef416cf35
2 changed files with 3 additions and 2 deletions
|
@ -29,7 +29,8 @@ extension SoftwareProduct {
|
||||||
/// - Returns: true if the app is outdated; false otherwise.
|
/// - Returns: true if the app is outdated; false otherwise.
|
||||||
func isOutdatedWhenComparedTo(_ storeApp: SearchResult) -> Bool {
|
func isOutdatedWhenComparedTo(_ storeApp: SearchResult) -> Bool {
|
||||||
// Only look at min OS version if we have one, also only consider macOS apps
|
// Only look at min OS version if we have one, also only consider macOS apps
|
||||||
if let osVersion = Version(storeApp.minimumOsVersion), storeApp.kind == "mac-software" {
|
// TODO: Replace string literal with MasStoreSearch.Entity once search branch is merged.
|
||||||
|
if let osVersion = Version(tolerant: storeApp.minimumOsVersion), storeApp.kind == "mac-software" {
|
||||||
let requiredVersion = OperatingSystemVersion(majorVersion: osVersion.major, minorVersion: osVersion.minor,
|
let requiredVersion = OperatingSystemVersion(majorVersion: osVersion.major, minorVersion: osVersion.minor,
|
||||||
patchVersion: osVersion.patch)
|
patchVersion: osVersion.patch)
|
||||||
// Don't consider an app outdated if the version in the app store requires a higher OS version.
|
// Don't consider an app outdated if the version in the app store requires a higher OS version.
|
||||||
|
|
|
@ -26,7 +26,7 @@ public class SoftwareProductSpec: QuickSpec {
|
||||||
let higherOs = SearchResult(kind: "mac-software", minimumOsVersion: "99.0.0", version: "3.0.0")
|
let higherOs = SearchResult(kind: "mac-software", minimumOsVersion: "99.0.0", version: "3.0.0")
|
||||||
let updateIos = SearchResult(kind: "software", minimumOsVersion: "99.0.0", version: "3.0.0")
|
let updateIos = SearchResult(kind: "software", minimumOsVersion: "99.0.0", version: "3.0.0")
|
||||||
|
|
||||||
it("is not outdated there is no new version available") {
|
it("is not outdated when there is no new version available") {
|
||||||
expect(app.isOutdatedWhenComparedTo(currentApp)) == false
|
expect(app.isOutdatedWhenComparedTo(currentApp)) == false
|
||||||
}
|
}
|
||||||
it("is outdated when there is a new version available") {
|
it("is outdated when there is a new version available") {
|
||||||
|
|
Loading…
Reference in a new issue