Skip to content

Commit

Permalink
Merge pull request #270 from tbaranes/master
Browse files Browse the repository at this point in the history
Fixes for Swiftlint 0.22.0
  • Loading branch information
bizz84 authored Sep 25, 2017
2 parents 9d1b446 + bf4cd55 commit 53c0a8d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 20 deletions.
1 change: 0 additions & 1 deletion SwiftyStoreKit-iOS-Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
SwiftyStoreKit.completeTransactions(atomically: true) { purchases in

for purchase in purchases {
// swiftlint:disable:next for_where
if purchase.transaction.transactionState == .purchased || purchase.transaction.transactionState == .restored {

if purchase.needsFinishTransaction {
Expand Down
1 change: 0 additions & 1 deletion SwiftyStoreKit-macOS-Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
SwiftyStoreKit.completeTransactions(atomically: true) { purchases in

for purchase in purchases {
// swiftlint:disable:next for_where
if purchase.transaction.transactionState == .purchased || purchase.transaction.transactionState == .restored {

if purchase.needsFinishTransaction {
Expand Down
34 changes: 17 additions & 17 deletions SwiftyStoreKitTests/InAppReceiptVerificatorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class InAppReceiptVerificatorTests: XCTestCase {
refreshCalled = true
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { _ in
}, completion: { _ in

}
})
XCTAssertTrue(refreshCalled)
}

Expand All @@ -100,9 +100,9 @@ class InAppReceiptVerificatorTests: XCTestCase {
refreshCalled = true
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { _ in
}, completion: { _ in

}
})
XCTAssertTrue(refreshCalled)
}

Expand All @@ -120,9 +120,9 @@ class InAppReceiptVerificatorTests: XCTestCase {
refreshCalled = true
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { _ in
}, completion: { _ in

}
})
XCTAssertTrue(refreshCalled)
}

Expand All @@ -137,10 +137,10 @@ class InAppReceiptVerificatorTests: XCTestCase {
callback(.error(e: refreshError))
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { result in
}, completion: { result in

XCTAssertEqual(result, VerifyReceiptResult.error(error: ReceiptError.networkError(error: refreshError)))
}
})
}

func testVerifyReceipt_when_appStoreReceiptURLIsNil_refreshCallbackSuccess_receiptDataNotWritten_then_errorNoReceiptData_validateNotCalled() {
Expand All @@ -152,11 +152,11 @@ class InAppReceiptVerificatorTests: XCTestCase {

callback(.success)
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)
}) { result in

}, completion: { result in

XCTAssertEqual(result, VerifyReceiptResult.error(error: ReceiptError.noReceiptData))
}
})
XCTAssertFalse(validator.validateCalled)
}

Expand All @@ -173,10 +173,10 @@ class InAppReceiptVerificatorTests: XCTestCase {
callback(.success)
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { result in
}, completion: { result in

XCTAssertEqual(result, VerifyReceiptResult.error(error: ReceiptError.noReceiptData))
}
})
XCTAssertFalse(validator.validateCalled)
removeReceiptData(at: testReceiptURL)
}
Expand All @@ -194,9 +194,9 @@ class InAppReceiptVerificatorTests: XCTestCase {
callback(.success)
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { _ in
}, completion: { _ in

}
})
XCTAssertTrue(validator.validateCalled)
removeReceiptData(at: testReceiptURL)
}
Expand All @@ -215,9 +215,9 @@ class InAppReceiptVerificatorTests: XCTestCase {
XCTFail("refresh should not be called if we already have a receipt")
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { _ in
}, completion: { _ in

}
})
XCTAssertTrue(validator.validateCalled)
removeReceiptData(at: testReceiptURL)
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_swiftlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
set -e

SWIFTLINT_PKG_PATH="/tmp/SwiftLint.pkg"
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.21.0/SwiftLint.pkg"
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.22.0/SwiftLint.pkg"

wget --output-document=$SWIFTLINT_PKG_PATH $SWIFTLINT_PKG_URL

Expand Down

0 comments on commit 53c0a8d

Please sign in to comment.