From 06a347c4501f94ad2ba528f07134d9d01319379b Mon Sep 17 00:00:00 2001 From: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> Date: Mon, 21 Oct 2024 07:35:16 -0400 Subject: [PATCH] Use `isEmpty` / `beEmpty()`. Partial #592 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com> --- Sources/mas/Commands/Upgrade.swift | 2 +- Tests/masTests/Formatters/AppListFormatterSpec.swift | 2 +- Tests/masTests/Formatters/SearchResultFormatterSpec.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/mas/Commands/Upgrade.swift b/Sources/mas/Commands/Upgrade.swift index bd23d93..db825b6 100644 --- a/Sources/mas/Commands/Upgrade.swift +++ b/Sources/mas/Commands/Upgrade.swift @@ -33,7 +33,7 @@ extension Mas { throw error as? MASError ?? .searchFailed } - guard apps.count > 0 else { + guard !apps.isEmpty else { printWarning("Nothing found to upgrade") return } diff --git a/Tests/masTests/Formatters/AppListFormatterSpec.swift b/Tests/masTests/Formatters/AppListFormatterSpec.swift index 98ed50f..42346ae 100644 --- a/Tests/masTests/Formatters/AppListFormatterSpec.swift +++ b/Tests/masTests/Formatters/AppListFormatterSpec.swift @@ -25,7 +25,7 @@ public class AppListsFormatterSpec: QuickSpec { products = [] } it("formats nothing as empty string") { - expect(format(products)) == "" + expect(format(products)).to(beEmpty()) } it("can format a single product") { let product = SoftwareProductMock( diff --git a/Tests/masTests/Formatters/SearchResultFormatterSpec.swift b/Tests/masTests/Formatters/SearchResultFormatterSpec.swift index f92731d..10fec4b 100644 --- a/Tests/masTests/Formatters/SearchResultFormatterSpec.swift +++ b/Tests/masTests/Formatters/SearchResultFormatterSpec.swift @@ -25,7 +25,7 @@ public class SearchResultsFormatterSpec: QuickSpec { results = [] } it("formats nothing as empty string") { - expect(format(results, false)) == "" + expect(format(results, false)).to(beEmpty()) } it("can format a single result") { let result = SearchResult(