diff --git a/Cartfile.private b/Cartfile.private index 7954cdc..8f0c9e7 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1,2 +1,2 @@ github "Quick/Quick" ~> 1.1 -github "Quick/Nimble" ~> 6.0 +github "Quick/Nimble" ~> 7.0 diff --git a/Cartfile.resolved b/Cartfile.resolved index 1e28c51..4a33a6b 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "Quick/Nimble" "v6.1.0" +github "Quick/Nimble" "v7.0.1" github "Quick/Quick" "v1.1.0" diff --git a/JWTDecode.xcodeproj/project.pbxproj b/JWTDecode.xcodeproj/project.pbxproj index 86c04e3..017279a 100644 --- a/JWTDecode.xcodeproj/project.pbxproj +++ b/JWTDecode.xcodeproj/project.pbxproj @@ -470,33 +470,33 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Auth0; TargetAttributes = { 5F0068E11B3B46240048928E = { CreatedOnToolsVersion = 6.3.2; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; 5F0068EC1B3B46240048928E = { CreatedOnToolsVersion = 6.3.2; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; ProvisioningStyle = Manual; }; 5F0069081B3B532E0048928E = { CreatedOnToolsVersion = 6.3.2; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; 5F0069121B3B532E0048928E = { CreatedOnToolsVersion = 6.3.2; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; 918A8E5A1D63D2E1001F787B = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; }; 918A8E6B1D63D4E5001F787B = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 0900; ProvisioningStyle = Manual; }; }; @@ -659,14 +659,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -710,14 +716,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -750,6 +762,7 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_CODE_COVERAGE = YES; CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; @@ -765,6 +778,7 @@ PRODUCT_NAME = JWTDecode; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; }; name = Debug; @@ -773,6 +787,7 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ENABLE_CODE_COVERAGE = YES; CLANG_ENABLE_MODULES = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; @@ -788,6 +803,7 @@ PRODUCT_NAME = JWTDecode; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; }; name = Release; @@ -796,6 +812,7 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; + CLANG_ENABLE_CODE_COVERAGE = YES; CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( @@ -812,6 +829,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "JWTDecodeTests/JWTDecode-iOSTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; }; name = Debug; @@ -820,6 +838,7 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; + CLANG_ENABLE_CODE_COVERAGE = YES; CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( @@ -832,6 +851,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "JWTDecodeTests/JWTDecode-iOSTests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; }; name = Release; @@ -839,6 +859,7 @@ 5F00691D1B3B532E0048928E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_CODE_COVERAGE = YES; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; @@ -859,6 +880,7 @@ PRODUCT_NAME = JWTDecode; SDKROOT = macosx; SKIP_INSTALL = YES; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; }; name = Debug; @@ -866,6 +888,7 @@ 5F00691E1B3B532E0048928E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CLANG_ENABLE_CODE_COVERAGE = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -882,6 +905,7 @@ SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; }; name = Release; @@ -890,6 +914,7 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; + CLANG_ENABLE_CODE_COVERAGE = YES; COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = dwarf; FRAMEWORK_SEARCH_PATHS = ( @@ -906,6 +931,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.auth0.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; }; name = Debug; @@ -914,6 +940,7 @@ isa = XCBuildConfiguration; buildSettings = { APPLICATION_EXTENSION_API_ONLY = NO; + CLANG_ENABLE_CODE_COVERAGE = YES; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -925,6 +952,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.auth0.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; }; name = Release; @@ -933,6 +961,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_CODE_COVERAGE = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; @@ -947,6 +976,7 @@ PRODUCT_NAME = JWTDecode; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; @@ -957,6 +987,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_CODE_COVERAGE = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -970,6 +1001,7 @@ PRODUCT_NAME = JWTDecode; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; @@ -980,6 +1012,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_CODE_COVERAGE = YES; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( @@ -991,6 +1024,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.auth0.JWTDecode-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 9.2; }; @@ -1000,6 +1034,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_CODE_COVERAGE = YES; DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -1011,6 +1046,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 3.0; TVOS_DEPLOYMENT_TARGET = 9.2; }; diff --git a/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-OSX.xcscheme b/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-OSX.xcscheme index 64b569e..caab222 100644 --- a/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-OSX.xcscheme +++ b/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-OSX.xcscheme @@ -1,6 +1,6 @@ + language = "" + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -70,6 +70,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-iOS.xcscheme b/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-iOS.xcscheme index 6137b16..3beb14f 100644 --- a/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-iOS.xcscheme +++ b/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-iOS.xcscheme @@ -1,6 +1,6 @@ + language = "" + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -70,6 +70,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-tvOS.xcscheme b/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-tvOS.xcscheme index 8a55e1e..e996b03 100644 --- a/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-tvOS.xcscheme +++ b/JWTDecode.xcodeproj/xcshareddata/xcschemes/JWTDecode-tvOS.xcscheme @@ -1,6 +1,6 @@ + language = "" + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -70,6 +70,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/JWTDecodeTests/JWTDecodeSpec.swift b/JWTDecodeTests/JWTDecodeSpec.swift index 40e8bb1..75e299c 100644 --- a/JWTDecodeTests/JWTDecodeSpec.swift +++ b/JWTDecodeTests/JWTDecodeSpec.swift @@ -187,7 +187,7 @@ class JWTDecodeSpec: QuickSpec { let claim = token.claim(name: "custom_double_claim") expect(claim.string).to(beNil()) expect(claim.array).to(beNil()) - expect(claim.integer) == 3 + expect(claim.integer).to(beNil()) expect(claim.double) == 3.4 expect(claim.date) == Date(timeIntervalSince1970: 3.4) } @@ -214,13 +214,12 @@ class JWTDecodeSpec: QuickSpec { } } -public func beDecodeErrorWithCode(_ code: DecodeError) -> NonNilMatcherFunc { - return NonNilMatcherFunc { (actualExpression, failureMessage) throws in - failureMessage.postfixMessage = "be decode error with code <\(code)>" - guard let actual = try actualExpression.evaluate() as? DecodeError else { - return false +public func beDecodeErrorWithCode(_ code: DecodeError) -> Predicate { + return Predicate.define("be decode error with code <\(code)>") { expression, failureMessage -> PredicateResult in + guard let actual = try expression.evaluate() as? DecodeError else { + return PredicateResult(status: .doesNotMatch, message: failureMessage) } - return actual == code + return PredicateResult(bool: actual == code, message: failureMessage) } }