From 1e07acd032a6e5d0731a03d44070d1b83b906983 Mon Sep 17 00:00:00 2001 From: iska Date: Mon, 11 Apr 2016 01:13:24 +0200 Subject: [PATCH] Use tests observer in the HTMLKit Tree Construction tests --- HTMLKitTests/HTMLKitTreeConstructionTests.m | 22 ++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/HTMLKitTests/HTMLKitTreeConstructionTests.m b/HTMLKitTests/HTMLKitTreeConstructionTests.m index d8de4be..4a8a87a 100644 --- a/HTMLKitTests/HTMLKitTreeConstructionTests.m +++ b/HTMLKitTests/HTMLKitTreeConstructionTests.m @@ -8,6 +8,7 @@ #import +#import "HTMLKitTestObserver.h" #import "HTML5LibTreeConstructionTest.h" #import "HTMLDOM.h" #import "HTMLParser.h" @@ -26,6 +27,10 @@ #pragma mark - HTML5Lib Test Suite @interface HTMLKitTreeConstructionTests : XCTestCase +{ + HTMLKitTestObserver *_observer; +} + @property (nonatomic, strong) NSString *testName; @property (nonatomic, strong) NSArray *testsList; @end @@ -76,8 +81,23 @@ } - (NSString *)description +#pragma mark - Setup + +- (void)setUp { - return self.name; + _observer = [[HTMLKitTestObserver alloc] initWithName:self.testName]; + [[XCTestObservationCenter sharedTestObservationCenter] addTestObserver:_observer]; + + [super setUp]; +} + +- (void)tearDown +{ + HTMLKitTestReport *testReport = [_observer generateReport]; + XCTAssertTrue(testReport.failureCount == 0, @"%@", testReport.failureReport); + + [[XCTestObservationCenter sharedTestObservationCenter] removeTestObserver:_observer]; + [super tearDown]; } #pragma mark - Tests