From c1488b05157a80d15742f69142f8b409645fc143 Mon Sep 17 00:00:00 2001 From: Thomas Tempelmann Date: Mon, 16 Jan 2017 01:02:32 +0100 Subject: [PATCH] Adds test cases for "sparkle:criticalUpdate" tag. (#999) * Adds a test case for the "criticalUpdate" appcast tag (not as a XCTest but simply as an assert inside the test app, because I was lazy and am working on an older Xcode version that does not support the currently needed swift version for the XCTest in SUAppcastTest.swift). * Tests the "criticalUpdate" appcast tag, using the proper XCTest swift class. I haven't tested this, though, due to the lack of the needed Xcode version. * Test case for Appcast now checks all 4 items for the correct "criticalUpdate" state. * Adds a test case for the "criticalUpdate" appcast tag (not as a XCTest but simply as an assert inside the test app, because I was lazy and am working on an older Xcode version that does not support the currently needed swift version for the XCTest in SUAppcastTest.swift). (reverted from commit 3ce1c9790bb233dbc228379d22a5bf38a31eff37) --- Tests/Resources/testappcast.xml | 1 + Tests/SUAppcastTest.swift | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Tests/Resources/testappcast.xml b/Tests/Resources/testappcast.xml index 287dbda4..c156b310 100644 --- a/Tests/Resources/testappcast.xml +++ b/Tests/Resources/testappcast.xml @@ -7,6 +7,7 @@ desc Sat, 26 Jul 2014 15:20:11 +0000 + diff --git a/Tests/SUAppcastTest.swift b/Tests/SUAppcastTest.swift index c5250a60..5be4507e 100644 --- a/Tests/SUAppcastTest.swift +++ b/Tests/SUAppcastTest.swift @@ -25,19 +25,23 @@ class SUAppcastTest: XCTestCase { XCTAssertEqual("Version 2.0", items[0].title); XCTAssertEqual("desc", items[0].itemDescription); XCTAssertEqual("Sat, 26 Jul 2014 15:20:11 +0000", items[0].dateString) + XCTAssertTrue(items[0].isCriticalUpdate); // This is the best release matching our system version XCTAssertEqual("Version 3.0", items[1].title); XCTAssertNil(items[1].itemDescription); XCTAssertNil(items[1].dateString) + XCTAssertFalse(items[1].isCriticalUpdate); XCTAssertEqual("Version 4.0", items[2].title); XCTAssertNil(items[2].itemDescription); XCTAssertEqual("Sat, 26 Jul 2014 15:20:13 +0000", items[2].dateString) + XCTAssertFalse(items[2].isCriticalUpdate); XCTAssertEqual("Version 5.0", items[3].title); XCTAssertNil(items[3].itemDescription); XCTAssertNil(items[3].dateString) + XCTAssertFalse(items[3].isCriticalUpdate); // Test best appcast item & a delta update item var deltaItem: SUAppcastItem? = nil