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 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 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 @@ - #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); 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