                     let rendering = template.render(self.renderedValue, error: &error)
                 })
             } else {
-                testError(error, replayOnFailure: {
+                XCTAssertNotNil(error, "Expected rendering error in \(description)")
+                testError(error!, replayOnFailure: {
                     let rendering = template.render(self.renderedValue, error: &error)
                 })
             }
         }
         
-        func testError(error: NSError!, replayOnFailure replayBlock: ()->()) {
+        func testError(error: NSError, replayOnFailure replayBlock: ()->()) {
             if let expectedError = expectedError {
                 var regError: NSError?
                 if let reg = NSRegularExpression(pattern: expectedError, options: NSRegularExpressionOptions(0), error: &regError) {

        runTestsFromResource("sections.json", directory: "GRMustacheSuite")
//        runTestsFromResource("standard_library.json", directory: "GRMustacheSuite")
        runTestsFromResource("tag_parsing_errors.json", directory: "GRMustacheSuite")
//        runTestsFromResource("text_rendering.json", directory: "GRMustacheSuite")
        runTestsFromResource("variables.json", directory: "GRMustacheSuite")
    }
    

                        if let template = TemplateRepository(directoryPath: directoryPath, templateExtension: "", encoding: encoding).templateFromString(templateString, error: &error) {
                            templates.append(template)
                        } else {
                            XCTAssertNotNil(error, "Expected parsing error in \(description)")
                            testError(error!, replayOnFailure: {
                                let template = TemplateRepository(directoryPath: directoryPath, templateExtension: "", encoding: encoding).templateFromString(templateString, error: &error)
                            })
                        }
                        if let template = TemplateRepository(baseURL: NSURL.fileURLWithPath(directoryPath)!, templateExtension: "", encoding: encoding).templateFromString(templateString, error: &error) {
                            templates.append(template)
                        } else {
                            XCTAssertNotNil(error, "Expected parsing error in \(description)")
                            testError(error!, replayOnFailure: {
                                let template = TemplateRepository(baseURL: NSURL.fileURLWithPath(directoryPath)!, templateExtension: "", encoding: encoding).templateFromString(templateString, error: &error)
                            })
                        }
