[Template] Throw when initialising with non-existant file

This commit is contained in:
Kyle Fuller
2015-10-18 10:53:10 -07:00
parent 4d76fb4e60
commit f0abd34c32
2 changed files with 9 additions and 7 deletions

View File

@@ -20,6 +20,11 @@ class TemplateTests: XCTestCase {
XCTAssertEqual(result, "Hello Kyle!")
}
func testTemplateNamedInBundleThrowsForUnknownFile() {
let testBundle = NSBundle(forClass: self.dynamicType)
let template = try? Template(named: "test2.html", inBundle: testBundle)
XCTAssertNil(template)
}
func testTemplateWithNSURL() {
let testBundle = NSBundle(forClass: self.dynamicType)