Last active
January 11, 2021 16:01
-
-
Save mattmassicotte/e2462f0338937fab6e468192ea5a8fa9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func testCurrentYearAppearsInInfoPlistCopyright() throws { | |
let bundle = Bundle(for: AppDelegate.self) | |
let plist = try XCTUnwrap(bundle.localizedInfoDictionary) | |
let string = try XCTUnwrap(plist["NSHumanReadableCopyright"] as? String) | |
let formatter = DateFormatter() | |
formatter.dateFormat = "yyyy" | |
let currentYear = formatter.string(from: Date()) | |
XCTAssert(string.contains(currentYear)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment