From 47ef2e201363904c8175566fe2e192274ad9a4f1 Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Fri, 19 Jan 2018 13:47:21 -0800 Subject: [PATCH] Fix test failing Summary: https://github.com/twitter/twitter-kit-ios/pull/11 --- .../Views/TWTRTimestampLabelTests.m | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/TwitterKit/TwitterKitTests/SocialTests/Syndication/Views/TWTRTimestampLabelTests.m b/TwitterKit/TwitterKitTests/SocialTests/Syndication/Views/TWTRTimestampLabelTests.m index f3f6ff33..f287ba31 100644 --- a/TwitterKit/TwitterKitTests/SocialTests/Syndication/Views/TWTRTimestampLabelTests.m +++ b/TwitterKit/TwitterKitTests/SocialTests/Syndication/Views/TWTRTimestampLabelTests.m @@ -15,6 +15,8 @@ * */ +#import +#import #import #import "TUDelorean+Rollback.h" #import "TUDelorean.h" @@ -38,6 +40,9 @@ - (void)setUp { [super setUp]; + [TWTRDateFormatters resetCache]; + [TWTRDateFormatters setLocale:[NSLocale localeWithLocaleIdentifier:@"en_US"]]; + self.timestamp = [[TWTRTimestampLabel alloc] init]; // Tweet setup @@ -74,13 +79,14 @@ - (void)testNilDate_EmptyStrings - (void)testRegularFormattedDate { - [TUDelorean temporarilyTimeTravelTo:self.november2014 block:^(NSDate *date) { - self.timestamp.date = self.obamaTweet.createdAt; - XCTAssertEqualObjects(self.timestamp.text, @" • 11/6/12"); + [TUDelorean temporarilyTimeTravelTo:self.november2014 + block:^(NSDate *date) { + self.timestamp.date = self.obamaTweet.createdAt; + XCTAssertEqualObjects(self.timestamp.text, @" • 11/6/12"); - self.timestamp.date = self.googleTweet.createdAt; - XCTAssertEqualObjects(self.timestamp.text, @" • May 23"); - }]; + self.timestamp.date = self.googleTweet.createdAt; + XCTAssertEqualObjects(self.timestamp.text, @" • May 23"); + }]; } @end