From ad2080ec280fa947e992539afdd478dc34304f4f Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Mon, 25 Apr 2016 11:38:53 -0700 Subject: [PATCH 1/6] Use Xcode 7.3 for Travis-CI. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5d862dd..0c74745 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ branches: - master-v3 language: objective-c os: osx -osx_image: xcode7.2 +osx_image: xcode7.3 env: global: - LC_CTYPE=en_US.UTF-8 From 89a5ef7c7bda9e19f2215760d92226c2bc624c19 Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Mon, 25 Apr 2016 11:23:56 -0700 Subject: [PATCH 2/6] Update project/schemes to Xcode 7.3. --- ParseFacebookUtils.xcodeproj/project.pbxproj | 2 +- .../xcshareddata/xcschemes/ParseFacebookUtilsV4-iOS.xcscheme | 2 +- .../xcshareddata/xcschemes/ParseFacebookUtilsV4-tvOS.xcscheme | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ParseFacebookUtils.xcodeproj/project.pbxproj b/ParseFacebookUtils.xcodeproj/project.pbxproj index f93d704..a2c842c 100644 --- a/ParseFacebookUtils.xcodeproj/project.pbxproj +++ b/ParseFacebookUtils.xcodeproj/project.pbxproj @@ -553,7 +553,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = PF; - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0730; ORGANIZATIONNAME = "Parse, LLC"; TargetAttributes = { 81CB98C51AB7905D00136FA5 = { diff --git a/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtilsV4-iOS.xcscheme b/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtilsV4-iOS.xcscheme index 663bc3d..80286ab 100644 --- a/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtilsV4-iOS.xcscheme +++ b/ParseFacebookUtils.xcodeproj/xcshareddata/xcschemes/ParseFacebookUtilsV4-iOS.xcscheme @@ -1,6 +1,6 @@ Date: Mon, 25 Apr 2016 11:24:22 -0700 Subject: [PATCH 3/6] Update gems. --- Gemfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 537fb5e..3a8aba1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (4.2.5) + activesupport (4.2.6) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) minitest (~> 5.1) @@ -41,12 +41,12 @@ GEM fuzzy_match (2.0.4) i18n (0.7.0) json (1.8.3) - minitest (5.8.3) - molinillo (0.4.0) - nap (1.0.0) + minitest (5.8.4) + molinillo (0.4.4) + nap (1.1.0) naturally (2.1.0) netrc (0.7.8) - rake (10.4.2) + rake (11.1.2) rouge (1.10.1) thread_safe (0.3.5) tzinfo (1.2.2) @@ -55,7 +55,7 @@ GEM activesupport (>= 3) claide (~> 0.9.1) colored (~> 1.2) - xcpretty (0.2.1) + xcpretty (0.2.2) rouge (~> 1.8) PLATFORMS @@ -68,4 +68,4 @@ DEPENDENCIES xcpretty BUNDLED WITH - 1.10.6 + 1.11.2 From f2d2d5fb7b579331f0b7df6de28251a1c0852a34 Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Mon, 25 Apr 2016 11:27:24 -0700 Subject: [PATCH 4/6] Re-throw exception when using main thread continuation block. --- ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m b/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m index 1701118..ae2cb67 100644 --- a/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m +++ b/ParseFacebookUtils/Internal/PFFacebookPrivateUtilities.m @@ -84,7 +84,12 @@ - (instancetype)pffb_continueWithMainThreadBooleanBlock:(PFBooleanResultBlock)bl } - (instancetype)pffb_continueWithMainThreadBlock:(BFContinuationBlock)block { - return [self continueWithExecutor:[BFExecutor mainThreadExecutor] withBlock:block]; + return [self continueWithExecutor:[BFExecutor mainThreadExecutor] withBlock:^id(BFTask *task) { + if (task.exception) { + @throw task.exception; + } + return block(task); + }]; } @end From 69c8a389b69ecd49318e5afdb4e1235ab45eb788 Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Mon, 25 Apr 2016 11:34:36 -0700 Subject: [PATCH 5/6] Assert when initializing FacebookUtils before Parse is initialized. --- ParseFacebookUtils/PFFacebookUtils.m | 6 +++++- Tests/Unit/FacebookUtilsTests.m | 11 ++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ParseFacebookUtils/PFFacebookUtils.m b/ParseFacebookUtils/PFFacebookUtils.m index efb3648..8c10eaf 100644 --- a/ParseFacebookUtils/PFFacebookUtils.m +++ b/ParseFacebookUtils/PFFacebookUtils.m @@ -10,8 +10,8 @@ #import "PFFacebookUtils.h" #import - #import +#import #import "PFFacebookPrivateUtilities.h" @@ -48,6 +48,10 @@ + (void)_setAuthenticationProvider:(PFFacebookAuthenticationProvider *)provider ///-------------------------------------- + (void)initializeFacebookWithApplicationLaunchOptions:(NSDictionary *)launchOptions { + if (![Parse currentConfiguration]) { + // TODO: (nlutsenko) Remove this when Parse SDK throws on every access to Parse._currentManager + [NSException raise:NSInternalInconsistencyException format:@"PFFacebookUtils must be initialized after initializing Parse."]; + } if (!authenticationProvider_) { Class providerClass = nil; #if TARGET_OS_IOS diff --git a/Tests/Unit/FacebookUtilsTests.m b/Tests/Unit/FacebookUtilsTests.m index 8d16576..00645da 100644 --- a/Tests/Unit/FacebookUtilsTests.m +++ b/Tests/Unit/FacebookUtilsTests.m @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -@import Parse.PFConstants; +@import Parse; #import @@ -57,9 +57,14 @@ - (void)testInitialize { XCTAssertThrows([PFFacebookUtils unlinkUserInBackground:userMock]); - [PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:nil]; - XCTAssertNotNil([PFFacebookUtils _authenticationProvider]); + XCTAssertThrows([PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:nil]); + + id parseMock = PFStrictClassMock([Parse class]); + id configurationMock = PFStrictClassMock([ParseClientConfiguration class]); + OCMStub(ClassMethod([parseMock currentConfiguration])).andReturn(configurationMock); + XCTAssertNoThrow([PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:nil]); + XCTAssertNotNil([PFFacebookUtils _authenticationProvider]); XCTAssertNoThrow([PFFacebookUtils initializeFacebookWithApplicationLaunchOptions:nil]); OCMVerifyAll(userMock); From 5cc98491601b4da69f0189370216f57f6006aaaa Mon Sep 17 00:00:00 2001 From: Nikita Lutsenko Date: Tue, 26 Apr 2016 18:29:52 -0700 Subject: [PATCH 6/6] Add new CodeCov configuration file. --- codecov.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..f5c4a94 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,10 @@ +coverage: + comment: off + ignore: + - Tests/* + status: + project: + default: + target: 75 + only_pulls: yes + \ No newline at end of file