diff --git a/Example/HealthKitSampleGenerator.xcodeproj/project.pbxproj b/Example/HealthKitSampleGenerator.xcodeproj/project.pbxproj index b6bd56b..221e8a6 100644 --- a/Example/HealthKitSampleGenerator.xcodeproj/project.pbxproj +++ b/Example/HealthKitSampleGenerator.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 2519807D2C1089FBBE7DAB86 /* Pods_HealthKitSampleGenerator_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 64D4BA7D5ECFAE431FC1D030 /* Pods_HealthKitSampleGenerator_Example.framework */; }; + 24121220CF83CC664C93C6D5 /* Pods_HealthKitSampleGenerator_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E729BC591D99580262085B7A /* Pods_HealthKitSampleGenerator_Example.framework */; }; 2F3C4D751BDA4F4200B91D60 /* ProfilesTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3C4D741BDA4F4200B91D60 /* ProfilesTableViewController.swift */; }; 2F3C4D841BDB61FA00B91D60 /* HealthKitProfileReaderTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3C4D821BDB61F600B91D60 /* HealthKitProfileReaderTest.swift */; }; 2F3C4D881BDD58CC00B91D60 /* ImportProfileViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3C4D871BDD58CC00B91D60 /* ImportProfileViewController.swift */; }; @@ -21,7 +21,6 @@ 2F4D1F711BD66D80000290C4 /* SingleDocReaderTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4D1F701BD66D80000290C4 /* SingleDocReaderTest.swift */; }; 2F4D1F731BD6A38B000290C4 /* JsonReaderTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F4D1F721BD6A38B000290C4 /* JsonReaderTest.swift */; }; 2F8DF7D11BD2BC67000F797F /* FileNameUtilTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F8DF7CF1BD2BBDF000F797F /* FileNameUtilTest.swift */; }; - 2F90C57F1BC3051500587117 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F90C57E1BC3051500587117 /* HealthKit.framework */; }; 2F90C5811BC44BE500587117 /* UIControls.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F90C5801BC44BE500587117 /* UIControls.swift */; }; 2F9E30561BBE79E30005DF72 /* MainTabController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F9E30551BBE79E30005DF72 /* MainTabController.swift */; }; 2F9E30581BBE81630005DF72 /* ExportViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F9E30571BBE81630005DF72 /* ExportViewController.swift */; }; @@ -30,7 +29,8 @@ 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; - F97E53BF2853FEB20747894A /* Pods_HealthKitSampleGenerator_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C68FA6A8987337C85C7D43 /* Pods_HealthKitSampleGenerator_Tests.framework */; }; + B17CB7B522E9D36600671DBD /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B17CB7B422E9D36600671DBD /* HealthKit.framework */; }; + D965E83ACC13EBE7C2A645AA /* Pods_HealthKitSampleGenerator_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 92CA1DC89A8F7D4CD44ED20D /* Pods_HealthKitSampleGenerator_Tests.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -44,9 +44,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 06B02DACDE03C1B3D7DB2773 /* Pods-HealthKitSampleGenerator_ExampleUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HealthKitSampleGenerator_ExampleUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HealthKitSampleGenerator_ExampleUITests/Pods-HealthKitSampleGenerator_ExampleUITests.debug.xcconfig"; sourceTree = ""; }; - 162271BC1D58D2A3973BF2B9 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HealthKitSampleGenerator_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.release.xcconfig"; sourceTree = ""; }; - 2629469B90C63E0981BD4420 /* HealthKitSampleGenerator.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = HealthKitSampleGenerator.podspec; path = ../HealthKitSampleGenerator.podspec; sourceTree = ""; }; + 2629469B90C63E0981BD4420 /* HealthKitSampleGenerator.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = HealthKitSampleGenerator.podspec; path = ../HealthKitSampleGenerator.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 2F3C4D741BDA4F4200B91D60 /* ProfilesTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProfilesTableViewController.swift; sourceTree = ""; }; 2F3C4D821BDB61F600B91D60 /* HealthKitProfileReaderTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitProfileReaderTest.swift; sourceTree = ""; }; 2F3C4D871BDD58CC00B91D60 /* ImportProfileViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImportProfileViewController.swift; sourceTree = ""; }; @@ -60,15 +58,13 @@ 2F4D1F701BD66D80000290C4 /* SingleDocReaderTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SingleDocReaderTest.swift; sourceTree = ""; }; 2F4D1F721BD6A38B000290C4 /* JsonReaderTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JsonReaderTest.swift; sourceTree = ""; }; 2F8DF7CF1BD2BBDF000F797F /* FileNameUtilTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileNameUtilTest.swift; sourceTree = ""; }; - 2F90C57D1BC3051500587117 /* HealthKitSampleGenerator_Example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = HealthKitSampleGenerator_Example.entitlements; sourceTree = ""; }; - 2F90C57E1BC3051500587117 /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; 2F90C5801BC44BE500587117 /* UIControls.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIControls.swift; sourceTree = ""; }; 2F9E30551BBE79E30005DF72 /* MainTabController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainTabController.swift; sourceTree = ""; }; 2F9E30571BBE81630005DF72 /* ExportViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExportViewController.swift; sourceTree = ""; }; - 2F9E305F1BC277590005DF72 /* HealthKitSampleGeneratorPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = HealthKitSampleGeneratorPlayground.playground; sourceTree = ""; }; + 2F9E305F1BC277590005DF72 /* HealthKitSampleGeneratorPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = HealthKitSampleGeneratorPlayground.playground; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; 2F9E30621BC2AA940005DF72 /* JsonWriterTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JsonWriterTest.swift; sourceTree = ""; }; - 3543A4B9E87C96D9D1543385 /* Pods-HealthKitSampleGenerator_ExampleUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HealthKitSampleGenerator_ExampleUITests.release.xcconfig"; path = "Pods/Target Support Files/Pods-HealthKitSampleGenerator_ExampleUITests/Pods-HealthKitSampleGenerator_ExampleUITests.release.xcconfig"; sourceTree = ""; }; - 3E763853067A80A9434CF184 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HealthKitSampleGenerator_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.release.xcconfig"; sourceTree = ""; }; + 36C52CD405AB18909D1FB19B /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HealthKitSampleGenerator_Tests.debug.xcconfig"; path = "Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.debug.xcconfig"; sourceTree = ""; }; + 3F2C1D6A1AC94D0C11E4E0D8 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HealthKitSampleGenerator_Tests.release.xcconfig"; path = "Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.release.xcconfig"; sourceTree = ""; }; 607FACD01AFB9204008FA782 /* HealthKitSampleGenerator_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HealthKitSampleGenerator_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -77,12 +73,13 @@ 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 607FACE51AFB9204008FA782 /* HealthKitSampleGenerator_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HealthKitSampleGenerator_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 64D4BA7D5ECFAE431FC1D030 /* Pods_HealthKitSampleGenerator_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HealthKitSampleGenerator_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 6AAA4CAF308B6F8B9C3C034B /* Pods_HealthKitSampleGenerator_ExampleUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HealthKitSampleGenerator_ExampleUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 83C68FA6A8987337C85C7D43 /* Pods_HealthKitSampleGenerator_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HealthKitSampleGenerator_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B5D9583B9AAA55F82063F614 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HealthKitSampleGenerator_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.debug.xcconfig"; sourceTree = ""; }; + 92CA1DC89A8F7D4CD44ED20D /* Pods_HealthKitSampleGenerator_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HealthKitSampleGenerator_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B17CB7B322E9D36600671DBD /* HealthKitSampleGenerator_Example.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = HealthKitSampleGenerator_Example.entitlements; sourceTree = ""; }; + B17CB7B422E9D36600671DBD /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = System/Library/Frameworks/HealthKit.framework; sourceTree = SDKROOT; }; CCD02354644B6401D5A4D2FA /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; - E44107FF39568140494717AC /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HealthKitSampleGenerator_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.debug.xcconfig"; sourceTree = ""; }; + D5761435CB87B934C79A9612 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HealthKitSampleGenerator_Example.release.xcconfig"; path = "Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.release.xcconfig"; sourceTree = ""; }; + E729BC591D99580262085B7A /* Pods_HealthKitSampleGenerator_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HealthKitSampleGenerator_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + EAEE6B9DD15BBC1B25FF70D5 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HealthKitSampleGenerator_Example.debug.xcconfig"; path = "Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.debug.xcconfig"; sourceTree = ""; }; FD3825F6EC5E83D775E2CA50 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; /* End PBXFileReference section */ @@ -91,8 +88,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2519807D2C1089FBBE7DAB86 /* Pods_HealthKitSampleGenerator_Example.framework in Frameworks */, - 2F90C57F1BC3051500587117 /* HealthKit.framework in Frameworks */, + 24121220CF83CC664C93C6D5 /* Pods_HealthKitSampleGenerator_Example.framework in Frameworks */, + B17CB7B522E9D36600671DBD /* HealthKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -100,7 +97,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F97E53BF2853FEB20747894A /* Pods_HealthKitSampleGenerator_Tests.framework in Frameworks */, + D965E83ACC13EBE7C2A645AA /* Pods_HealthKitSampleGenerator_Tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -110,10 +107,9 @@ 07F465E8CAD041A32B390A96 /* Frameworks */ = { isa = PBXGroup; children = ( - 2F90C57E1BC3051500587117 /* HealthKit.framework */, - 64D4BA7D5ECFAE431FC1D030 /* Pods_HealthKitSampleGenerator_Example.framework */, - 83C68FA6A8987337C85C7D43 /* Pods_HealthKitSampleGenerator_Tests.framework */, - 6AAA4CAF308B6F8B9C3C034B /* Pods_HealthKitSampleGenerator_ExampleUITests.framework */, + B17CB7B422E9D36600671DBD /* HealthKit.framework */, + E729BC591D99580262085B7A /* Pods_HealthKitSampleGenerator_Example.framework */, + 92CA1DC89A8F7D4CD44ED20D /* Pods_HealthKitSampleGenerator_Tests.framework */, ); name = Frameworks; sourceTree = ""; @@ -151,14 +147,14 @@ 607FACC71AFB9204008FA782 = { isa = PBXGroup; children = ( - 2F90C57D1BC3051500587117 /* HealthKitSampleGenerator_Example.entitlements */, + B17CB7B322E9D36600671DBD /* HealthKitSampleGenerator_Example.entitlements */, 2F9E305F1BC277590005DF72 /* HealthKitSampleGeneratorPlayground.playground */, 607FACF51AFB993E008FA782 /* Podspec Metadata */, 607FACD21AFB9204008FA782 /* Example for HealthKitSampleGenerator */, 607FACE81AFB9204008FA782 /* Tests */, 607FACD11AFB9204008FA782 /* Products */, - A5EC4E344451C8714FCAD5DA /* Pods */, 07F465E8CAD041A32B390A96 /* Frameworks */, + C6D7372BF03E88A7611D8F29 /* Pods */, ); sourceTree = ""; }; @@ -229,17 +225,15 @@ name = "Podspec Metadata"; sourceTree = ""; }; - A5EC4E344451C8714FCAD5DA /* Pods */ = { + C6D7372BF03E88A7611D8F29 /* Pods */ = { isa = PBXGroup; children = ( - B5D9583B9AAA55F82063F614 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */, - 162271BC1D58D2A3973BF2B9 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */, - E44107FF39568140494717AC /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */, - 3E763853067A80A9434CF184 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */, - 06B02DACDE03C1B3D7DB2773 /* Pods-HealthKitSampleGenerator_ExampleUITests.debug.xcconfig */, - 3543A4B9E87C96D9D1543385 /* Pods-HealthKitSampleGenerator_ExampleUITests.release.xcconfig */, - ); - name = Pods; + EAEE6B9DD15BBC1B25FF70D5 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */, + D5761435CB87B934C79A9612 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */, + 36C52CD405AB18909D1FB19B /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */, + 3F2C1D6A1AC94D0C11E4E0D8 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */, + ); + path = Pods; sourceTree = ""; }; /* End PBXGroup section */ @@ -249,12 +243,11 @@ isa = PBXNativeTarget; buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator_Example" */; buildPhases = ( - B5B1DD110F5F484D96FFA327 /* Check Pods Manifest.lock */, + 1D321EF52E5C409A63FD4579 /* [CP] Check Pods Manifest.lock */, 607FACCC1AFB9204008FA782 /* Sources */, 607FACCD1AFB9204008FA782 /* Frameworks */, 607FACCE1AFB9204008FA782 /* Resources */, - 0B2F9AE51F5CDE4C84C85CC8 /* Embed Pods Frameworks */, - 804B5D650C7E6B9DA4D71211 /* Copy Pods Resources */, + 52426489B9F955C5E0125770 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -269,12 +262,11 @@ isa = PBXNativeTarget; buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator_Tests" */; buildPhases = ( - 0BC9D0778E304FED33FC4844 /* Check Pods Manifest.lock */, + F673E62A875B41012EA5FB97 /* [CP] Check Pods Manifest.lock */, 607FACE11AFB9204008FA782 /* Sources */, 607FACE21AFB9204008FA782 /* Frameworks */, 607FACE31AFB9204008FA782 /* Resources */, - 78AA3D0086828806A1A9B1FD /* Embed Pods Frameworks */, - 67A1A36B440FC160DA1FFF68 /* Copy Pods Resources */, + DACE50CE83E52514E3FE85EB /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -298,7 +290,7 @@ TargetAttributes = { 607FACCF1AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; - DevelopmentTeam = 8VJ795LGRB; + DevelopmentTeam = 6HLE4997NC; SystemCapabilities = { com.apple.HealthKit = { enabled = 1; @@ -307,6 +299,7 @@ }; 607FACE41AFB9204008FA782 = { CreatedOnToolsVersion = 6.3.1; + DevelopmentTeam = 6HLE4997NC; TestTargetID = 607FACCF1AFB9204008FA782; }; }; @@ -316,6 +309,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -352,94 +346,88 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 0B2F9AE51F5CDE4C84C85CC8 /* Embed Pods Frameworks */ = { + 1D321EF52E5C409A63FD4579 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputPaths = ( - ); - name = "Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 0BC9D0778E304FED33FC4844 /* Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( + inputFileListPaths = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); - name = "Check Pods Manifest.lock"; - outputPaths = ( + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 67A1A36B440FC160DA1FFF68 /* Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy Pods Resources"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-HealthKitSampleGenerator_Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 78AA3D0086828806A1A9B1FD /* Embed Pods Frameworks */ = { + 52426489B9F955C5E0125770 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/HealthKitSampleGenerator-iOS12.0/HealthKitSampleGenerator.framework", ); - name = "Embed Pods Frameworks"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HealthKitSampleGenerator.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 804B5D650C7E6B9DA4D71211 /* Copy Pods Resources */ = { + DACE50CE83E52514E3FE85EB /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator.framework", + "${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework", + "${BUILT_PRODUCTS_DIR}/Quick/Quick.framework", ); - name = "Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/HealthKitSampleGenerator.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - B5B1DD110F5F484D96FFA327 /* Check Pods Manifest.lock */ = { + F673E62A875B41012EA5FB97 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-HealthKitSampleGenerator_Tests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -594,14 +582,16 @@ }; 607FACF01AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B5D9583B9AAA55F82063F614 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */; + baseConfigurationReference = EAEE6B9DD15BBC1B25FF70D5 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = HealthKitSampleGenerator_Example.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = 6HLE4997NC; ENABLE_BITCODE = NO; INFOPLIST_FILE = HealthKitSampleGenerator/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; OTHER_LDFLAGS = ( @@ -609,23 +599,26 @@ "-framework", "\"HealthKitSampleGenerator\"", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.majid.HealthKitSampleGenerator-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; }; name = Debug; }; 607FACF11AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 162271BC1D58D2A3973BF2B9 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */; + baseConfigurationReference = D5761435CB87B934C79A9612 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = HealthKitSampleGenerator_Example.entitlements; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = 6HLE4997NC; ENABLE_BITCODE = NO; INFOPLIST_FILE = HealthKitSampleGenerator/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; MODULE_NAME = ExampleApp; OTHER_LDFLAGS = ( @@ -633,18 +626,20 @@ "-framework", "\"HealthKitSampleGenerator\"", ); - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.majid.HealthKitSampleGenerator-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; }; name = Release; }; 607FACF31AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E44107FF39568140494717AC /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */; + baseConfigurationReference = 36C52CD405AB18909D1FB19B /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + DEVELOPMENT_TEAM = 6HLE4997NC; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -655,21 +650,24 @@ OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\""; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HealthKitSampleGenerator_Example.app/HealthKitSampleGenerator_Example"; }; name = Debug; }; 607FACF41AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3E763853067A80A9434CF184 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */; + baseConfigurationReference = 3F2C1D6A1AC94D0C11E4E0D8 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + DEVELOPMENT_TEAM = 6HLE4997NC; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\""; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HealthKitSampleGenerator_Example.app/HealthKitSampleGenerator_Example"; }; name = Release; diff --git a/Example/HealthKitSampleGenerator.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/HealthKitSampleGenerator.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/HealthKitSampleGenerator.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/HealthKitSampleGenerator.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Example/HealthKitSampleGenerator.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..949b678 --- /dev/null +++ b/Example/HealthKitSampleGenerator.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + BuildSystemType + Original + + diff --git a/Example/HealthKitSampleGenerator/Base.lproj/Main.storyboard b/Example/HealthKitSampleGenerator/Base.lproj/Main.storyboard index 627944f..f0177fd 100644 --- a/Example/HealthKitSampleGenerator/Base.lproj/Main.storyboard +++ b/Example/HealthKitSampleGenerator/Base.lproj/Main.storyboard @@ -1,8 +1,10 @@ - - + + + - - + + + @@ -11,9 +13,8 @@ - + - @@ -28,38 +29,33 @@ - + - - + - + - + - - @@ -91,21 +87,20 @@ - + - - + + - - + @@ -131,92 +125,80 @@ - + - + - - - + + - - - - + - + - - + - + - - + - - @@ -245,8 +224,7 @@ - - + @@ -287,10 +265,9 @@ - + - - + @@ -306,31 +283,28 @@ - + - - + + - + - @@ -341,24 +315,21 @@ - + - @@ -369,24 +340,21 @@ - + - @@ -397,24 +365,21 @@ - + - @@ -425,51 +390,44 @@ - - - + + - - - + + - + - + - - - + + - - @@ -480,40 +438,35 @@ - - - + + - - + - + - - + - - - - + @@ -571,9 +520,8 @@ - + - @@ -590,8 +538,7 @@ - - + diff --git a/Example/HealthKitSampleGenerator/ExportViewController.swift b/Example/HealthKitSampleGenerator/ExportViewController.swift index b138376..2c866e2 100644 --- a/Example/HealthKitSampleGenerator/ExportViewController.swift +++ b/Example/HealthKitSampleGenerator/ExportViewController.swift @@ -27,7 +27,7 @@ class ExportViewController : UIViewController, UITextFieldDelegate { var exportConfigurationValid = false { didSet { - btnExport.enabled = exportConfigurationValid + btnExport.isEnabled = exportConfigurationValid } } @@ -57,9 +57,9 @@ class ExportViewController : UIViewController, UITextFieldDelegate { var exportInProgress = false { didSet { - avExporting.hidden = !exportInProgress - btnExport.enabled = !exportInProgress - pvExportProgress.hidden = !exportInProgress + avExporting.isHidden = !exportInProgress + btnExport.isEnabled = !exportInProgress + pvExportProgress.isHidden = !exportInProgress } } @@ -68,11 +68,11 @@ class ExportViewController : UIViewController, UITextFieldDelegate { override func viewDidLoad() { super.viewDidLoad() - tfProfileName.text = "output" + UIUtil.sharedInstance.formatDateForFileName(NSDate()) - tfProfileName.addTarget(self, action: "textFieldDidChange:", forControlEvents: UIControlEvents.EditingChanged) + tfProfileName.text = "output" + UIUtil.sharedInstance.formatDateForFileName(date: NSDate()) + tfProfileName.addTarget(self, action: #selector(textFieldDidChange(_:)), for: UIControlEvents.editingChanged) tfProfileName.delegate = self - scExportType.selectedSegmentIndex = HealthDataToExportType.allValues.indexOf(HealthDataToExportType.ALL)! + scExportType.selectedSegmentIndex = HealthDataToExportType.allValues.index(of:HealthDataToExportType.ALL)! lbExportMessages.text = "" @@ -94,23 +94,23 @@ class ExportViewController : UIViewController, UITextFieldDelegate { exportConfiguration: exportConfiguration!, onProgress: {(message: String, progressInPercent: NSNumber?)->Void in - dispatch_async(dispatch_get_main_queue(), { + DispatchQueue.main.async { self.lbExportMessages.text = message if let progress = progressInPercent { self.pvExportProgress.progress = progress.floatValue } - }) + } }, - onCompletion: {(error: ErrorType?)-> Void in - dispatch_async(dispatch_get_main_queue(), { + onCompletion: {(error: Error?)-> Void in + DispatchQueue.main.async { if let exportError = error { self.lbExportMessages.text = "Export error: \(exportError)" print(exportError) } self.exportInProgress = false - }) + } } ) } @@ -121,25 +121,25 @@ class ExportViewController : UIViewController, UITextFieldDelegate { func createAndAnalyzeExportConfiguration(){ var fileName = "output" - if let text = tfProfileName.text where !text.isEmpty { + if let text = tfProfileName.text, !text.isEmpty { fileName = FileNameUtil.normalizeName(text) } - let documentsUrl = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] + let documentsUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] print(documentsUrl) - let outputFileName = documentsUrl.URLByAppendingPathComponent(fileName+".json.hsg").path! + let outputFileName = documentsUrl.appendingPathComponent(fileName+".json.hsg").path exportTarget = JsonSingleDocAsFileExportTarget( outputFileName: outputFileName, - overwriteIfExist: swOverwriteIfExist.on) + overwriteIfExist: swOverwriteIfExist.isOn) - exportConfiguration = HealthDataFullExportConfiguration(profileName: tfProfileName.text!, exportType: HealthDataToExportType.allValues[scExportType.selectedSegmentIndex]) + exportConfiguration = HealthDataFullExportConfiguration(profileName: tfProfileName.text!, exportType: HealthDataToExportType.allValues[scExportType.selectedSegmentIndex], startDate: Date().addingTimeInterval(-3600), endDate: Date(), shouldAuthorize: true) exportConfigurationValid = exportTarget!.isValid() } - func textFieldDidChange(_: UITextField) { + @objc func textFieldDidChange(_: UITextField) { createAndAnalyzeExportConfiguration() } diff --git a/Example/HealthKitSampleGenerator/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/HealthKitSampleGenerator/Images.xcassets/AppIcon.appiconset/Contents.json index d3942e9..19882d5 100644 --- a/Example/HealthKitSampleGenerator/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/HealthKitSampleGenerator/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", @@ -29,10 +39,15 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } -} +} \ No newline at end of file diff --git a/Example/HealthKitSampleGenerator/ImportProfileViewController.swift b/Example/HealthKitSampleGenerator/ImportProfileViewController.swift index 72c9662..d73cb84 100644 --- a/Example/HealthKitSampleGenerator/ImportProfileViewController.swift +++ b/Example/HealthKitSampleGenerator/ImportProfileViewController.swift @@ -30,11 +30,11 @@ class ImportProfileViewController : UIViewController { var importing = false { didSet { - pvImportProgress.hidden = !importing - aiImporting.hidden = !importing + pvImportProgress.isHidden = !importing + aiImporting.isHidden = !importing navigationItem.hidesBackButton = importing - swDeleteExistingData.enabled = !importing - btImport.enabled = !importing + swDeleteExistingData.isEnabled = !importing + btImport.isEnabled = !importing } } @@ -48,13 +48,13 @@ class ImportProfileViewController : UIViewController { lbImportProgress.text = "" } - override func viewDidAppear(animated: Bool) { + override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) profile?.loadMetaData(true) { (metaData: HealthKitProfileMetaData) in - NSOperationQueue.mainQueue().addOperationWithBlock(){ + OperationQueue.main.addOperation(){ self.lbProfileName.text = metaData.profileName - self.lbCreationDate.text = UIUtil.sharedInstance.formatDate(metaData.creationDate) + self.lbCreationDate.text = UIUtil.sharedInstance.formatDate(date: metaData.creationDate as NSDate?) self.lbVersion.text = metaData.version self.lbType.text = metaData.type } @@ -69,9 +69,9 @@ class ImportProfileViewController : UIViewController { let importer = HealthKitProfileImporter(healthStore: healthStore) importer.importProfile( importProfile, - deleteExistingData: swDeleteExistingData.on, + deleteExistingData: swDeleteExistingData.isOn, onProgress: {(message: String, progressInPercent: NSNumber?)->Void in - NSOperationQueue.mainQueue().addOperationWithBlock(){ + OperationQueue.main.addOperation(){ self.lbImportProgress.text = message if let progress = progressInPercent { self.pvImportProgress.progress = progress.floatValue @@ -79,8 +79,8 @@ class ImportProfileViewController : UIViewController { } }, - onCompletion: {(error: ErrorType?)-> Void in - NSOperationQueue.mainQueue().addOperationWithBlock(){ + onCompletion: {(error: Error?)-> Void in + OperationQueue.main.addOperation(){ if let exportError = error { self.lbImportProgress.text = "Import error: \(exportError)" print(exportError) @@ -93,4 +93,4 @@ class ImportProfileViewController : UIViewController { } } -} \ No newline at end of file +} diff --git a/Example/HealthKitSampleGenerator/Info.plist b/Example/HealthKitSampleGenerator/Info.plist index a5fcec9..be7c9f2 100644 --- a/Example/HealthKitSampleGenerator/Info.plist +++ b/Example/HealthKitSampleGenerator/Info.plist @@ -2,6 +2,8 @@ + NSHealthShareUsageDescription + for health export CFBundleDevelopmentRegion en CFBundleDisplayName diff --git a/Example/HealthKitSampleGenerator/ProfilesTableViewController.swift b/Example/HealthKitSampleGenerator/ProfilesTableViewController.swift index 97b8569..d7bd66a 100644 --- a/Example/HealthKitSampleGenerator/ProfilesTableViewController.swift +++ b/Example/HealthKitSampleGenerator/ProfilesTableViewController.swift @@ -18,30 +18,28 @@ class ProfilesTableViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() - navigationItem.leftBarButtonItem = editButtonItem(); + navigationItem.leftBarButtonItem = editButtonItem; } - override func viewDidAppear(animated: Bool) { + override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - let documentsUrl = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] + let documentsUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0] profiles = HealthKitProfileReader.readProfilesFromDisk(documentsUrl) tableView.reloadData() } - override func viewWillDisappear(animated: Bool) { + override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) // make sure the table view is not in editing mode - if tableView.editing { + if tableView.isEditing { tableView.setEditing(false, animated: true) } } - - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { - + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "detailView" { - let detailViewController = segue.destinationViewController as! ImportProfileViewController + let detailViewController = segue.destination as! ImportProfileViewController if let indexPath = tableView.indexPathForSelectedRow { detailViewController.profile = profiles[indexPath.row] } @@ -53,25 +51,24 @@ class ProfilesTableViewController: UITableViewController { // TableView DataSource extension ProfilesTableViewController { - override func numberOfSectionsInTableView(tableView: UITableView) -> Int { + override func numberOfSections(in tableView: UITableView) -> Int { return 1 } - override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return profiles.count } - - override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let profile = profiles[indexPath.row] - let cell = tableView.dequeueReusableCellWithIdentifier("profileCell")! + let cell = tableView.dequeueReusableCell(withIdentifier: "profileCell")! cell.textLabel?.text = profile.fileName profile.loadMetaData(true) { (metaData:HealthKitProfileMetaData) in - NSOperationQueue.mainQueue().addOperationWithBlock(){ + OperationQueue.main.addOperation(){ - let from = UIUtil.sharedInstance.formatDate(metaData.creationDate) + let from = UIUtil.sharedInstance.formatDate(date: metaData.creationDate as NSDate?) let profileName = metaData.profileName != nil ? metaData.profileName! : "unknown" cell.detailTextLabel?.text = "\(profileName) from: \(from)" @@ -87,33 +84,32 @@ extension ProfilesTableViewController { // UITableViewDelegate extension ProfilesTableViewController { - override func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { - if editingStyle == .Delete { - + override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { + if editingStyle == .delete { let profile = profiles[indexPath.row] let alert = UIAlertController( title: "Delete Profile \(profile.fileName)", message: "Do you really want to delete this prolfile? The file will be deleted! This can not be undone!", - preferredStyle: .Alert) + preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "Yes, delete it!", style: .Destructive, handler: { action in + alert.addAction(UIAlertAction(title: "Yes, delete it!", style: .destructive, handler: { action in do { try profile.deleteFile() - self.profiles.removeAtIndex(indexPath.row) - self.tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation:.Automatic) + self.profiles.remove(at: indexPath.row) + self.tableView.deleteRows(at: [indexPath], with:.automatic) } catch let error { - let errorAlert = UIAlertController(title: "Error", message: "\(error)", preferredStyle: .Alert) - errorAlert.addAction(UIAlertAction(title: "Ok", style: .Default, handler: nil)) - self.presentViewController(errorAlert, animated: true, completion: nil) + let errorAlert = UIAlertController(title: "Error", message: "\(error)", preferredStyle: .alert) + errorAlert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) + self.present(errorAlert, animated: true, completion: nil) } })) - alert.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: nil)) + alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil)) - self.presentViewController(alert, animated: true, completion: nil) + self.present(alert, animated: true, completion: nil) } } -} \ No newline at end of file +} diff --git a/Example/HealthKitSampleGenerator/UIControls.swift b/Example/HealthKitSampleGenerator/UIControls.swift index ef9b503..e325464 100644 --- a/Example/HealthKitSampleGenerator/UIControls.swift +++ b/Example/HealthKitSampleGenerator/UIControls.swift @@ -13,18 +13,17 @@ public class BaselineTextField : UITextField { required public init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) - borderStyle = UITextBorderStyle.None + borderStyle = UITextBorderStyle.none } - override public func drawRect(rect: CGRect) { - let ctx = UIGraphicsGetCurrentContext(); - CGContextSetLineWidth(ctx, 1.0); - - CGContextSetRGBStrokeColor(ctx, 0.6, 0.6, 0.6, 1); - CGContextMoveToPoint(ctx, 0, rect.size.height); - CGContextAddLineToPoint( ctx, rect.size.width, rect.size.height); - - CGContextStrokePath(ctx); + override public func draw(_ rect: CGRect) { + if let ctx = UIGraphicsGetCurrentContext(){ + ctx.setLineWidth(1.0) + ctx.setStrokeColor(UIColor(red: 0.6, green: 0.6, blue: 0.6, alpha: 1.0).cgColor) + ctx.move(to: CGPoint(x: 0, y: rect.size.height)) + ctx.addLine(to: .init(x: rect.size.width, y: rect.size.height)) + ctx.strokePath() + } } -} \ No newline at end of file +} diff --git a/Example/HealthKitSampleGenerator/UIUtil.swift b/Example/HealthKitSampleGenerator/UIUtil.swift index e17d241..0f9658c 100644 --- a/Example/HealthKitSampleGenerator/UIUtil.swift +++ b/Example/HealthKitSampleGenerator/UIUtil.swift @@ -11,23 +11,23 @@ import UIKit class UIUtil { - let formatter = NSDateFormatter() - let fileNameFormatter = NSDateFormatter() + let formatter = DateFormatter() + let fileNameFormatter = DateFormatter() static let sharedInstance = UIUtil() private init(){ - formatter.dateStyle = NSDateFormatterStyle.MediumStyle - formatter.timeStyle = NSDateFormatterStyle.MediumStyle + formatter.dateStyle = .medium + formatter.timeStyle = .medium fileNameFormatter.dateFormat = "yyyyMMddHHmmss" } func formatDate(date:NSDate?) -> String { - return date != nil ? formatter.stringFromDate(date!) : "unknown" + return date != nil ? formatter.string(from: date! as Date) : "unknown" } func formatDateForFileName(date:NSDate?) -> String { - return date != nil ? fileNameFormatter.stringFromDate(date!) : "unknown" + return date != nil ? fileNameFormatter.string(from: date! as Date) : "unknown" } -} \ No newline at end of file +} diff --git a/Example/HealthKitSampleGenerator_Example.entitlements b/Example/HealthKitSampleGenerator_Example.entitlements index e10f430..2ab14a2 100644 --- a/Example/HealthKitSampleGenerator_Example.entitlements +++ b/Example/HealthKitSampleGenerator_Example.entitlements @@ -4,5 +4,7 @@ com.apple.developer.healthkit + com.apple.developer.healthkit.access + diff --git a/Example/Podfile b/Example/Podfile index 1343139..2204afa 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -2,15 +2,15 @@ source 'https://github.com/CocoaPods/Specs.git' use_frameworks! def testing_pods - pod 'Quick', '~> 0.6.0' - pod 'Nimble', '2.0.0-rc.3' + pod 'Quick', '~> 2.1.0' + pod 'Nimble', '8.0.2' end -target 'HealthKitSampleGenerator_Example', :exclusive => true do +target 'HealthKitSampleGenerator_Example' do pod "HealthKitSampleGenerator", :path => "../" end -target 'HealthKitSampleGenerator_Tests', :exclusive => true do +target 'HealthKitSampleGenerator_Tests' do pod "HealthKitSampleGenerator", :path => "../" testing_pods end @@ -19,4 +19,4 @@ post_install do |installer| installer.pods_project.build_configuration_list.build_configurations.each do |configuration| configuration.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = 'YES' end -end \ No newline at end of file +end diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 8dc9871..037a0fd 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -1,20 +1,27 @@ PODS: - - HealthKitSampleGenerator (0.2.0) - - Nimble (2.0.0-rc.3) - - Quick (0.6.0) + - HealthKitSampleGenerator (1.0.4) + - Nimble (8.0.2) + - Quick (2.1.0) DEPENDENCIES: - HealthKitSampleGenerator (from `../`) - - Nimble (= 2.0.0-rc.3) - - Quick (~> 0.6.0) + - Nimble (= 8.0.2) + - Quick (~> 2.1.0) + +SPEC REPOS: + https://github.com/CocoaPods/Specs.git: + - Nimble + - Quick EXTERNAL SOURCES: HealthKitSampleGenerator: - :path: ../ + :path: "../" SPEC CHECKSUMS: - HealthKitSampleGenerator: 00ac6ac6087a58249ca2f76e06295230a3181ed3 - Nimble: 9dff98ee195ffe7351d3b2fb01d3a1420fd97948 - Quick: 563686dbcf0ae0f9f7401ac9cd2d786ee1b7f3d7 + HealthKitSampleGenerator: 017bdf6832a956a1cb026ebd955f22433031750a + Nimble: 622629381bda1dd5678162f21f1368cec7cbba60 + Quick: 4be43f6634acfa727dd106bdf3929ce125ffa79d + +PODFILE CHECKSUM: 5a0cbbee0a7cd6b5beac223a2b21c76a0d9ff74c -COCOAPODS: 0.39.0 +COCOAPODS: 1.8.4 diff --git a/Example/Pods/Local Podspecs/HealthKitSampleGenerator.podspec.json b/Example/Pods/Local Podspecs/HealthKitSampleGenerator.podspec.json index 17cc644..13fa304 100644 --- a/Example/Pods/Local Podspecs/HealthKitSampleGenerator.podspec.json +++ b/Example/Pods/Local Podspecs/HealthKitSampleGenerator.podspec.json @@ -1,6 +1,6 @@ { "name": "HealthKitSampleGenerator", - "version": "0.2.0", + "version": "1.0.4", "summary": "Export/Import/Sample Generator for HealthKit Data (Swift + UI)", "homepage": "https://github.com/mseemann/healthkit-sample-generator", "license": "MIT", @@ -9,10 +9,10 @@ }, "source": { "git": "https://github.com/mseemann/healthkit-sample-generator.git", - "tag": "0.2.0" + "tag": "1.0.4" }, "platforms": { - "ios": "9.0" + "ios": "12.0" }, "requires_arc": true, "source_files": "Pod/Classes/**/*", diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock index 8dc9871..037a0fd 100644 --- a/Example/Pods/Manifest.lock +++ b/Example/Pods/Manifest.lock @@ -1,20 +1,27 @@ PODS: - - HealthKitSampleGenerator (0.2.0) - - Nimble (2.0.0-rc.3) - - Quick (0.6.0) + - HealthKitSampleGenerator (1.0.4) + - Nimble (8.0.2) + - Quick (2.1.0) DEPENDENCIES: - HealthKitSampleGenerator (from `../`) - - Nimble (= 2.0.0-rc.3) - - Quick (~> 0.6.0) + - Nimble (= 8.0.2) + - Quick (~> 2.1.0) + +SPEC REPOS: + https://github.com/CocoaPods/Specs.git: + - Nimble + - Quick EXTERNAL SOURCES: HealthKitSampleGenerator: - :path: ../ + :path: "../" SPEC CHECKSUMS: - HealthKitSampleGenerator: 00ac6ac6087a58249ca2f76e06295230a3181ed3 - Nimble: 9dff98ee195ffe7351d3b2fb01d3a1420fd97948 - Quick: 563686dbcf0ae0f9f7401ac9cd2d786ee1b7f3d7 + HealthKitSampleGenerator: 017bdf6832a956a1cb026ebd955f22433031750a + Nimble: 622629381bda1dd5678162f21f1368cec7cbba60 + Quick: 4be43f6634acfa727dd106bdf3929ce125ffa79d + +PODFILE CHECKSUM: 5a0cbbee0a7cd6b5beac223a2b21c76a0d9ff74c -COCOAPODS: 0.39.0 +COCOAPODS: 1.8.4 diff --git a/Example/Pods/Nimble/LICENSE b/Example/Pods/Nimble/LICENSE new file mode 100644 index 0000000..82b84bf --- /dev/null +++ b/Example/Pods/Nimble/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016 Quick Team + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Example/Pods/Nimble/README.md b/Example/Pods/Nimble/README.md index 93a6cfa..4f7f89b 100644 --- a/Example/Pods/Nimble/README.md +++ b/Example/Pods/Nimble/README.md @@ -1,12 +1,18 @@ # Nimble +[![Build Status](https://travis-ci.org/Quick/Nimble.svg?branch=master)](https://travis-ci.org/Quick/Nimble) +[![CocoaPods](https://img.shields.io/cocoapods/v/Nimble.svg)](https://cocoapods.org/pods/Nimble) +[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Accio supported](https://img.shields.io/badge/Accio-supported-0A7CF5.svg?style=flat)](https://github.com/JamitLabs/Accio) +[![Platforms](https://img.shields.io/cocoapods/p/Nimble.svg)](https://cocoapods.org/pods/Nimble) +[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com) + Use Nimble to express the expected outcomes of Swift or Objective-C expressions. Inspired by [Cedar](https://github.com/pivotal/cedar). ```swift // Swift - expect(1 + 1).to(equal(2)) expect(1.2).to(beCloseTo(1.1, within: 0.1)) expect(3) > 2 @@ -19,10 +25,12 @@ expect(ocean.isClean).toEventually(beTruthy()) +**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - [Some Background: Expressing Outcomes Using Assertions in XCTest](#some-background-expressing-outcomes-using-assertions-in-xctest) - [Nimble: Expectations Using `expect(...).to`](#nimble-expectations-using-expectto) - - [Type Checking](#type-checking) + - [Custom Failure Messages](#custom-failure-messages) + - [Type Safety](#type-safety) - [Operator Overloads](#operator-overloads) - [Lazily Computed Values](#lazily-computed-values) - [C Primitives](#c-primitives) @@ -30,24 +38,41 @@ expect(ocean.isClean).toEventually(beTruthy()) - [Objective-C Support](#objective-c-support) - [Disabling Objective-C Shorthand](#disabling-objective-c-shorthand) - [Built-in Matcher Functions](#built-in-matcher-functions) + - [Type Checking](#type-checking) - [Equivalence](#equivalence) - [Identity](#identity) - [Comparisons](#comparisons) - [Types/Classes](#typesclasses) - [Truthiness](#truthiness) + - [Swift Assertions](#swift-assertions) + - [Swift Error Handling](#swift-error-handling) - [Exceptions](#exceptions) - [Collection Membership](#collection-membership) - [Strings](#strings) - - [Checking if all elements of a collection pass a condition](#checking-if-all-elements-of-a-collection-pass-a-condition) + - [Collection Elements](#collection-elements) + - [Collection Count](#collection-count) + - [Notifications](#notifications) + - [Matching a value to any of a group of matchers](#matching-a-value-to-any-of-a-group-of-matchers) + - [Custom Validation](#custom-validation) - [Writing Your Own Matchers](#writing-your-own-matchers) + - [PredicateResult](#predicateresult) - [Lazy Evaluation](#lazy-evaluation) - [Type Checking via Swift Generics](#type-checking-via-swift-generics) - [Customizing Failure Messages](#customizing-failure-messages) + - [Basic Customization](#basic-customization) + - [Full Customization](#full-customization) - [Supporting Objective-C](#supporting-objective-c) - [Properly Handling `nil` in Objective-C Matchers](#properly-handling-nil-in-objective-c-matchers) + - [Migrating from the Old Matcher API](#migrating-from-the-old-matcher-api) + - [Minimal Step - Use `.predicate`](#minimal-step---use-predicate) + - [Convert to use `Predicate` Type with Old Matcher Constructor](#convert-to-use-predicate-type-with-old-matcher-constructor) + - [Convert to `Predicate` Type with Preferred Constructor](#convert-to-predicate-type-with-preferred-constructor) + - [Deprecation Roadmap](#deprecation-roadmap) - [Installing Nimble](#installing-nimble) - [Installing Nimble as a Submodule](#installing-nimble-as-a-submodule) - [Installing Nimble via CocoaPods](#installing-nimble-via-cocoapods) + - [Installing Nimble via Accio](#installing-nimble-via-accio) + - [Using Nimble without XCTest](#using-nimble-without-xctest) @@ -157,7 +182,7 @@ expect(@(1+1)).toWithDescription(equal(@3), @"Make sure libKindergartenMath is l // expected to equal <3.0000>, got <2.0000> ``` -## Type Checking +## Type Safety Nimble makes sure you don't compare two types that don't match: @@ -192,7 +217,7 @@ expect(10) > 2 ## Lazily Computed Values -The `expect` function doesn't evalaute the value it's given until it's +The `expect` function doesn't evaluate the value it's given until it's time to match. So Nimble can test whether an expression raises an exception once evaluated: @@ -202,10 +227,11 @@ exception once evaluated: // Note: Swift currently doesn't have exceptions. // Only Objective-C code can raise exceptions // that Nimble will catch. +// (see https://github.com/Quick/Nimble/issues/220#issuecomment-172667064) let exception = NSException( - name: NSInternalInconsistencyException, - reason: "Not enough fish in the sea.", - userInfo: ["something": "is fishy"]) + name: NSInternalInconsistencyException, + reason: "Not enough fish in the sea.", + userInfo: ["something": "is fishy"]) expect { exception.raise() }.to(raiseException()) // Also, you can customize raiseException to be more specific @@ -273,9 +299,9 @@ expect(1 as CInt).to(equal(1)) make expectations on primitive C values, wrap then in an object literal: - ```objc - expect(@(1 + 1)).to(equal(@2)); - ``` +```objc +expect(@(1 + 1)).to(equal(@2)); +``` ## Asynchronous Expectations @@ -284,10 +310,9 @@ asynchronously. Just use `toEventually` or `toEventuallyNot`: ```swift // Swift - -dispatch_async(dispatch_get_main_queue()) { - ocean.add("dolphins") - ocean.add("whales") +DispatchQueue.main.async { + ocean.add("dolphins") + ocean.add("whales") } expect(ocean).toEventually(contain("dolphins", "whales")) ``` @@ -295,13 +320,20 @@ expect(ocean).toEventually(contain("dolphins", "whales")) ```objc // Objective-C + dispatch_async(dispatch_get_main_queue(), ^{ - [ocean add:@"dolphins"]; - [ocean add:@"whales"]; + [ocean add:@"dolphins"]; + [ocean add:@"whales"]; }); expect(ocean).toEventually(contain(@"dolphins", @"whales")); ``` +Note: toEventually triggers its polls on the main thread. Blocking the main +thread will cause Nimble to stop the run loop. This can cause test pollution +for whatever incomplete code that was running on the main thread. Blocking the +main thread can be caused by blocking IO, calls to sleep(), deadlocks, and +synchronous IPC. + In the above example, `ocean` is constantly re-evaluated. If it ever contains dolphins and whales, the expectation passes. If `ocean` still doesn't contain them, even after being continuously re-evaluated for one @@ -315,6 +347,9 @@ cases, use the `timeout` parameter: // Waits three seconds for ocean to contain "starfish": expect(ocean).toEventually(contain("starfish"), timeout: 3) + +// Evaluate someValue every 0.2 seconds repeatedly until it equals 100, or fails if it timeouts after 5.5 seconds. +expect(someValue).toEventually(equal(100), timeout: 5.5, pollInterval: 0.2) ``` ```objc @@ -330,9 +365,10 @@ You can also provide a callback by using the `waitUntil` function: // Swift waitUntil { done in - // do some stuff that takes a while... - NSThread.sleepForTimeInterval(0.5) - done() + ocean.goFish { success in + expect(success).to(beTrue()) + done() + } } ``` @@ -340,9 +376,10 @@ waitUntil { done in // Objective-C waitUntil(^(void (^done)(void)){ - // do some stuff that takes a while... - [NSThread sleepForTimeInterval:0.5]; - done(); + [ocean goFishWithHandler:^(BOOL success){ + expect(success).to(beTrue()); + done(); + }]; }); ``` @@ -352,9 +389,10 @@ waitUntil(^(void (^done)(void)){ // Swift waitUntil(timeout: 10) { done in - // do some stuff that takes a while... - NSThread.sleepForTimeInterval(1) - done() + ocean.goFish { success in + expect(success).to(beTrue()) + done() + } } ``` @@ -362,19 +400,40 @@ waitUntil(timeout: 10) { done in // Objective-C waitUntilTimeout(10, ^(void (^done)(void)){ - // do some stuff that takes a while... - [NSThread sleepForTimeInterval:1]; - done(); + [ocean goFishWithHandler:^(BOOL success){ + expect(success).to(beTrue()); + done(); + }]; }); ``` +Note: `waitUntil` triggers its timeout code on the main thread. Blocking the main +thread will cause Nimble to stop the run loop to continue. This can cause test +pollution for whatever incomplete code that was running on the main thread. +Blocking the main thread can be caused by blocking IO, calls to sleep(), +deadlocks, and synchronous IPC. + +In some cases (e.g. when running on slower machines) it can be useful to modify +the default timeout and poll interval values. This can be done as follows: + +```swift +// Swift + +// Increase the global timeout to 5 seconds: +Nimble.AsyncDefaults.Timeout = 5 + +// Slow the polling interval to 0.1 seconds: +Nimble.AsyncDefaults.PollInterval = 0.1 +``` + ## Objective-C Support Nimble has full support for Objective-C. However, there are two things to keep in mind when using Nimble in Objective-C: 1. All parameters passed to the `expect` function, as well as matcher - functions like `equal`, must be Objective-C objects: + functions like `equal`, must be Objective-C objects or can be converted into + an `NSObject` equivalent: ```objc // Objective-C @@ -383,6 +442,17 @@ to keep in mind when using Nimble in Objective-C: expect(@(1 + 1)).to(equal(@2)); expect(@"Hello world").to(contain(@"world")); + + // Boxed as NSNumber * + expect(2).to(equal(2)); + expect(1.2).to(beLessThan(2.0)); + expect(true).to(beTruthy()); + + // Boxed as NSString * + expect("Hello world").to(equal("Hello world")); + + // Boxed as NSRange + expect(NSMakeRange(1, 10)).to(equal(NSMakeRange(1, 10))); ``` 2. To make an expectation on an expression that does not return a value, @@ -395,6 +465,28 @@ to keep in mind when using Nimble in Objective-C: expectAction(^{ [exception raise]; }).to(raiseException()); ``` +The following types are currently converted to an `NSObject` type: + + - **C Numeric types** are converted to `NSNumber *` + - `NSRange` is converted to `NSValue *` + - `char *` is converted to `NSString *` + +For the following matchers: + +- `equal` +- `beGreaterThan` +- `beGreaterThanOrEqual` +- `beLessThan` +- `beLessThanOrEqual` +- `beCloseTo` +- `beTrue` +- `beFalse` +- `beTruthy` +- `beFalsy` +- `haveCount` + +If you would like to see more, [file an issue](https://github.com/Quick/Nimble/issues). + ## Disabling Objective-C Shorthand Nimble provides a shorthand for expressing expectations using the @@ -419,16 +511,78 @@ NMB_expect(^{ return seagull.squawk; }, __FILE__, __LINE__).to(NMB_equal(@"Squee Nimble includes a wide variety of matcher functions. +## Type Checking + +Nimble supports checking the type membership of any kind of object, whether +Objective-C conformant or not: + +```swift +// Swift + +protocol SomeProtocol{} +class SomeClassConformingToProtocol: SomeProtocol{} +struct SomeStructConformingToProtocol: SomeProtocol{} + +// The following tests pass +expect(1).to(beAKindOf(Int.self)) +expect("turtle").to(beAKindOf(String.self)) + +let classObject = SomeClassConformingToProtocol() +expect(classObject).to(beAKindOf(SomeProtocol.self)) +expect(classObject).to(beAKindOf(SomeClassConformingToProtocol.self)) +expect(classObject).toNot(beAKindOf(SomeStructConformingToProtocol.self)) + +let structObject = SomeStructConformingToProtocol() +expect(structObject).to(beAKindOf(SomeProtocol.self)) +expect(structObject).to(beAKindOf(SomeStructConformingToProtocol.self)) +expect(structObject).toNot(beAKindOf(SomeClassConformingToProtocol.self)) +``` + +```objc +// Objective-C + +// The following tests pass +NSMutableArray *array = [NSMutableArray array]; +expect(array).to(beAKindOf([NSArray class])); +expect(@1).toNot(beAKindOf([NSNull class])); +``` + +Objects can be tested for their exact types using the `beAnInstanceOf` matcher: + +```swift +// Swift + +protocol SomeProtocol{} +class SomeClassConformingToProtocol: SomeProtocol{} +struct SomeStructConformingToProtocol: SomeProtocol{} + +// Unlike the 'beKindOf' matcher, the 'beAnInstanceOf' matcher only +// passes if the object is the EXACT type requested. The following +// tests pass -- note its behavior when working in an inheritance hierarchy. +expect(1).to(beAnInstanceOf(Int.self)) +expect("turtle").to(beAnInstanceOf(String.self)) + +let classObject = SomeClassConformingToProtocol() +expect(classObject).toNot(beAnInstanceOf(SomeProtocol.self)) +expect(classObject).to(beAnInstanceOf(SomeClassConformingToProtocol.self)) +expect(classObject).toNot(beAnInstanceOf(SomeStructConformingToProtocol.self)) + +let structObject = SomeStructConformingToProtocol() +expect(structObject).toNot(beAnInstanceOf(SomeProtocol.self)) +expect(structObject).to(beAnInstanceOf(SomeStructConformingToProtocol.self)) +expect(structObject).toNot(beAnInstanceOf(SomeClassConformingToProtocol.self)) +``` + ## Equivalence ```swift // Swift -// Passes if actual is equivalent to expected: +// Passes if 'actual' is equivalent to 'expected': expect(actual).to(equal(expected)) expect(actual) == expected -// Passes if actual is not equivalent to expected: +// Passes if 'actual' is not equivalent to 'expected': expect(actual).toNot(equal(expected)) expect(actual) != expected ``` @@ -436,10 +590,10 @@ expect(actual) != expected ```objc // Objective-C -// Passes if actual is equivalent to expected: +// Passes if 'actual' is equivalent to 'expected': expect(actual).to(equal(expected)) -// Passes if actual is not equivalent to expected: +// Passes if 'actual' is not equivalent to 'expected': expect(actual).toNot(equal(expected)) ``` @@ -451,29 +605,36 @@ Values must be `Equatable`, `Comparable`, or subclasses of `NSObject`. ```swift // Swift -// Passes if actual has the same pointer address as expected: +// Passes if 'actual' has the same pointer address as 'expected': expect(actual).to(beIdenticalTo(expected)) expect(actual) === expected -// Passes if actual does not have the same pointer address as expected: +// Passes if 'actual' does not have the same pointer address as 'expected': expect(actual).toNot(beIdenticalTo(expected)) expect(actual) !== expected ``` +It is important to remember that `beIdenticalTo` only makes sense when comparing +types with reference semantics, which have a notion of identity. In Swift, +that means types that are defined as a `class`. + +This matcher will not work when comparing types with value semantics such as +those defined as a `struct` or `enum`. If you need to compare two value types, +consider what it means for instances of your type to be identical. This may mean +comparing individual properties or, if it makes sense to do so, conforming your type +to `Equatable` and using Nimble's equivalence matchers instead. + + ```objc // Objective-C -// Passes if actual has the same pointer address as expected: +// Passes if 'actual' has the same pointer address as 'expected': expect(actual).to(beIdenticalTo(expected)); -// Passes if actual does not have the same pointer address as expected: +// Passes if 'actual' does not have the same pointer address as 'expected': expect(actual).toNot(beIdenticalTo(expected)); ``` -> `beIdenticalTo` only supports Objective-C objects: subclasses - of `NSObject`, or Swift objects bridged to Objective-C with the - `@objc` prefix. - ## Comparisons ```swift @@ -544,7 +705,7 @@ expect(actual) ≈ expected expect(actual) ≈ (expected, delta) ``` -(Type Option-x to get ≈ on a U.S. keyboard) +(Type option+x to get `≈` on a U.S. keyboard) The former version uses the default delta of 0.0001. Here is yet another way to do this: @@ -555,7 +716,7 @@ expect(actual) ≈ expected ± delta expect(actual) == expected ± delta ``` -(Type Option-Shift-= to get ± on a U.S. keyboard) +(Type option+shift+= to get `±` on a U.S. keyboard) If you are comparing arrays of floating point numbers, you'll find the following useful: @@ -575,20 +736,20 @@ expect([0.0, 2.0]).to(beCloseTo([0.1, 2.1], within: 0.1)) ```swift // Swift -// Passes if instance is an instance of aClass: +// Passes if 'instance' is an instance of 'aClass': expect(instance).to(beAnInstanceOf(aClass)) -// Passes if instance is an instance of aClass or any of its subclasses: +// Passes if 'instance' is an instance of 'aClass' or any of its subclasses: expect(instance).to(beAKindOf(aClass)) ``` ```objc // Objective-C -// Passes if instance is an instance of aClass: +// Passes if 'instance' is an instance of 'aClass': expect(instance).to(beAnInstanceOf(aClass)); -// Passes if instance is an instance of aClass or any of its subclasses: +// Passes if 'instance' is an instance of 'aClass' or any of its subclasses: expect(instance).to(beAKindOf(aClass)); ``` @@ -615,61 +776,122 @@ expect(dolphin).to(beAKindOf([Mammal class])); ## Truthiness ```swift -// Passes if actual is not nil, false, or an object with a boolean value of false: +// Passes if 'actual' is not nil, true, or an object with a boolean value of true: expect(actual).to(beTruthy()) -// Passes if actual is only true (not nil or an object conforming to BooleanType true): +// Passes if 'actual' is only true (not nil or an object conforming to Boolean true): expect(actual).to(beTrue()) -// Passes if actual is nil, false, or an object with a boolean value of false: +// Passes if 'actual' is nil, false, or an object with a boolean value of false: expect(actual).to(beFalsy()) -// Passes if actual is only false (not nil or an object conforming to BooleanType false): +// Passes if 'actual' is only false (not nil or an object conforming to Boolean false): expect(actual).to(beFalse()) -// Passes if actual is nil: +// Passes if 'actual' is nil: expect(actual).to(beNil()) ``` ```objc // Objective-C -// Passes if actual is not nil, false, or an object with a boolean value of false: +// Passes if 'actual' is not nil, true, or an object with a boolean value of true: expect(actual).to(beTruthy()); -// Passes if actual is only true (not nil or an object conforming to BooleanType true): +// Passes if 'actual' is only true (not nil or an object conforming to Boolean true): expect(actual).to(beTrue()); -// Passes if actual is nil, false, or an object with a boolean value of false: +// Passes if 'actual' is nil, false, or an object with a boolean value of false: expect(actual).to(beFalsy()); -// Passes if actual is only false (not nil or an object conforming to BooleanType false): +// Passes if 'actual' is only false (not nil or an object conforming to Boolean false): expect(actual).to(beFalse()); -// Passes if actual is nil: +// Passes if 'actual' is nil: expect(actual).to(beNil()); ``` +## Swift Assertions + +If you're using Swift, you can use the `throwAssertion` matcher to check if an assertion is thrown (e.g. `fatalError()`). This is made possible by [@mattgallagher](https://github.com/mattgallagher)'s [CwlPreconditionTesting](https://github.com/mattgallagher/CwlPreconditionTesting) library. + +```swift +// Swift + +// Passes if 'somethingThatThrows()' throws an assertion, +// such as by calling 'fatalError()' or if a precondition fails: +expect { try somethingThatThrows() }.to(throwAssertion()) +expect { () -> Void in fatalError() }.to(throwAssertion()) +expect { precondition(false) }.to(throwAssertion()) + +// Passes if throwing an NSError is not equal to throwing an assertion: +expect { throw NSError(domain: "test", code: 0, userInfo: nil) }.toNot(throwAssertion()) + +// Passes if the code after the precondition check is not run: +var reachedPoint1 = false +var reachedPoint2 = false +expect { + reachedPoint1 = true + precondition(false, "condition message") + reachedPoint2 = true +}.to(throwAssertion()) + +expect(reachedPoint1) == true +expect(reachedPoint2) == false +``` + +Notes: + +* This feature is only available in Swift. +* It is only supported for `x86_64` binaries, meaning _you cannot run this matcher on iOS devices, only simulators_. +* The tvOS simulator is supported, but using a different mechanism, requiring you to turn off the `Debug executable` scheme setting for your tvOS scheme's Test configuration. + ## Swift Error Handling -If you're using Swift 2.0+, you can use the `throwError` matcher to check if an error is thrown. +You can use the `throwError` matcher to check if an error is thrown. ```swift // Swift -// Passes if somethingThatThrows() throws an ErrorType: -expect{ try somethingThatThrows() }.to(throwError()) +// Passes if 'somethingThatThrows()' throws an 'Error': +expect { try somethingThatThrows() }.to(throwError()) -// Passes if somethingThatThrows() throws an error with a given domain: -expect{ try somethingThatThrows() }.to(throwError { (error: ErrorType) in +// Passes if 'somethingThatThrows()' throws an error within a particular domain: +expect { try somethingThatThrows() }.to(throwError { (error: Error) in expect(error._domain).to(equal(NSCocoaErrorDomain)) }) -// Passes if somethingThatThrows() throws an error with a given case: -expect{ try somethingThatThrows() }.to(throwError(NSCocoaError.PropertyListReadCorruptError)) +// Passes if 'somethingThatThrows()' throws a particular error enum case: +expect { try somethingThatThrows() }.to(throwError(NSCocoaError.PropertyListReadCorruptError)) + +// Passes if 'somethingThatThrows()' throws an error of a particular type: +expect { try somethingThatThrows() }.to(throwError(errorType: NimbleError.self)) +``` + +When working directly with `Error` values, using the `matchError` matcher +allows you to perform certain checks on the error itself without having to +explicitly cast the error. + +The `matchError` matcher allows you to check whether or not the error: + +- is the same _type_ of error you are expecting. +- represents a particular error value that you are expecting. + +This can be useful when using `Result` or `Promise` types, for example. + +```swift +// Swift + +let actual: Error = ... -// Passes if somethingThatThrows() throws an error with a given type: -expect{ try somethingThatThrows() }.to(throwError(errorType: MyError.self)) +// Passes if 'actual' represents any error value from the NimbleErrorEnum type: +expect(actual).to(matchError(NimbleErrorEnum.self)) + +// Passes if 'actual' represents the case 'timeout' from the NimbleErrorEnum type: +expect(actual).to(matchError(NimbleErrorEnum.timeout)) + +// Passes if 'actual' contains an NSError equal to the one provided: +expect(actual).to(matchError(NSError(domain: "err", code: 123, userInfo: nil))) ``` Note: This feature is only available in Swift. @@ -679,17 +901,17 @@ Note: This feature is only available in Swift. ```swift // Swift -// Passes if actual, when evaluated, raises an exception: +// Passes if 'actual', when evaluated, raises an exception: expect(actual).to(raiseException()) -// Passes if actual raises an exception with the given name: +// Passes if 'actual' raises an exception with the given name: expect(actual).to(raiseException(named: name)) -// Passes if actual raises an exception with the given name and reason: +// Passes if 'actual' raises an exception with the given name and reason: expect(actual).to(raiseException(named: name, reason: reason)) -// Passes if actual raises an exception and it passes expectations in the block -// (in this case, if name begins with 'a r') +// Passes if 'actual' raises an exception which passes expectations defined in the given closure: +// (in this case, if the exception's name begins with "a r") expect { exception.raise() }.to(raiseException { (exception: NSException) in expect(exception.name).to(beginWith("a r")) }) @@ -698,44 +920,44 @@ expect { exception.raise() }.to(raiseException { (exception: NSException) in ```objc // Objective-C -// Passes if actual, when evaluated, raises an exception: +// Passes if 'actual', when evaluated, raises an exception: expect(actual).to(raiseException()) -// Passes if actual raises an exception with the given name +// Passes if 'actual' raises an exception with the given name expect(actual).to(raiseException().named(name)) -// Passes if actual raises an exception with the given name and reason: +// Passes if 'actual' raises an exception with the given name and reason: expect(actual).to(raiseException().named(name).reason(reason)) -// Passes if actual raises an exception and it passes expectations in the block -// (in this case, if name begins with 'a r') +// Passes if 'actual' raises an exception and it passes expectations defined in the given block: +// (in this case, if name begins with "a r") expect(actual).to(raiseException().satisfyingBlock(^(NSException *exception) { expect(exception.name).to(beginWith(@"a r")); })); ``` -Note: Swift currently doesn't have exceptions. Only Objective-C code can raise -exceptions that Nimble will catch. +Note: Swift currently doesn't have exceptions (see [#220](https://github.com/Quick/Nimble/issues/220#issuecomment-172667064)). +Only Objective-C code can raise exceptions that Nimble will catch. ## Collection Membership ```swift // Swift -// Passes if all of the expected values are members of actual: +// Passes if all of the expected values are members of 'actual': expect(actual).to(contain(expected...)) -// Passes if actual is an empty collection (it contains no elements): +// Passes if 'actual' is empty (i.e. it contains no elements): expect(actual).to(beEmpty()) ``` ```objc // Objective-C -// Passes if expected is a member of actual: +// Passes if expected is a member of 'actual': expect(actual).to(contain(expected)); -// Passes if actual is an empty collection (it contains no elements): +// Passes if 'actual' is empty (i.e. it contains no elements): expect(actual).to(beEmpty()); ``` @@ -768,20 +990,20 @@ an ordered collection, use `beginWith` and `endWith`: ```swift // Swift -// Passes if the elements in expected appear at the beginning of actual: +// Passes if the elements in expected appear at the beginning of 'actual': expect(actual).to(beginWith(expected...)) -// Passes if the the elements in expected come at the end of actual: +// Passes if the the elements in expected come at the end of 'actual': expect(actual).to(endWith(expected...)) ``` ```objc // Objective-C -// Passes if the elements in expected appear at the beginning of actual: +// Passes if the elements in expected appear at the beginning of 'actual': expect(actual).to(beginWith(expected)); -// Passes if the the elements in expected come at the end of actual: +// Passes if the the elements in expected come at the end of 'actual': expect(actual).to(endWith(expected)); ``` @@ -792,92 +1014,279 @@ expect(actual).to(endWith(expected)); Like `contain`, in Objective-C `beginWith` and `endWith` only support a single argument [for now](https://github.com/Quick/Nimble/issues/27). +For code that returns collections of complex objects without a strict +ordering, there is the `containElementSatisfying` matcher: + +```swift +// Swift + +struct Turtle { + let color: String +} + +let turtles: [Turtle] = functionThatReturnsSomeTurtlesInAnyOrder() + +// This set of matchers passes regardless of whether the array is +// [{color: "blue"}, {color: "green"}] or [{color: "green"}, {color: "blue"}]: + +expect(turtles).to(containElementSatisfying({ turtle in + return turtle.color == "green" +})) +expect(turtles).to(containElementSatisfying({ turtle in + return turtle.color == "blue" +}, "that is a turtle with color 'blue'")) + +// The second matcher will incorporate the provided string in the error message +// should it fail +``` + +```objc +// Objective-C + +@interface Turtle : NSObject +@property (nonatomic, readonly, nonnull) NSString *color; +@end + +@implementation Turtle +@end + +NSArray * __nonnull turtles = functionThatReturnsSomeTurtlesInAnyOrder(); + +// This set of matchers passes regardless of whether the array is +// [{color: "blue"}, {color: "green"}] or [{color: "green"}, {color: "blue"}]: + +expect(turtles).to(containElementSatisfying(^BOOL(id __nonnull object) { + return [[turtle color] isEqualToString:@"green"]; +})); +expect(turtles).to(containElementSatisfying(^BOOL(id __nonnull object) { + return [[turtle color] isEqualToString:@"blue"]; +})); +``` + ## Strings ```swift // Swift -// Passes if actual contains substring expected: -expect(actual).to(contain(expected)) +// Passes if 'actual' contains 'substring': +expect(actual).to(contain(substring)) -// Passes if actual begins with substring: -expect(actual).to(beginWith(expected)) +// Passes if 'actual' begins with 'prefix': +expect(actual).to(beginWith(prefix)) -// Passes if actual ends with substring: -expect(actual).to(endWith(expected)) +// Passes if 'actual' ends with 'suffix': +expect(actual).to(endWith(suffix)) -// Passes if actual is an empty string, "": +// Passes if 'actual' represents the empty string, "": expect(actual).to(beEmpty()) -// Passes if actual matches the regular expression defined in expected: +// Passes if 'actual' matches the regular expression defined in 'expected': expect(actual).to(match(expected)) ``` ```objc // Objective-C -// Passes if actual contains substring expected: +// Passes if 'actual' contains 'substring': expect(actual).to(contain(expected)); -// Passes if actual begins with substring: -expect(actual).to(beginWith(expected)); +// Passes if 'actual' begins with 'prefix': +expect(actual).to(beginWith(prefix)); -// Passes if actual ends with substring: -expect(actual).to(endWith(expected)); +// Passes if 'actual' ends with 'suffix': +expect(actual).to(endWith(suffix)); -// Passes if actual is an empty string, "": +// Passes if 'actual' represents the empty string, "": expect(actual).to(beEmpty()); -// Passes if actual matches the regular expression defined in expected: +// Passes if 'actual' matches the regular expression defined in 'expected': expect(actual).to(match(expected)) ``` -## Checking if all elements of a collection pass a condition +## Collection Elements + +Nimble provides a means to check that all elements of a collection pass a given expectation. + +### Swift + +In Swift, the collection must be an instance of a type conforming to +`Sequence`. + +```swift +// Swift + +// Providing a custom function: +expect([1, 2, 3, 4]).to(allPass { $0! < 5 }) + +// Composing the expectation with another matcher: +expect([1, 2, 3, 4]).to(allPass(beLessThan(5))) +``` + +### Objective-C + +In Objective-C, the collection must be an instance of a type which implements +the `NSFastEnumeration` protocol, and whose elements are instances of a type +which subclasses `NSObject`. + +Additionally, unlike in Swift, there is no override to specify a custom +matcher function. + +```objc +// Objective-C + +expect(@[@1, @2, @3, @4]).to(allPass(beLessThan(@5))); +``` + +## Collection Count + +```swift +// Swift + +// Passes if 'actual' contains the 'expected' number of elements: +expect(actual).to(haveCount(expected)) + +// Passes if 'actual' does _not_ contain the 'expected' number of elements: +expect(actual).notTo(haveCount(expected)) +``` + +```objc +// Objective-C + +// Passes if 'actual' contains the 'expected' number of elements: +expect(actual).to(haveCount(expected)) + +// Passes if 'actual' does _not_ contain the 'expected' number of elements: +expect(actual).notTo(haveCount(expected)) +``` + +For Swift, the actual value must be an instance of a type conforming to `Collection`. +For example, instances of `Array`, `Dictionary`, or `Set`. + +For Objective-C, the actual value must be one of the following classes, or their subclasses: + + - `NSArray`, + - `NSDictionary`, + - `NSSet`, or + - `NSHashTable`. + +## Notifications + +```swift +// Swift +let testNotification = Notification(name: "Foo", object: nil) + +// passes if the closure in expect { ... } posts a notification to the default +// notification center. +expect { + NotificationCenter.default.postNotification(testNotification) +}.to(postNotifications(equal([testNotification])) + +// passes if the closure in expect { ... } posts a notification to a given +// notification center +let notificationCenter = NotificationCenter() +expect { + notificationCenter.postNotification(testNotification) +}.to(postNotifications(equal([testNotification]), fromNotificationCenter: notificationCenter)) +``` + +> This matcher is only available in Swift. + +## Matching a value to any of a group of matchers ```swift // Swift -// with a custom function: -expect([1,2,3,4]).to(allPass({$0 < 5})) +// passes if actual is either less than 10 or greater than 20 +expect(actual).to(satisfyAnyOf(beLessThan(10), beGreaterThan(20))) + +// can include any number of matchers -- the following will pass +// **be careful** -- too many matchers can be the sign of an unfocused test +expect(6).to(satisfyAnyOf(equal(2), equal(3), equal(4), equal(5), equal(6), equal(7))) -// with another matcher: -expect([1,2,3,4]).to(allPass(beLessThan(5))) +// in Swift you also have the option to use the || operator to achieve a similar function +expect(82).to(beLessThan(50) || beGreaterThan(80)) ``` ```objc // Objective-C -expect(@[@1, @2, @3,@4]).to(allPass(beLessThan(@5))); +// passes if actual is either less than 10 or greater than 20 +expect(actual).to(satisfyAnyOf(beLessThan(@10), beGreaterThan(@20))) + +// can include any number of matchers -- the following will pass +// **be careful** -- too many matchers can be the sign of an unfocused test +expect(@6).to(satisfyAnyOf(equal(@2), equal(@3), equal(@4), equal(@5), equal(@6), equal(@7))) +``` + +Note: This matcher allows you to chain any number of matchers together. This provides flexibility, + but if you find yourself chaining many matchers together in one test, consider whether you + could instead refactor that single test into multiple, more precisely focused tests for + better coverage. + +## Custom Validation + +```swift +// Swift + +// passes if .succeeded is returned from the closure +expect({ + guard case .enumCaseWithAssociatedValueThatIDontCareAbout = actual else { + return .failed(reason: "wrong enum case") + } + + return .succeeded +}).to(succeed()) + +// passes if .failed is returned from the closure +expect({ + guard case .enumCaseWithAssociatedValueThatIDontCareAbout = actual else { + return .failed(reason: "wrong enum case") + } + + return .succeeded +}).notTo(succeed()) ``` -For Swift the actual value has to be a SequenceType, e.g. an array, a set or a custom seqence type. +The `String` provided with `.failed()` is shown when the test fails. -For Objective-C the actual value has to be a NSFastEnumeration, e.g. NSArray and NSSet, of NSObjects and only the variant which -uses another matcher is available here. +When using `toEventually()` be careful not to make state changes or run process intensive code since this closure will be ran many times. # Writing Your Own Matchers In Nimble, matchers are Swift functions that take an expected -value and return a `MatcherFunc` closure. Take `equal`, for example: +value and return a `Predicate` closure. Take `equal`, for example: ```swift // Swift -public func equal(expectedValue: T?) -> MatcherFunc { - return MatcherFunc { actualExpression, failureMessage in - failureMessage.postfixMessage = "equal <\(expectedValue)>" - return actualExpression.evaluate() == expectedValue - } +public func equal(expectedValue: T?) -> Predicate { + // Can be shortened to: + // Predicate { actual in ... } + // + // But shown with types here for clarity. + return Predicate { (actualExpression: Expression) throws -> PredicateResult in + let msg = ExpectationMessage.expectedActualValueTo("equal <\(expectedValue)>") + if let actualValue = try actualExpression.evaluate() { + return PredicateResult( + bool: actualValue == expectedValue!, + message: msg + ) + } else { + return PredicateResult( + status: .fail, + message: msg.appendedBeNilHint() + ) + } + } } ``` -The return value of a `MatcherFunc` closure is a `Bool` that indicates -whether the actual value matches the expectation: `true` if it does, or -`false` if it doesn't. +The return value of a `Predicate` closure is a `PredicateResult` that indicates +whether the actual value matches the expectation and what error message to +display on failure. -> The actual `equal` matcher function does not match when either - `actual` or `expected` are nil; the example above has been edited for - brevity. +> The actual `equal` matcher function does not match when + `expected` are nil; the example above has been edited for brevity. Since matchers are just Swift functions, you can define them anywhere: at the top of your test file, in a file shared by all of your tests, or @@ -888,10 +1297,67 @@ in an Xcode project you distribute to others. distribute it yourself via GitHub. For examples of how to write your own matchers, just check out the -[`Matchers` directory](https://github.com/Quick/Nimble/tree/master/Nimble/Matchers) +[`Matchers` directory](https://github.com/Quick/Nimble/tree/master/Sources/Nimble/Matchers) to see how Nimble's built-in set of matchers are implemented. You can also check out the tips below. +## PredicateResult + +`PredicateResult` is the return struct that `Predicate` return to indicate +success and failure. A `PredicateResult` is made up of two values: +`PredicateStatus` and `ExpectationMessage`. + +Instead of a boolean, `PredicateStatus` captures a trinary set of values: + +```swift +// Swift + +public enum PredicateStatus { +// The predicate "passes" with the given expression +// eg - expect(1).to(equal(1)) +case matches + +// The predicate "fails" with the given expression +// eg - expect(1).toNot(equal(1)) +case doesNotMatch + +// The predicate never "passes" with the given expression, even if negated +// eg - expect(nil as Int?).toNot(equal(1)) +case fail + +// ... +} +``` + +Meanwhile, `ExpectationMessage` provides messaging semantics for error reporting. + +```swift +// Swift + +public indirect enum ExpectationMessage { +// Emits standard error message: +// eg - "expected to , got " +case expectedActualValueTo(/* message: */ String) + +// Allows any free-form message +// eg - "" +case fail(/* message: */ String) + +// ... +} +``` + +Predicates should usually depend on either `.expectedActualValueTo(..)` or +`.fail(..)` when reporting errors. Special cases can be used for the other enum +cases. + +Finally, if your Predicate utilizes other Predicates, you can utilize +`.appended(details:)` and `.appended(message:)` methods to annotate an existing +error with more details. + +A common message to append is failing on nils. For that, `.appendedBeNilHint()` +can be used. + ## Lazy Evaluation `actualExpression` is a lazy, memoized closure around the value provided to the @@ -902,22 +1368,24 @@ custom matchers should call `actualExpression.evaluate()`: ```swift // Swift -public func beNil() -> MatcherFunc { - return MatcherFunc { actualExpression, failureMessage in - failureMessage.postfixMessage = "be nil" - return actualExpression.evaluate() == nil - } +public func beNil() -> Predicate { + // Predicate.simpleNilable(..) automatically generates ExpectationMessage for + // us based on the string we provide to it. Also, the 'Nilable' postfix indicates + // that this Predicate supports matching against nil actualExpressions, instead of + // always resulting in a PredicateStatus.fail result -- which is true for + // Predicate.simple(..) + return Predicate.simpleNilable("be nil") { actualExpression in + let actualValue = try actualExpression.evaluate() + return PredicateStatus(bool: actualValue == nil) + } } ``` -In the above example, `actualExpression` is not `nil`--it is a closure +In the above example, `actualExpression` is not `nil` -- it is a closure that returns a value. The value it returns, which is accessed via the `evaluate()` method, may be `nil`. If that value is `nil`, the `beNil` matcher function returns `true`, indicating that the expectation passed. -Use `expression.isClosure` to determine if the expression will be invoking -a closure to produce its value. - ## Type Checking via Swift Generics Using Swift's generics, matchers can constrain the type of the actual value @@ -930,43 +1398,108 @@ against the one provided to the matcher function, and passes if they are the sam ```swift // Swift -public func haveDescription(description: String) -> MatcherFunc { - return MatcherFunc { actual, failureMessage in - return actual.evaluate().description == description - } +public func haveDescription(description: String) -> Predicate { + return Predicate.simple("have description") { actual in + return PredicateStatus(bool: actual.evaluate().description == description) + } } ``` ## Customizing Failure Messages -By default, Nimble outputs the following failure message when an -expectation fails: +When using `Predicate.simple(..)` or `Predicate.simpleNilable(..)`, Nimble +outputs the following failure message when an expectation fails: +```swift +// where `message` is the first string argument and +// `actual` is the actual value received in `expect(..)` +"expected to \(message), got <\(actual)>" ``` -expected to match, got <\(actual)> -``` -You can customize this message by modifying the `failureMessage` struct -from within your `MatcherFunc` closure. To change the verb "match" to -something else, update the `postfixMessage` property: +You can customize this message by modifying the way you create a `Predicate`. + +### Basic Customization + +For slightly more complex error messaging, receive the created failure message +with `Predicate.define(..)`: ```swift // Swift -// Outputs: expected to be under the sea, got <\(actual)> -failureMessage.postfixMessage = "be under the sea" +public func equal(_ expectedValue: T?) -> Predicate { + return Predicate.define("equal <\(stringify(expectedValue))>") { actualExpression, msg in + let actualValue = try actualExpression.evaluate() + let matches = actualValue == expectedValue && expectedValue != nil + if expectedValue == nil || actualValue == nil { + if expectedValue == nil && actualValue != nil { + return PredicateResult( + status: .fail, + message: msg.appendedBeNilHint() + ) + } + return PredicateResult(status: .fail, message: msg) + } + return PredicateResult(bool: matches, message: msg) + } +} ``` -You can change how the `actual` value is displayed by updating -`failureMessage.actualValue`. Or, to remove it altogether, set it to -`nil`: +In the example above, `msg` is defined based on the string given to +`Predicate.define`. The code looks akin to: ```swift // Swift -// Outputs: expected to be under the sea -failureMessage.actualValue = nil -failureMessage.postfixMessage = "be under the sea" +let msg = ExpectationMessage.expectedActualValueTo("equal <\(stringify(expectedValue))>") +``` + +### Full Customization + +To fully customize the behavior of the Predicate, use the overload that expects +a `PredicateResult` to be returned. + +Along with `PredicateResult`, there are other `ExpectationMessage` enum values you can use: + +```swift +public indirect enum ExpectationMessage { +// Emits standard error message: +// eg - "expected to , got " +case expectedActualValueTo(/* message: */ String) + +// Allows any free-form message +// eg - "" +case fail(/* message: */ String) + +// Emits standard error message with a custom actual value instead of the default. +// eg - "expected to , got " +case expectedCustomValueTo(/* message: */ String, /* actual: */ String) + +// Emits standard error message without mentioning the actual value +// eg - "expected to " +case expectedTo(/* message: */ String) + +// ... +} +``` + +For matchers that compose other matchers, there are a handful of helper +functions to annotate messages. + +`appended(message: String)` is used to append to the original failure message: + +```swift +// produces "expected to be true, got (use beFalse() for inverse)" +// appended message do show up inline in Xcode. +.expectedActualValueTo("be true").appended(message: " (use beFalse() for inverse)") +``` + +For a more comprehensive message that spans multiple lines, use +`appended(details: String)` instead: + +```swift +// produces "expected to be true, got \n\nuse beFalse() for inverse\nor use beNil()" +// details do not show inline in Xcode, but do show up in test logs. +.expectedActualValueTo("be true").appended(details: "use beFalse() for inverse\nor use beNil()") ``` ## Supporting Objective-C @@ -980,13 +1513,13 @@ custom matcher. The example below defines the class method // Swift extension NMBObjCMatcher { - public class func beNilMatcher() -> NMBObjCMatcher { - return NMBObjCMatcher { actualBlock, failureMessage, location in - let block = ({ actualBlock() as NSObject? }) - let expr = Expression(expression: block, location: location) - return beNil().matches(expr, failureMessage: failureMessage) + public class func beNilMatcher() -> NMBObjCMatcher { + return NMBObjCMatcher { actualBlock, failureMessage, location in + let block = ({ actualBlock() as NSObject? }) + let expr = Expression(expression: block, location: location) + return beNil().matches(expr, failureMessage: failureMessage) + } } - } } ``` @@ -1005,7 +1538,7 @@ class method: // Objective-C FOUNDATION_EXPORT id beNil() { - return [NMBObjCMatcher beNilMatcher]; + return [NMBObjCMatcher beNilMatcher]; } ``` @@ -1033,11 +1566,11 @@ automatically generate expected value failure messages when they're nil. ```swift -public func beginWith(startingElement: T) -> NonNilMatcherFunc { +public func beginWith(startingElement: T) -> NonNilMatcherFunc { return NonNilMatcherFunc { actualExpression, failureMessage in failureMessage.postfixMessage = "begin with <\(startingElement)>" if let actualValue = actualExpression.evaluate() { - var actualGenerator = actualValue.generate() + var actualGenerator = actualValue.makeIterator() return actualGenerator.next() == startingElement } return false @@ -1055,24 +1588,99 @@ extension NMBObjCMatcher { } ``` +## Migrating from the Old Matcher API + +Previously (`<7.0.0`), Nimble supported matchers via the following types: + +- `Matcher` +- `NonNilMatcherFunc` +- `MatcherFunc` + +All of those types have been replaced by `Predicate`. While migrating can be a +lot of work, Nimble currently provides several steps to aid migration of your +custom matchers: + +### Minimal Step - Use `.predicate` + +Nimble provides an extension to the old types that automatically naively +converts those types to the newer `Predicate`. + +```swift +// Swift +public func beginWith(startingElement: T) -> Predicate { + return NonNilMatcherFunc { actualExpression, failureMessage in + failureMessage.postfixMessage = "begin with <\(startingElement)>" + if let actualValue = actualExpression.evaluate() { + var actualGenerator = actualValue.makeIterator() + return actualGenerator.next() == startingElement + } + return false + }.predicate +} +``` + +This is the simpliest way to externally support `Predicate` which allows easier +composition than the old Nimble matcher interface, with minimal effort to change. + +### Convert to use `Predicate` Type with Old Matcher Constructor + +The second most convenient step is to utilize special constructors that +`Predicate` supports that closely align to the constructors of the old Nimble +matcher types. + +```swift +// Swift +public func beginWith(startingElement: T) -> Predicate { + return Predicate.fromDeprecatedClosure { actualExpression, failureMessage in + failureMessage.postfixMessage = "begin with <\(startingElement)>" + if let actualValue = actualExpression.evaluate() { + var actualGenerator = actualValue.makeIterator() + return actualGenerator.next() == startingElement + } + return false + } +} +``` + +This allows you to completely drop the old types from your code, although the +intended behavior may alter slightly to what is desired. + +### Convert to `Predicate` Type with Preferred Constructor + +Finally, you can convert to the native `Predicate` format using one of the +constructors not used to assist in the migration. + +### Deprecation Roadmap + +Nimble 7 introduces `Predicate` but will support the old types with warning +deprecations. A couple major releases of Nimble will remain backwards +compatible with the old matcher api, although new features may not be +backported. + +The deprecating plan is a 3 major versions removal. Which is as follows: + + 1. Introduce new `Predicate` API, deprecation warning for old matcher APIs. + (Nimble `v7.x.x` and `v8.x.x`) + 2. Introduce warnings on migration-path features (`.predicate`, + `Predicate`-constructors with similar arguments to old API). (Nimble + `v9.x.x`) + 3. Remove old API. (Nimble `v10.x.x`) + + # Installing Nimble > Nimble can be used on its own, or in conjunction with its sister project, [Quick](https://github.com/Quick/Quick). To install both Quick and Nimble, follow [the installation instructions in the Quick - README](https://github.com/Quick/Quick#how-to-install-quick). + Documentation](https://github.com/Quick/Quick/blob/master/Documentation/en-us/InstallingQuick.md). Nimble can currently be installed in one of two ways: using CocoaPods, or with git submodules. -- The `swift-2.0` branch support Swift 2.0. -- The `master` branch of Nimble supports Swift 1.2. -- For Swift 1.1 support, use the `swift-1.1` branch. - ## Installing Nimble as a Submodule -To use Nimble as a submodule to test your iOS or OS X applications, follow these -4 easy steps: +To use Nimble as a submodule to test your macOS, iOS or tvOS applications, follow +these 4 easy steps: 1. Clone the Nimble repository 2. Add Nimble.xcodeproj to the Xcode workspace for your project @@ -1086,9 +1694,9 @@ install just Nimble. ## Installing Nimble via CocoaPods -To use Nimble in CocoaPods to test your iOS or OS X applications, add Nimble to -your podfile and add the ```use_frameworks!``` line to enable Swift support for -Cocoapods. +To use Nimble in CocoaPods to test your macOS, iOS or tvOS applications, add +Nimble to your podfile and add the ```use_frameworks!``` line to enable Swift +support for CocoaPods. ```ruby platform :ios, '8.0' @@ -1099,13 +1707,66 @@ source 'https://github.com/CocoaPods/Specs.git' target 'YOUR_APP_NAME_HERE_Tests', :exclusive => true do use_frameworks! - # If you're using Swift 2.0 (Xcode 7), use this: - pod 'Nimble', '2.0.0-rc.2' - # If you're using Swift 1.2 (Xcode 6), use this: - pod 'Nimble', '~> 1.0.0' - # Otherwise, use this commented out line for Swift 1.1 (Xcode 6.2): - # pod 'Nimble', '~> 0.3.0' + pod 'Nimble', '~> 6.0.0' end ``` Finally run `pod install`. + +## Installing Nimble via Accio + +Add the following to your Package.swift: + +```swift +.package(url: "https://github.com/Quick/Nimble.git", .upToNextMajor(from: "8.0.1")), +``` + +Next, add `Nimble` to your App targets dependencies like so: + +```swift +.testTarget( + name: "AppTests", + dependencies: [ + "Nimble", + ] +), +``` + +Then run `accio update`. + +## Using Nimble without XCTest + +Nimble is integrated with XCTest to allow it work well when used in Xcode test +bundles, however it can also be used in a standalone app. After installing +Nimble using one of the above methods, there are two additional steps required +to make this work. + +1. Create a custom assertion handler and assign an instance of it to the + global `NimbleAssertionHandler` variable. For example: + +```swift +class MyAssertionHandler : AssertionHandler { + func assert(assertion: Bool, message: FailureMessage, location: SourceLocation) { + if (!assertion) { + print("Expectation failed: \(message.stringValue)") + } + } +} +``` +```swift +// Somewhere before you use any assertions +NimbleAssertionHandler = MyAssertionHandler() +``` + +2. Add a post-build action to fix an issue with the Swift XCTest support + library being unnecessarily copied into your app + * Edit your scheme in Xcode, and navigate to Build -> Post-actions + * Click the "+" icon and select "New Run Script Action" + * Open the "Provide build settings from" dropdown and select your target + * Enter the following script contents: +``` +rm "${SWIFT_STDLIB_TOOL_DESTINATION_DIR}/libswiftXCTest.dylib" +``` + +You can now use Nimble assertions in your code and handle failures as you see +fit. diff --git a/Example/Pods/Nimble/Sources/Nimble/Adapters/AdapterProtocols.swift b/Example/Pods/Nimble/Sources/Nimble/Adapters/AdapterProtocols.swift new file mode 100644 index 0000000..abaf532 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Adapters/AdapterProtocols.swift @@ -0,0 +1,18 @@ +import Foundation + +/// Protocol for the assertion handler that Nimble uses for all expectations. +public protocol AssertionHandler { + func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) +} + +/// Global backing interface for assertions that Nimble creates. +/// Defaults to a private test handler that passes through to XCTest. +/// +/// If XCTest is not available, you must assign your own assertion handler +/// before using any matchers, otherwise Nimble will abort the program. +/// +/// @see AssertionHandler +public var NimbleAssertionHandler: AssertionHandler = { () -> AssertionHandler in + // swiftlint:disable:previous identifier_name + return isXCTestAvailable() ? NimbleXCTestHandler() : NimbleXCTestUnavailableHandler() +}() diff --git a/Example/Pods/Nimble/Sources/Nimble/Adapters/AssertionDispatcher.swift b/Example/Pods/Nimble/Sources/Nimble/Adapters/AssertionDispatcher.swift new file mode 100644 index 0000000..94a9030 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Adapters/AssertionDispatcher.swift @@ -0,0 +1,19 @@ +/// AssertionDispatcher allows multiple AssertionHandlers to receive +/// assertion messages. +/// +/// @warning Does not fully dispatch if one of the handlers raises an exception. +/// This is possible with XCTest-based assertion handlers. +/// +public class AssertionDispatcher: AssertionHandler { + let handlers: [AssertionHandler] + + public init(handlers: [AssertionHandler]) { + self.handlers = handlers + } + + public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) { + for handler in handlers { + handler.assert(assertion, message: message, location: location) + } + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Adapters/AssertionRecorder.swift b/Example/Pods/Nimble/Sources/Nimble/Adapters/AssertionRecorder.swift new file mode 100644 index 0000000..0f5df59 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Adapters/AssertionRecorder.swift @@ -0,0 +1,127 @@ +import Foundation + +/// A data structure that stores information about an assertion when +/// AssertionRecorder is set as the Nimble assertion handler. +/// +/// @see AssertionRecorder +/// @see AssertionHandler +public struct AssertionRecord: CustomStringConvertible { + /// Whether the assertion succeeded or failed + public let success: Bool + /// The failure message the assertion would display on failure. + public let message: FailureMessage + /// The source location the expectation occurred on. + public let location: SourceLocation + + public var description: String { + return "AssertionRecord { success=\(success), message='\(message.stringValue)', location=\(location) }" + } +} + +/// An AssertionHandler that silently records assertions that Nimble makes. +/// This is useful for testing failure messages for matchers. +/// +/// @see AssertionHandler +public class AssertionRecorder: AssertionHandler { + /// All the assertions that were captured by this recorder + public var assertions = [AssertionRecord]() + + public init() {} + + public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) { + assertions.append( + AssertionRecord( + success: assertion, + message: message, + location: location)) + } +} + +extension NMBExceptionCapture { + internal func tryBlockThrows(_ unsafeBlock: () throws -> Void) throws { + var catchedError: Error? + tryBlock { + do { + try unsafeBlock() + } catch { + catchedError = error + } + } + if let error = catchedError { + throw error + } + } +} + +/// Allows you to temporarily replace the current Nimble assertion handler with +/// the one provided for the scope of the closure. +/// +/// Once the closure finishes, then the original Nimble assertion handler is restored. +/// +/// @see AssertionHandler +public func withAssertionHandler(_ tempAssertionHandler: AssertionHandler, + file: FileString = #file, + line: UInt = #line, + closure: () throws -> Void) { + let environment = NimbleEnvironment.activeInstance + let oldRecorder = environment.assertionHandler + let capturer = NMBExceptionCapture(handler: nil, finally: ({ + environment.assertionHandler = oldRecorder + })) + environment.assertionHandler = tempAssertionHandler + + do { + try capturer.tryBlockThrows { + try closure() + } + } catch { + let failureMessage = FailureMessage() + failureMessage.stringValue = "unexpected error thrown: <\(error)>" + let location = SourceLocation(file: file, line: line) + tempAssertionHandler.assert(false, message: failureMessage, location: location) + } +} + +/// Captures expectations that occur in the given closure. Note that all +/// expectations will still go through to the default Nimble handler. +/// +/// This can be useful if you want to gather information about expectations +/// that occur within a closure. +/// +/// @param silently expectations are no longer send to the default Nimble +/// assertion handler when this is true. Defaults to false. +/// +/// @see gatherFailingExpectations +public func gatherExpectations(silently: Bool = false, closure: () -> Void) -> [AssertionRecord] { + let previousRecorder = NimbleEnvironment.activeInstance.assertionHandler + let recorder = AssertionRecorder() + let handlers: [AssertionHandler] + + if silently { + handlers = [recorder] + } else { + handlers = [recorder, previousRecorder] + } + + let dispatcher = AssertionDispatcher(handlers: handlers) + withAssertionHandler(dispatcher, closure: closure) + return recorder.assertions +} + +/// Captures failed expectations that occur in the given closure. Note that all +/// expectations will still go through to the default Nimble handler. +/// +/// This can be useful if you want to gather information about failed +/// expectations that occur within a closure. +/// +/// @param silently expectations are no longer send to the default Nimble +/// assertion handler when this is true. Defaults to false. +/// +/// @see gatherExpectations +/// @see raiseException source for an example use case. +public func gatherFailingExpectations(silently: Bool = false, closure: () -> Void) -> [AssertionRecord] { + let assertions = gatherExpectations(silently: silently, closure: closure) + return assertions.filter { assertion in + !assertion.success + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Adapters/NMBExpectation.swift b/Example/Pods/Nimble/Sources/Nimble/Adapters/NMBExpectation.swift new file mode 100644 index 0000000..5338a46 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Adapters/NMBExpectation.swift @@ -0,0 +1,191 @@ +import Foundation + +#if canImport(Darwin) && !SWIFT_PACKAGE + +private func from(objcPredicate: NMBPredicate) -> Predicate { + return Predicate { actualExpression in + let result = objcPredicate.satisfies(({ try actualExpression.evaluate() }), + location: actualExpression.location) + return result.toSwift() + } +} + +internal struct ObjCMatcherWrapper: Matcher { + let matcher: NMBMatcher + + func matches(_ actualExpression: Expression, failureMessage: FailureMessage) -> Bool { + return matcher.matches( + // swiftlint:disable:next force_try + ({ try! actualExpression.evaluate() }), + failureMessage: failureMessage, + location: actualExpression.location) + } + + func doesNotMatch(_ actualExpression: Expression, failureMessage: FailureMessage) -> Bool { + return matcher.doesNotMatch( + // swiftlint:disable:next force_try + ({ try! actualExpression.evaluate() }), + failureMessage: failureMessage, + location: actualExpression.location) + } +} + +// Equivalent to Expectation, but for Nimble's Objective-C interface +public class NMBExpectation: NSObject { + // swiftlint:disable identifier_name + internal let _actualBlock: () -> NSObject? + internal var _negative: Bool + internal let _file: FileString + internal let _line: UInt + internal var _timeout: TimeInterval = 1.0 + // swiftlint:enable identifier_name + + @objc public init(actualBlock: @escaping () -> NSObject?, negative: Bool, file: FileString, line: UInt) { + self._actualBlock = actualBlock + self._negative = negative + self._file = file + self._line = line + } + + private var expectValue: Expectation { + return expect(_file, line: _line) { + self._actualBlock() as NSObject? + } + } + + @objc public var withTimeout: (TimeInterval) -> NMBExpectation { + return { timeout in self._timeout = timeout + return self + } + } + + @objc public var to: (NMBMatcher) -> Void { + return { matcher in + if let pred = matcher as? NMBPredicate { + self.expectValue.to(from(objcPredicate: pred)) + } else { + self.expectValue.to(ObjCMatcherWrapper(matcher: matcher)) + } + } + } + + @objc public var toWithDescription: (NMBMatcher, String) -> Void { + return { matcher, description in + if let pred = matcher as? NMBPredicate { + self.expectValue.to(from(objcPredicate: pred), description: description) + } else { + self.expectValue.to(ObjCMatcherWrapper(matcher: matcher), description: description) + } + } + } + + @objc public var toNot: (NMBMatcher) -> Void { + return { matcher in + if let pred = matcher as? NMBPredicate { + self.expectValue.toNot(from(objcPredicate: pred)) + } else { + self.expectValue.toNot(ObjCMatcherWrapper(matcher: matcher)) + } + } + } + + @objc public var toNotWithDescription: (NMBMatcher, String) -> Void { + return { matcher, description in + if let pred = matcher as? NMBPredicate { + self.expectValue.toNot(from(objcPredicate: pred), description: description) + } else { + self.expectValue.toNot(ObjCMatcherWrapper(matcher: matcher), description: description) + } + } + } + + @objc public var notTo: (NMBMatcher) -> Void { return toNot } + + @objc public var notToWithDescription: (NMBMatcher, String) -> Void { return toNotWithDescription } + + @objc public var toEventually: (NMBMatcher) -> Void { + return { matcher in + if let pred = matcher as? NMBPredicate { + self.expectValue.toEventually( + from(objcPredicate: pred), + timeout: self._timeout, + description: nil + ) + } else { + self.expectValue.toEventually( + ObjCMatcherWrapper(matcher: matcher), + timeout: self._timeout, + description: nil + ) + } + } + } + + @objc public var toEventuallyWithDescription: (NMBMatcher, String) -> Void { + return { matcher, description in + if let pred = matcher as? NMBPredicate { + self.expectValue.toEventually( + from(objcPredicate: pred), + timeout: self._timeout, + description: description + ) + } else { + self.expectValue.toEventually( + ObjCMatcherWrapper(matcher: matcher), + timeout: self._timeout, + description: description + ) + } + } + } + + @objc public var toEventuallyNot: (NMBMatcher) -> Void { + return { matcher in + if let pred = matcher as? NMBPredicate { + self.expectValue.toEventuallyNot( + from(objcPredicate: pred), + timeout: self._timeout, + description: nil + ) + } else { + self.expectValue.toEventuallyNot( + ObjCMatcherWrapper(matcher: matcher), + timeout: self._timeout, + description: nil + ) + } + } + } + + @objc public var toEventuallyNotWithDescription: (NMBMatcher, String) -> Void { + return { matcher, description in + if let pred = matcher as? NMBPredicate { + self.expectValue.toEventuallyNot( + from(objcPredicate: pred), + timeout: self._timeout, + description: description + ) + } else { + self.expectValue.toEventuallyNot( + ObjCMatcherWrapper(matcher: matcher), + timeout: self._timeout, + description: description + ) + } + } + } + + @objc public var toNotEventually: (NMBMatcher) -> Void { + return toEventuallyNot + } + + @objc public var toNotEventuallyWithDescription: (NMBMatcher, String) -> Void { + return toEventuallyNotWithDescription + } + + @objc public class func failWithMessage(_ message: String, file: FileString, line: UInt) { + fail(message, location: SourceLocation(file: file, line: line)) + } +} + +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Adapters/NMBObjCMatcher.swift b/Example/Pods/Nimble/Sources/Nimble/Adapters/NMBObjCMatcher.swift new file mode 100644 index 0000000..a91efe3 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Adapters/NMBObjCMatcher.swift @@ -0,0 +1,95 @@ +import Foundation + +#if canImport(Darwin) + +// swiftlint:disable line_length +public typealias MatcherBlock = (_ actualExpression: Expression, _ failureMessage: FailureMessage) throws -> Bool +public typealias FullMatcherBlock = (_ actualExpression: Expression, _ failureMessage: FailureMessage, _ shouldNotMatch: Bool) throws -> Bool +// swiftlint:enable line_length + +public class NMBObjCMatcher: NSObject, NMBMatcher { + // swiftlint:disable identifier_name + let _match: MatcherBlock + let _doesNotMatch: MatcherBlock + // swiftlint:enable identifier_name + let canMatchNil: Bool + + public init(canMatchNil: Bool, matcher: @escaping MatcherBlock, notMatcher: @escaping MatcherBlock) { + self.canMatchNil = canMatchNil + self._match = matcher + self._doesNotMatch = notMatcher + } + + public convenience init(matcher: @escaping MatcherBlock) { + self.init(canMatchNil: true, matcher: matcher) + } + + public convenience init(canMatchNil: Bool, matcher: @escaping MatcherBlock) { + self.init(canMatchNil: canMatchNil, matcher: matcher, notMatcher: ({ actualExpression, failureMessage in + return try !matcher(actualExpression, failureMessage) + })) + } + + public convenience init(matcher: @escaping FullMatcherBlock) { + self.init(canMatchNil: true, matcher: matcher) + } + + public convenience init(canMatchNil: Bool, matcher: @escaping FullMatcherBlock) { + self.init(canMatchNil: canMatchNil, matcher: ({ actualExpression, failureMessage in + return try matcher(actualExpression, failureMessage, false) + }), notMatcher: ({ actualExpression, failureMessage in + return try matcher(actualExpression, failureMessage, true) + })) + } + + private func canMatch(_ actualExpression: Expression, failureMessage: FailureMessage) -> Bool { + do { + if !canMatchNil { + if try actualExpression.evaluate() == nil { + failureMessage.postfixActual = " (use beNil() to match nils)" + return false + } + } + } catch let error { + failureMessage.actualValue = "an unexpected error thrown: \(error)" + return false + } + return true + } + + public func matches(_ actualBlock: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool { + let expr = Expression(expression: actualBlock, location: location) + let result: Bool + do { + result = try _match(expr, failureMessage) + } catch let error { + failureMessage.stringValue = "unexpected error thrown: <\(error)>" + return false + } + + if self.canMatch(Expression(expression: actualBlock, location: location), failureMessage: failureMessage) { + return result + } else { + return false + } + } + + public func doesNotMatch(_ actualBlock: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool { + let expr = Expression(expression: actualBlock, location: location) + let result: Bool + do { + result = try _doesNotMatch(expr, failureMessage) + } catch let error { + failureMessage.stringValue = "unexpected error thrown: <\(error)>" + return false + } + + if self.canMatch(Expression(expression: actualBlock, location: location), failureMessage: failureMessage) { + return result + } else { + return false + } + } +} + +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Adapters/NimbleEnvironment.swift b/Example/Pods/Nimble/Sources/Nimble/Adapters/NimbleEnvironment.swift new file mode 100644 index 0000000..1b2e8c0 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Adapters/NimbleEnvironment.swift @@ -0,0 +1,43 @@ +import Dispatch +import Foundation + +/// "Global" state of Nimble is stored here. Only DSL functions should access / be aware of this +/// class' existence +internal class NimbleEnvironment: NSObject { + static var activeInstance: NimbleEnvironment { + get { + let env = Thread.current.threadDictionary["NimbleEnvironment"] + if let env = env as? NimbleEnvironment { + return env + } else { + let newEnv = NimbleEnvironment() + self.activeInstance = newEnv + return newEnv + } + } + set { + Thread.current.threadDictionary["NimbleEnvironment"] = newValue + } + } + + // swiftlint:disable:next todo + // TODO: eventually migrate the global to this environment value + var assertionHandler: AssertionHandler { + get { return NimbleAssertionHandler } + set { NimbleAssertionHandler = newValue } + } + + var suppressTVOSAssertionWarning: Bool = false + var awaiter: Awaiter + + override init() { + let timeoutQueue = DispatchQueue.global(qos: .userInitiated) + awaiter = Awaiter( + waitLock: AssertionWaitLock(), + asyncQueue: .main, + timeoutQueue: timeoutQueue + ) + + super.init() + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Adapters/NimbleXCTestHandler.swift b/Example/Pods/Nimble/Sources/Nimble/Adapters/NimbleXCTestHandler.swift new file mode 100644 index 0000000..719bf44 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Adapters/NimbleXCTestHandler.swift @@ -0,0 +1,91 @@ +import Foundation +import XCTest + +/// Default handler for Nimble. This assertion handler passes failures along to +/// XCTest. +public class NimbleXCTestHandler: AssertionHandler { + public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) { + if !assertion { + recordFailure("\(message.stringValue)\n", location: location) + } + } +} + +/// Alternative handler for Nimble. This assertion handler passes failures along +/// to XCTest by attempting to reduce the failure message size. +public class NimbleShortXCTestHandler: AssertionHandler { + public func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) { + if !assertion { + let msg: String + if let actual = message.actualValue { + msg = "got: \(actual) \(message.postfixActual)" + } else { + msg = "expected \(message.to) \(message.postfixMessage)" + } + recordFailure("\(msg)\n", location: location) + } + } +} + +/// Fallback handler in case XCTest is unavailable. This assertion handler will abort +/// the program if it is invoked. +class NimbleXCTestUnavailableHandler: AssertionHandler { + func assert(_ assertion: Bool, message: FailureMessage, location: SourceLocation) { + fatalError("XCTest is not available and no custom assertion handler was configured. Aborting.") + } +} + +#if !SWIFT_PACKAGE +/// Helper class providing access to the currently executing XCTestCase instance, if any +@objc final internal class CurrentTestCaseTracker: NSObject, XCTestObservation { + @objc static let sharedInstance = CurrentTestCaseTracker() + + private(set) var currentTestCase: XCTestCase? + + private var stashed_swift_reportFatalErrorsToDebugger: Bool = false + + @objc func testCaseWillStart(_ testCase: XCTestCase) { + #if swift(>=3.2) + stashed_swift_reportFatalErrorsToDebugger = _swift_reportFatalErrorsToDebugger + _swift_reportFatalErrorsToDebugger = false + #endif + + currentTestCase = testCase + } + + @objc func testCaseDidFinish(_ testCase: XCTestCase) { + currentTestCase = nil + + #if swift(>=3.2) + _swift_reportFatalErrorsToDebugger = stashed_swift_reportFatalErrorsToDebugger + #endif + } +} +#endif + +func isXCTestAvailable() -> Bool { +#if canImport(Darwin) + // XCTest is weakly linked and so may not be present + return NSClassFromString("XCTestCase") != nil +#else + return true +#endif +} + +public func recordFailure(_ message: String, location: SourceLocation) { +#if SWIFT_PACKAGE + XCTFail("\(message)", file: location.file, line: location.line) +#else + if let testCase = CurrentTestCaseTracker.sharedInstance.currentTestCase { + let line = Int(location.line) + testCase.recordFailure(withDescription: message, inFile: location.file, atLine: line, expected: true) + } else { + let msg = """ + Attempted to report a test failure to XCTest while no test case was running. The failure was: + \"\(message)\" + It occurred at: \(location.file):\(location.line) + """ + NSException(name: .internalInconsistencyException, reason: msg, userInfo: nil).raise() + } +#endif +} diff --git a/Example/Pods/Nimble/Sources/Nimble/DSL+Wait.swift b/Example/Pods/Nimble/Sources/Nimble/DSL+Wait.swift new file mode 100644 index 0000000..c049417 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/DSL+Wait.swift @@ -0,0 +1,122 @@ +import Dispatch +import Foundation + +private enum ErrorResult { + case exception(NSException) + case error(Error) + case none +} + +/// Only classes, protocols, methods, properties, and subscript declarations can be +/// bridges to Objective-C via the @objc keyword. This class encapsulates callback-style +/// asynchronous waiting logic so that it may be called from Objective-C and Swift. +internal class NMBWait: NSObject { +// About these kind of lines, `@objc` attributes are only required for Objective-C +// support, so that should be conditional on Darwin platforms and normal Xcode builds +// (non-SwiftPM builds). +#if canImport(Darwin) && !SWIFT_PACKAGE + @objc + internal class func until( + timeout: TimeInterval, + file: FileString = #file, + line: UInt = #line, + action: @escaping (@escaping () -> Void) -> Void) { + return throwableUntil(timeout: timeout, file: file, line: line) { done in + action(done) + } + } +#else + internal class func until( + timeout: TimeInterval, + file: FileString = #file, + line: UInt = #line, + action: @escaping (@escaping () -> Void) -> Void) { + return throwableUntil(timeout: timeout, file: file, line: line) { done in + action(done) + } + } +#endif + + // Using a throwable closure makes this method not objc compatible. + internal class func throwableUntil( + timeout: TimeInterval, + file: FileString = #file, + line: UInt = #line, + action: @escaping (@escaping () -> Void) throws -> Void) { + let awaiter = NimbleEnvironment.activeInstance.awaiter + let leeway = timeout / 2.0 + // swiftlint:disable:next line_length + let result = awaiter.performBlock(file: file, line: line) { (done: @escaping (ErrorResult) -> Void) throws -> Void in + DispatchQueue.main.async { + let capture = NMBExceptionCapture( + handler: ({ exception in + done(.exception(exception)) + }), + finally: ({ }) + ) + capture.tryBlock { + do { + try action { + done(.none) + } + } catch let e { + done(.error(e)) + } + } + } + }.timeout(timeout, forcefullyAbortTimeout: leeway).wait("waitUntil(...)", file: file, line: line) + + switch result { + case .incomplete: internalError("Reached .incomplete state for waitUntil(...).") + case .blockedRunLoop: + fail(blockedRunLoopErrorMessageFor("-waitUntil()", leeway: leeway), + file: file, line: line) + case .timedOut: + let pluralize = (timeout == 1 ? "" : "s") + fail("Waited more than \(timeout) second\(pluralize)", file: file, line: line) + case let .raisedException(exception): + fail("Unexpected exception raised: \(exception)") + case let .errorThrown(error): + fail("Unexpected error thrown: \(error)") + case .completed(.exception(let exception)): + fail("Unexpected exception raised: \(exception)") + case .completed(.error(let error)): + fail("Unexpected error thrown: \(error)") + case .completed(.none): // success + break + } + } + +#if canImport(Darwin) && !SWIFT_PACKAGE + @objc(untilFile:line:action:) + internal class func until( + _ file: FileString = #file, + line: UInt = #line, + action: @escaping (@escaping () -> Void) -> Void) { + until(timeout: 1, file: file, line: line, action: action) + } +#else + internal class func until( + _ file: FileString = #file, + line: UInt = #line, + action: @escaping (@escaping () -> Void) -> Void) { + until(timeout: 1, file: file, line: line, action: action) + } +#endif +} + +internal func blockedRunLoopErrorMessageFor(_ fnName: String, leeway: TimeInterval) -> String { + // swiftlint:disable:next line_length + return "\(fnName) timed out but was unable to run the timeout handler because the main thread is unresponsive (\(leeway) seconds is allow after the wait times out). Conditions that may cause this include processing blocking IO on the main thread, calls to sleep(), deadlocks, and synchronous IPC. Nimble forcefully stopped run loop which may cause future failures in test run." +} + +/// Wait asynchronously until the done closure is called or the timeout has been reached. +/// +/// @discussion +/// Call the done() closure to indicate the waiting has completed. +/// +/// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function +/// is executing. Any attempts to touch the run loop may cause non-deterministic behavior. +public func waitUntil(timeout: TimeInterval = AsyncDefaults.Timeout, file: FileString = #file, line: UInt = #line, action: @escaping (@escaping () -> Void) -> Void) { + NMBWait.until(timeout: timeout, file: file, line: line, action: action) +} diff --git a/Example/Pods/Nimble/Sources/Nimble/DSL.swift b/Example/Pods/Nimble/Sources/Nimble/DSL.swift new file mode 100644 index 0000000..d6dc9cc --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/DSL.swift @@ -0,0 +1,68 @@ +import Foundation + +/// Make an expectation on a given actual value. The value given is lazily evaluated. +public func expect(_ expression: @autoclosure @escaping () throws -> T?, file: FileString = #file, line: UInt = #line) -> Expectation { + return Expectation( + expression: Expression( + expression: expression, + location: SourceLocation(file: file, line: line), + isClosure: true)) +} + +/// Make an expectation on a given actual value. The closure is lazily invoked. +public func expect(_ file: FileString = #file, line: UInt = #line, expression: @escaping () throws -> T?) -> Expectation { + return Expectation( + expression: Expression( + expression: expression, + location: SourceLocation(file: file, line: line), + isClosure: true)) +} + +/// Always fails the test with a message and a specified location. +public func fail(_ message: String, location: SourceLocation) { + let handler = NimbleEnvironment.activeInstance.assertionHandler + handler.assert(false, message: FailureMessage(stringValue: message), location: location) +} + +/// Always fails the test with a message. +public func fail(_ message: String, file: FileString = #file, line: UInt = #line) { + fail(message, location: SourceLocation(file: file, line: line)) +} + +/// Always fails the test. +public func fail(_ file: FileString = #file, line: UInt = #line) { + fail("fail() always fails", file: file, line: line) +} + +/// Like Swift's precondition(), but raises NSExceptions instead of sigaborts +internal func nimblePrecondition( + _ expr: @autoclosure() -> Bool, + _ name: @autoclosure() -> String, + _ message: @autoclosure() -> String, + file: StaticString = #file, + line: UInt = #line) { + let result = expr() + if !result { +#if canImport(Darwin) + let exception = NSException( + name: NSExceptionName(name()), + reason: message(), + userInfo: nil + ) + exception.raise() +#else + preconditionFailure("\(name()) - \(message())", file: file, line: line) +#endif + } +} + +internal func internalError(_ msg: String, file: FileString = #file, line: UInt = #line) -> Never { + // swiftlint:disable line_length + fatalError( + """ + Nimble Bug Found: \(msg) at \(file):\(line). + Please file a bug to Nimble: https://github.com/Quick/Nimble/issues with the code snippet that caused this error. + """ + ) + // swiftlint:enable line_length +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Expectation.swift b/Example/Pods/Nimble/Sources/Nimble/Expectation.swift new file mode 100644 index 0000000..41625a1 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Expectation.swift @@ -0,0 +1,125 @@ +import Foundation + +// Deprecated +internal func expressionDoesNotMatch(_ expression: Expression, matcher: U, toNot: String, description: String?) -> (Bool, FailureMessage) + where U: Matcher, U.ValueType == T { + let msg = FailureMessage() + msg.userDescription = description + msg.to = toNot + do { + let pass = try matcher.doesNotMatch(expression, failureMessage: msg) + if msg.actualValue == "" { + msg.actualValue = "<\(stringify(try expression.evaluate()))>" + } + return (pass, msg) + } catch let error { + msg.stringValue = "unexpected error thrown: <\(error)>" + return (false, msg) + } +} + +internal func execute(_ expression: Expression, _ style: ExpectationStyle, _ predicate: Predicate, to: String, description: String?, captureExceptions: Bool = true) -> (Bool, FailureMessage) { + func run() -> (Bool, FailureMessage) { + let msg = FailureMessage() + msg.userDescription = description + msg.to = to + do { + let result = try predicate.satisfies(expression) + result.message.update(failureMessage: msg) + if msg.actualValue == "" { + msg.actualValue = "<\(stringify(try expression.evaluate()))>" + } + return (result.toBoolean(expectation: style), msg) + } catch let error { + msg.stringValue = "unexpected error thrown: <\(error)>" + return (false, msg) + } + } + + var result: (Bool, FailureMessage) = (false, FailureMessage()) + if captureExceptions { + let capture = NMBExceptionCapture(handler: ({ exception -> Void in + let msg = FailureMessage() + msg.stringValue = "unexpected exception raised: \(exception)" + result = (false, msg) + }), finally: nil) + capture.tryBlock { + result = run() + } + } else { + result = run() + } + + return result +} + +public struct Expectation { + + public let expression: Expression + + public init(expression: Expression) { + self.expression = expression + } + + public func verify(_ pass: Bool, _ message: FailureMessage) { + let handler = NimbleEnvironment.activeInstance.assertionHandler + handler.assert(pass, message: message, location: expression.location) + } + + ////////////////// OLD API ///////////////////// + + /// DEPRECATED: Tests the actual value using a matcher to match. + public func to(_ matcher: U, description: String? = nil) + where U: Matcher, U.ValueType == T { + let (pass, msg) = execute( + expression, + .toMatch, + matcher.predicate, + to: "to", + description: description, + captureExceptions: false + ) + verify(pass, msg) + } + + /// DEPRECATED: Tests the actual value using a matcher to not match. + public func toNot(_ matcher: U, description: String? = nil) + where U: Matcher, U.ValueType == T { + // swiftlint:disable:next line_length + let (pass, msg) = expressionDoesNotMatch(expression, matcher: matcher, toNot: "to not", description: description) + verify(pass, msg) + } + + /// DEPRECATED: Tests the actual value using a matcher to not match. + /// + /// Alias to toNot(). + public func notTo(_ matcher: U, description: String? = nil) + where U: Matcher, U.ValueType == T { + toNot(matcher, description: description) + } + + ////////////////// NEW API ///////////////////// + + /// Tests the actual value using a matcher to match. + public func to(_ predicate: Predicate, description: String? = nil) { + let (pass, msg) = execute(expression, .toMatch, predicate, to: "to", description: description) + verify(pass, msg) + } + + /// Tests the actual value using a matcher to not match. + public func toNot(_ predicate: Predicate, description: String? = nil) { + let (pass, msg) = execute(expression, .toNotMatch, predicate, to: "to not", description: description) + verify(pass, msg) + } + + /// Tests the actual value using a matcher to not match. + /// + /// Alias to toNot(). + public func notTo(_ predicate: Predicate, description: String? = nil) { + toNot(predicate, description: description) + } + + // see: + // - `async` for extension + // - NMBExpectation for Objective-C interface +} diff --git a/Example/Pods/Nimble/Sources/Nimble/ExpectationMessage.swift b/Example/Pods/Nimble/Sources/Nimble/ExpectationMessage.swift new file mode 100644 index 0000000..b0cbcc3 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/ExpectationMessage.swift @@ -0,0 +1,267 @@ +import Foundation + +public indirect enum ExpectationMessage { + // --- Primary Expectations --- + /// includes actual value in output ("expected to , got ") + case expectedActualValueTo(/* message: */ String) + /// uses a custom actual value string in output ("expected to , got ") + case expectedCustomValueTo(/* message: */ String, /* actual: */ String) + /// excludes actual value in output ("expected to ") + case expectedTo(/* message: */ String) + /// allows any free-form message ("") + case fail(/* message: */ String) + + // --- Composite Expectations --- + // Generally, you'll want the methods, appended(message:) and appended(details:) instead. + + /// Not Fully Implemented Yet. + case prepends(/* Prepended Message */ String, ExpectationMessage) + + /// appends after an existing message (" (use beNil() to match nils)") + case appends(ExpectationMessage, /* Appended Message */ String) + + /// provides long-form multi-line explainations ("\n\n") + case details(ExpectationMessage, String) + + internal var sampleMessage: String { + let asStr = toString(actual: "", expected: "expected", to: "to") + let asFailureMessage = FailureMessage() + update(failureMessage: asFailureMessage) + // swiftlint:disable:next line_length + return "(toString(actual:expected:to:) -> \(asStr) || update(failureMessage:) -> \(asFailureMessage.stringValue))" + } + + /// Returns the smallest message after the "expected to" string that summarizes the error. + /// + /// Returns the message part from ExpectationMessage, ignoring all .appends and .details. + public var expectedMessage: String { + switch self { + case let .fail(msg): + return msg + case let .expectedTo(msg): + return msg + case let .expectedActualValueTo(msg): + return msg + case let .expectedCustomValueTo(msg, _): + return msg + case let .prepends(_, expectation): + return expectation.expectedMessage + case let .appends(expectation, msg): + return "\(expectation.expectedMessage)\(msg)" + case let .details(expectation, _): + return expectation.expectedMessage + } + } + + /// Appends a message after the primary expectation message + public func appended(message: String) -> ExpectationMessage { + switch self { + case .fail, .expectedTo, .expectedActualValueTo, .expectedCustomValueTo, .appends, .prepends: + return .appends(self, message) + case let .details(expectation, msg): + return .details(expectation.appended(message: message), msg) + } + } + + /// Appends a message hinting to use beNil() for when the actual value given was nil. + public func appendedBeNilHint() -> ExpectationMessage { + return appended(message: " (use beNil() to match nils)") + } + + /// Appends a detailed (aka - multiline) message after the primary expectation message + /// Detailed messages will be placed after .appended(message:) calls. + public func appended(details: String) -> ExpectationMessage { + return .details(self, details) + } + + internal func visitLeafs(_ f: (ExpectationMessage) -> ExpectationMessage) -> ExpectationMessage { + // swiftlint:disable:previous identifier_name + switch self { + case .fail, .expectedTo, .expectedActualValueTo, .expectedCustomValueTo: + return f(self) + case let .prepends(msg, expectation): + return .prepends(msg, expectation.visitLeafs(f)) + case let .appends(expectation, msg): + return .appends(expectation.visitLeafs(f), msg) + case let .details(expectation, msg): + return .details(expectation.visitLeafs(f), msg) + } + } + + /// Replaces a primary expectation with one returned by f. Preserves all composite expectations + /// that were built upon it (aka - all appended(message:) and appended(details:). + public func replacedExpectation(_ f: @escaping (ExpectationMessage) -> ExpectationMessage) -> ExpectationMessage { + // swiftlint:disable:previous identifier_name + func walk(_ msg: ExpectationMessage) -> ExpectationMessage { + switch msg { + case .fail, .expectedTo, .expectedActualValueTo, .expectedCustomValueTo: + return f(msg) + default: + return msg + } + } + return visitLeafs(walk) + } + + /// Wraps a primary expectation with text before and after it. + /// Alias to prepended(message: before).appended(message: after) + public func wrappedExpectation(before: String, after: String) -> ExpectationMessage { + return prepended(expectation: before).appended(message: after) + } + + /// Prepends a message by modifying the primary expectation + public func prepended(expectation message: String) -> ExpectationMessage { + func walk(_ msg: ExpectationMessage) -> ExpectationMessage { + switch msg { + case let .expectedTo(msg): + return .expectedTo(message + msg) + case let .expectedActualValueTo(msg): + return .expectedActualValueTo(message + msg) + case let .expectedCustomValueTo(msg, actual): + return .expectedCustomValueTo(message + msg, actual) + default: + return msg.visitLeafs(walk) + } + } + return visitLeafs(walk) + } + + // swiftlint:disable:next todo + // TODO: test & verify correct behavior + internal func prepended(message: String) -> ExpectationMessage { + return .prepends(message, self) + } + + /// Converts the tree of ExpectationMessages into a final built string. + public func toString(actual: String, expected: String = "expected", to: String = "to") -> String { + switch self { + case let .fail(msg): + return msg + case let .expectedTo(msg): + return "\(expected) \(to) \(msg)" + case let .expectedActualValueTo(msg): + return "\(expected) \(to) \(msg), got \(actual)" + case let .expectedCustomValueTo(msg, actual): + return "\(expected) \(to) \(msg), got \(actual)" + case let .prepends(msg, expectation): + return "\(msg)\(expectation.toString(actual: actual, expected: expected, to: to))" + case let .appends(expectation, msg): + return "\(expectation.toString(actual: actual, expected: expected, to: to))\(msg)" + case let .details(expectation, msg): + return "\(expectation.toString(actual: actual, expected: expected, to: to))\n\n\(msg)" + } + } + + // Backwards compatibility: converts ExpectationMessage tree to FailureMessage + internal func update(failureMessage: FailureMessage) { + switch self { + case let .fail(msg) where !msg.isEmpty: + failureMessage.stringValue = msg + case .fail: + break + case let .expectedTo(msg): + failureMessage.actualValue = nil + failureMessage.postfixMessage = msg + case let .expectedActualValueTo(msg): + failureMessage.postfixMessage = msg + case let .expectedCustomValueTo(msg, actual): + failureMessage.postfixMessage = msg + failureMessage.actualValue = actual + case let .prepends(msg, expectation): + expectation.update(failureMessage: failureMessage) + if let desc = failureMessage.userDescription { + failureMessage.userDescription = "\(msg)\(desc)" + } else { + failureMessage.userDescription = msg + } + case let .appends(expectation, msg): + expectation.update(failureMessage: failureMessage) + failureMessage.appendMessage(msg) + case let .details(expectation, msg): + expectation.update(failureMessage: failureMessage) + failureMessage.appendDetails(msg) + } + } +} + +extension FailureMessage { + internal func toExpectationMessage() -> ExpectationMessage { + let defaultMessage = FailureMessage() + if expected != defaultMessage.expected || _stringValueOverride != nil { + return .fail(stringValue) + } + + var message: ExpectationMessage = .fail(userDescription ?? "") + if actualValue != "" && actualValue != nil { + message = .expectedCustomValueTo(postfixMessage, actualValue ?? "") + } else if postfixMessage != defaultMessage.postfixMessage { + if actualValue == nil { + message = .expectedTo(postfixMessage) + } else { + message = .expectedActualValueTo(postfixMessage) + } + } + if postfixActual != defaultMessage.postfixActual { + message = .appends(message, postfixActual) + } + if let extended = extendedMessage { + message = .details(message, extended) + } + return message + } +} + +#if canImport(Darwin) + +public class NMBExpectationMessage: NSObject { + private let msg: ExpectationMessage + + internal init(swift msg: ExpectationMessage) { + self.msg = msg + } + + public init(expectedTo message: String) { + self.msg = .expectedTo(message) + } + public init(expectedActualValueTo message: String) { + self.msg = .expectedActualValueTo(message) + } + + public init(expectedActualValueTo message: String, customActualValue actual: String) { + self.msg = .expectedCustomValueTo(message, actual) + } + + public init(fail message: String) { + self.msg = .fail(message) + } + + public init(prepend message: String, child: NMBExpectationMessage) { + self.msg = .prepends(message, child.msg) + } + + public init(appendedMessage message: String, child: NMBExpectationMessage) { + self.msg = .appends(child.msg, message) + } + + public init(prependedMessage message: String, child: NMBExpectationMessage) { + self.msg = .prepends(message, child.msg) + } + + public init(details message: String, child: NMBExpectationMessage) { + self.msg = .details(child.msg, message) + } + + public func appendedBeNilHint() -> NMBExpectationMessage { + return NMBExpectationMessage(swift: msg.appendedBeNilHint()) + } + + public func toSwift() -> ExpectationMessage { return self.msg } +} + +extension ExpectationMessage { + func toObjectiveC() -> NMBExpectationMessage { + return NMBExpectationMessage(swift: self) + } +} + +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Expression.swift b/Example/Pods/Nimble/Sources/Nimble/Expression.swift new file mode 100644 index 0000000..dcc42e4 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Expression.swift @@ -0,0 +1,101 @@ +import Foundation + +// Memoizes the given closure, only calling the passed +// closure once; even if repeat calls to the returned closure +internal func memoizedClosure(_ closure: @escaping () throws -> T) -> (Bool) throws -> T { + var cache: T? + return { withoutCaching in + if withoutCaching || cache == nil { + cache = try closure() + } + return cache! + } +} + +/// Expression represents the closure of the value inside expect(...). +/// Expressions are memoized by default. This makes them safe to call +/// evaluate() multiple times without causing a re-evaluation of the underlying +/// closure. +/// +/// @warning Since the closure can be any code, Objective-C code may choose +/// to raise an exception. Currently, Expression does not memoize +/// exception raising. +/// +/// This provides a common consumable API for matchers to utilize to allow +/// Nimble to change internals to how the captured closure is managed. +public struct Expression { + // swiftlint:disable identifier_name + internal let _expression: (Bool) throws -> T? + internal let _withoutCaching: Bool + // swiftlint:enable identifier_name + public let location: SourceLocation + public let isClosure: Bool + + /// Creates a new expression struct. Normally, expect(...) will manage this + /// creation process. The expression is memoized. + /// + /// @param expression The closure that produces a given value. + /// @param location The source location that this closure originates from. + /// @param isClosure A bool indicating if the captured expression is a + /// closure or internally produced closure. Some matchers + /// may require closures. For example, toEventually() + /// requires an explicit closure. This gives Nimble + /// flexibility if @autoclosure behavior changes between + /// Swift versions. Nimble internals always sets this true. + public init(expression: @escaping () throws -> T?, location: SourceLocation, isClosure: Bool = true) { + self._expression = memoizedClosure(expression) + self.location = location + self._withoutCaching = false + self.isClosure = isClosure + } + + /// Creates a new expression struct. Normally, expect(...) will manage this + /// creation process. + /// + /// @param expression The closure that produces a given value. + /// @param location The source location that this closure originates from. + /// @param withoutCaching Indicates if the struct should memoize the given + /// closure's result. Subsequent evaluate() calls will + /// not call the given closure if this is true. + /// @param isClosure A bool indicating if the captured expression is a + /// closure or internally produced closure. Some matchers + /// may require closures. For example, toEventually() + /// requires an explicit closure. This gives Nimble + /// flexibility if @autoclosure behavior changes between + /// Swift versions. Nimble internals always sets this true. + public init(memoizedExpression: @escaping (Bool) throws -> T?, location: SourceLocation, withoutCaching: Bool, isClosure: Bool = true) { + self._expression = memoizedExpression + self.location = location + self._withoutCaching = withoutCaching + self.isClosure = isClosure + } + + /// Returns a new Expression from the given expression. Identical to a map() + /// on this type. This should be used only to typecast the Expression's + /// closure value. + /// + /// The returned expression will preserve location and isClosure. + /// + /// @param block The block that can cast the current Expression value to a + /// new type. + public func cast(_ block: @escaping (T?) throws -> U?) -> Expression { + return Expression( + expression: ({ try block(self.evaluate()) }), + location: self.location, + isClosure: self.isClosure + ) + } + + public func evaluate() throws -> T? { + return try self._expression(_withoutCaching) + } + + public func withoutCaching() -> Expression { + return Expression( + memoizedExpression: self._expression, + location: location, + withoutCaching: true, + isClosure: isClosure + ) + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/FailureMessage.swift b/Example/Pods/Nimble/Sources/Nimble/FailureMessage.swift new file mode 100644 index 0000000..503b540 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/FailureMessage.swift @@ -0,0 +1,93 @@ +import Foundation + +/// Encapsulates the failure message that matchers can report to the end user. +/// +/// This is shared state between Nimble and matchers that mutate this value. +public class FailureMessage: NSObject { + public var expected: String = "expected" + public var actualValue: String? = "" // empty string -> use default; nil -> exclude + public var to: String = "to" + public var postfixMessage: String = "match" + public var postfixActual: String = "" + /// An optional message that will be appended as a new line and provides additional details + /// about the failure. This message will only be visible in the issue navigator / in logs but + /// not directly in the source editor since only a single line is presented there. + public var extendedMessage: String? + public var userDescription: String? + + public var stringValue: String { + get { + if let value = _stringValueOverride { + return value + } else { + return computeStringValue() + } + } + set { + _stringValueOverride = newValue + } + } + + // swiftlint:disable:next identifier_name + internal var _stringValueOverride: String? + internal var hasOverriddenStringValue: Bool { + return _stringValueOverride != nil + } + + public override init() { + } + + public init(stringValue: String) { + _stringValueOverride = stringValue + } + + internal func stripNewlines(_ str: String) -> String { + let whitespaces = CharacterSet.whitespacesAndNewlines + return str + .components(separatedBy: "\n") + .map { line in line.trimmingCharacters(in: whitespaces) } + .joined(separator: "") + } + + internal func computeStringValue() -> String { + var value = "\(expected) \(to) \(postfixMessage)" + if let actualValue = actualValue { + value = "\(expected) \(to) \(postfixMessage), got \(actualValue)\(postfixActual)" + } + value = stripNewlines(value) + + if let extendedMessage = extendedMessage { + value += "\n\(stripNewlines(extendedMessage))" + } + + if let userDescription = userDescription { + return "\(userDescription)\n\(value)" + } + + return value + } + + internal func appendMessage(_ msg: String) { + if hasOverriddenStringValue { + stringValue += "\(msg)" + } else if actualValue != nil { + postfixActual += msg + } else { + postfixMessage += msg + } + } + + internal func appendDetails(_ msg: String) { + if hasOverriddenStringValue { + if let desc = userDescription { + stringValue = "\(desc)\n\(stringValue)" + } + stringValue += "\n\(msg)" + } else { + if let desc = userDescription { + userDescription = desc + } + extendedMessage = msg + } + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/AllPass.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/AllPass.swift new file mode 100644 index 0000000..dbbccb9 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/AllPass.swift @@ -0,0 +1,122 @@ +import Foundation + +public func allPass + (_ passFunc: @escaping (T?) throws -> Bool) -> Predicate + where U: Sequence, T == U.Iterator.Element { + let matcher = Predicate.simpleNilable("pass a condition") { actualExpression in + return PredicateStatus(bool: try passFunc(try actualExpression.evaluate())) + } + return createPredicate(matcher) +} + +public func allPass + (_ passName: String, _ passFunc: @escaping (T?) throws -> Bool) -> Predicate + where U: Sequence, T == U.Iterator.Element { + let matcher = Predicate.simpleNilable(passName) { actualExpression in + return PredicateStatus(bool: try passFunc(try actualExpression.evaluate())) + } + return createPredicate(matcher) +} + +public func allPass(_ elementMatcher: M) -> Predicate + where S: Sequence, M: Matcher, S.Iterator.Element == M.ValueType { + return createPredicate(elementMatcher.predicate) +} + +public func allPass(_ elementPredicate: Predicate) -> Predicate + where S: Sequence { + return createPredicate(elementPredicate) +} + +private func createPredicate(_ elementMatcher: Predicate) -> Predicate + where S: Sequence { + return Predicate { actualExpression in + guard let actualValue = try actualExpression.evaluate() else { + return PredicateResult( + status: .fail, + message: .appends(.expectedTo("all pass"), " (use beNil() to match nils)") + ) + } + + var failure: ExpectationMessage = .expectedTo("all pass") + for currentElement in actualValue { + let exp = Expression( + expression: {currentElement}, location: actualExpression.location) + let predicateResult = try elementMatcher.satisfies(exp) + if predicateResult.status == .matches { + failure = predicateResult.message.prepended(expectation: "all ") + } else { + failure = predicateResult.message + .replacedExpectation({ .expectedTo($0.expectedMessage) }) + .wrappedExpectation( + before: "all ", + after: ", but failed first at element <\(stringify(currentElement))>" + + " in <\(stringify(actualValue))>" + ) + return PredicateResult(status: .doesNotMatch, message: failure) + } + } + failure = failure.replacedExpectation({ expectation in + return .expectedTo(expectation.expectedMessage) + }) + return PredicateResult(status: .matches, message: failure) + } +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func allPassMatcher(_ matcher: NMBMatcher) -> NMBPredicate { + return NMBPredicate { actualExpression in + let location = actualExpression.location + let actualValue = try actualExpression.evaluate() + var nsObjects = [NSObject]() + + var collectionIsUsable = true + if let value = actualValue as? NSFastEnumeration { + var generator = NSFastEnumerationIterator(value) + while let obj = generator.next() { + if let nsObject = obj as? NSObject { + nsObjects.append(nsObject) + } else { + collectionIsUsable = false + break + } + } + } else { + collectionIsUsable = false + } + + if !collectionIsUsable { + return NMBPredicateResult( + status: NMBPredicateStatus.fail, + message: NMBExpectationMessage( + // swiftlint:disable:next line_length + fail: "allPass can only be used with types which implement NSFastEnumeration (NSArray, NSSet, ...), and whose elements subclass NSObject, got <\(actualValue?.description ?? "nil")>" + ) + ) + } + + let expr = Expression(expression: ({ nsObjects }), location: location) + let pred: Predicate<[NSObject]> = createPredicate(Predicate { expr in + if let predicate = matcher as? NMBPredicate { + return predicate.satisfies(({ try expr.evaluate() }), location: expr.location).toSwift() + } else { + let failureMessage = FailureMessage() + let result = matcher.matches( + // swiftlint:disable:next force_try + ({ try! expr.evaluate() }), + failureMessage: failureMessage, + location: expr.location + ) + let expectationMsg = failureMessage.toExpectationMessage() + return PredicateResult( + bool: result, + message: expectationMsg + ) + } + }) + return try pred.satisfies(expr).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/Async.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/Async.swift new file mode 100644 index 0000000..5022fe2 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/Async.swift @@ -0,0 +1,181 @@ +import Foundation + +/// If you are running on a slower machine, it could be useful to increase the default timeout value +/// or slow down poll interval. Default timeout interval is 1, and poll interval is 0.01. +public struct AsyncDefaults { + public static var Timeout: TimeInterval = 1 + public static var PollInterval: TimeInterval = 0.01 +} + +private func async(style: ExpectationStyle, predicate: Predicate, timeout: TimeInterval, poll: TimeInterval, fnName: String) -> Predicate { + return Predicate { actualExpression in + let uncachedExpression = actualExpression.withoutCaching() + let fnName = "expect(...).\(fnName)(...)" + var lastPredicateResult: PredicateResult? + let result = pollBlock( + pollInterval: poll, + timeoutInterval: timeout, + file: actualExpression.location.file, + line: actualExpression.location.line, + fnName: fnName) { + lastPredicateResult = try predicate.satisfies(uncachedExpression) + return lastPredicateResult!.toBoolean(expectation: style) + } + switch result { + case .completed: return lastPredicateResult! + case .timedOut: + let message = lastPredicateResult?.message ?? .fail("timed out before returning a value") + return PredicateResult(status: .fail, message: message) + case let .errorThrown(error): + return PredicateResult(status: .fail, message: .fail("unexpected error thrown: <\(error)>")) + case let .raisedException(exception): + return PredicateResult(status: .fail, message: .fail("unexpected exception raised: \(exception)")) + case .blockedRunLoop: + // swiftlint:disable:next line_length + let message = lastPredicateResult?.message.appended(message: " (timed out, but main run loop was unresponsive).") ?? + .fail("main run loop was unresponsive") + return PredicateResult(status: .fail, message: message) + case .incomplete: + internalError("Reached .incomplete state for \(fnName)(...).") + } + } +} + +private let toEventuallyRequiresClosureError = FailureMessage( + stringValue: """ + expect(...).toEventually(...) requires an explicit closure (eg - expect { ... }.toEventually(...) ) + Swift 1.2 @autoclosure behavior has changed in an incompatible way for Nimble to function + """ +) + +extension Expectation { + /// Tests the actual value using a matcher to match by checking continuously + /// at each pollInterval until the timeout is reached. + /// + /// @discussion + /// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function + /// is executing. Any attempts to touch the run loop may cause non-deterministic behavior. + public func toEventually(_ predicate: Predicate, timeout: TimeInterval = AsyncDefaults.Timeout, pollInterval: TimeInterval = AsyncDefaults.PollInterval, description: String? = nil) { + nimblePrecondition(expression.isClosure, "NimbleInternalError", toEventuallyRequiresClosureError.stringValue) + + let (pass, msg) = execute( + expression, + .toMatch, + async(style: .toMatch, predicate: predicate, timeout: timeout, poll: pollInterval, fnName: "toEventually"), + to: "to eventually", + description: description, + captureExceptions: false + ) + verify(pass, msg) + } + + /// Tests the actual value using a matcher to not match by checking + /// continuously at each pollInterval until the timeout is reached. + /// + /// @discussion + /// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function + /// is executing. Any attempts to touch the run loop may cause non-deterministic behavior. + public func toEventuallyNot(_ predicate: Predicate, timeout: TimeInterval = AsyncDefaults.Timeout, pollInterval: TimeInterval = AsyncDefaults.PollInterval, description: String? = nil) { + nimblePrecondition(expression.isClosure, "NimbleInternalError", toEventuallyRequiresClosureError.stringValue) + + let (pass, msg) = execute( + expression, + .toNotMatch, + async( + style: .toNotMatch, + predicate: predicate, + timeout: timeout, + poll: pollInterval, + fnName: "toEventuallyNot" + ), + to: "to eventually not", + description: description, + captureExceptions: false + ) + verify(pass, msg) + } + + /// Tests the actual value using a matcher to not match by checking + /// continuously at each pollInterval until the timeout is reached. + /// + /// Alias of toEventuallyNot() + /// + /// @discussion + /// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function + /// is executing. Any attempts to touch the run loop may cause non-deterministic behavior. + public func toNotEventually(_ predicate: Predicate, timeout: TimeInterval = AsyncDefaults.Timeout, pollInterval: TimeInterval = AsyncDefaults.PollInterval, description: String? = nil) { + return toEventuallyNot(predicate, timeout: timeout, pollInterval: pollInterval, description: description) + } +} + +// Deprecated +extension Expectation { + /// Tests the actual value using a matcher to match by checking continuously + /// at each pollInterval until the timeout is reached. + /// + /// @discussion + /// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function + /// is executing. Any attempts to touch the run loop may cause non-deterministic behavior. + public func toEventually(_ matcher: U, timeout: TimeInterval = AsyncDefaults.Timeout, pollInterval: TimeInterval = AsyncDefaults.PollInterval, description: String? = nil) + where U: Matcher, U.ValueType == T { + if expression.isClosure { + let (pass, msg) = execute( + expression, + .toMatch, + async( + style: .toMatch, + predicate: matcher.predicate, + timeout: timeout, + poll: pollInterval, + fnName: "toEventually" + ), + to: "to eventually", + description: description, + captureExceptions: false + ) + verify(pass, msg) + } else { + verify(false, toEventuallyRequiresClosureError) + } + } + + /// Tests the actual value using a matcher to not match by checking + /// continuously at each pollInterval until the timeout is reached. + /// + /// @discussion + /// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function + /// is executing. Any attempts to touch the run loop may cause non-deterministic behavior. + public func toEventuallyNot(_ matcher: U, timeout: TimeInterval = AsyncDefaults.Timeout, pollInterval: TimeInterval = AsyncDefaults.PollInterval, description: String? = nil) + where U: Matcher, U.ValueType == T { + if expression.isClosure { + let (pass, msg) = expressionDoesNotMatch( + expression, + matcher: async( + style: .toNotMatch, + predicate: matcher.predicate, + timeout: timeout, + poll: pollInterval, + fnName: "toEventuallyNot" + ), + toNot: "to eventually not", + description: description + ) + verify(pass, msg) + } else { + verify(false, toEventuallyRequiresClosureError) + } + } + + /// Tests the actual value using a matcher to not match by checking + /// continuously at each pollInterval until the timeout is reached. + /// + /// Alias of toEventuallyNot() + /// + /// @discussion + /// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function + /// is executing. Any attempts to touch the run loop may cause non-deterministic behavior. + public func toNotEventually(_ matcher: U, timeout: TimeInterval = AsyncDefaults.Timeout, pollInterval: TimeInterval = AsyncDefaults.PollInterval, description: String? = nil) + where U: Matcher, U.ValueType == T { + return toEventuallyNot(matcher, timeout: timeout, pollInterval: pollInterval, description: description) + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeAKindOf.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeAKindOf.swift new file mode 100644 index 0000000..3a68b09 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeAKindOf.swift @@ -0,0 +1,68 @@ +import Foundation + +private func matcherMessage(forType expectedType: T.Type) -> String { + return "be a kind of \(String(describing: expectedType))" +} +private func matcherMessage(forClass expectedClass: AnyClass) -> String { + return "be a kind of \(String(describing: expectedClass))" +} + +/// A Nimble matcher that succeeds when the actual value is an instance of the given class. +public func beAKindOf(_ expectedType: T.Type) -> Predicate { + return Predicate.define { actualExpression in + let message: ExpectationMessage + + let instance = try actualExpression.evaluate() + guard let validInstance = instance else { + message = .expectedCustomValueTo(matcherMessage(forType: expectedType), "") + return PredicateResult(status: .fail, message: message) + } + message = .expectedCustomValueTo( + "be a kind of \(String(describing: expectedType))", + "<\(String(describing: type(of: validInstance))) instance>" + ) + + return PredicateResult( + bool: validInstance is T, + message: message + ) + } +} + +#if canImport(Darwin) + +/// A Nimble matcher that succeeds when the actual value is an instance of the given class. +/// @see beAnInstanceOf if you want to match against the exact class +public func beAKindOf(_ expectedClass: AnyClass) -> Predicate { + return Predicate.define { actualExpression in + let message: ExpectationMessage + let status: PredicateStatus + + let instance = try actualExpression.evaluate() + if let validInstance = instance { + status = PredicateStatus(bool: instance != nil && instance!.isKind(of: expectedClass)) + message = .expectedCustomValueTo( + matcherMessage(forClass: expectedClass), + "<\(String(describing: type(of: validInstance))) instance>" + ) + } else { + status = .fail + message = .expectedCustomValueTo( + matcherMessage(forClass: expectedClass), + "" + ) + } + + return PredicateResult(status: status, message: message) + } +} + +extension NMBObjCMatcher { + @objc public class func beAKindOfMatcher(_ expected: AnyClass) -> NMBMatcher { + return NMBPredicate { actualExpression in + return try beAKindOf(expected).satisfies(actualExpression).toObjectiveC() + } + } +} + +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeAnInstanceOf.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeAnInstanceOf.swift new file mode 100644 index 0000000..3cef3a7 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeAnInstanceOf.swift @@ -0,0 +1,56 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value is an _exact_ instance of the given class. +public func beAnInstanceOf(_ expectedType: T.Type) -> Predicate { + let errorMessage = "be an instance of \(String(describing: expectedType))" + return Predicate.define { actualExpression in + let instance = try actualExpression.evaluate() + guard let validInstance = instance else { + return PredicateResult( + status: .doesNotMatch, + message: .expectedActualValueTo(errorMessage) + ) + } + + let actualString = "<\(String(describing: type(of: validInstance))) instance>" + + return PredicateResult( + status: PredicateStatus(bool: type(of: validInstance) == expectedType), + message: .expectedCustomValueTo(errorMessage, actualString) + ) + } +} + +/// A Nimble matcher that succeeds when the actual value is an instance of the given class. +/// @see beAKindOf if you want to match against subclasses +public func beAnInstanceOf(_ expectedClass: AnyClass) -> Predicate { + let errorMessage = "be an instance of \(String(describing: expectedClass))" + return Predicate.define { actualExpression in + let instance = try actualExpression.evaluate() + let actualString: String + if let validInstance = instance { + actualString = "<\(String(describing: type(of: validInstance))) instance>" + } else { + actualString = "" + } + #if canImport(Darwin) + let matches = instance != nil && instance!.isMember(of: expectedClass) + #else + let matches = instance != nil && type(of: instance!) == expectedClass + #endif + return PredicateResult( + status: PredicateStatus(bool: matches), + message: .expectedCustomValueTo(errorMessage, actualString) + ) + } +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func beAnInstanceOfMatcher(_ expected: AnyClass) -> NMBMatcher { + return NMBPredicate { actualExpression in + return try beAnInstanceOf(expected).satisfies(actualExpression).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeCloseTo.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeCloseTo.swift new file mode 100644 index 0000000..4396180 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeCloseTo.swift @@ -0,0 +1,149 @@ +import Foundation + +// swiftlint:disable:next identifier_name +public let DefaultDelta = 0.0001 + +internal func isCloseTo(_ actualValue: NMBDoubleConvertible?, + expectedValue: NMBDoubleConvertible, + delta: Double) + -> PredicateResult { + let errorMessage = "be close to <\(stringify(expectedValue))> (within \(stringify(delta)))" + return PredicateResult( + bool: actualValue != nil && + abs(actualValue!.doubleValue - expectedValue.doubleValue) < delta, + message: .expectedCustomValueTo(errorMessage, "<\(stringify(actualValue))>") + ) +} + +/// A Nimble matcher that succeeds when a value is close to another. This is used for floating +/// point values which can have imprecise results when doing arithmetic on them. +/// +/// @see equal +public func beCloseTo(_ expectedValue: Double, within delta: Double = DefaultDelta) -> Predicate { + return Predicate.define { actualExpression in + return isCloseTo(try actualExpression.evaluate(), expectedValue: expectedValue, delta: delta) + } +} + +/// A Nimble matcher that succeeds when a value is close to another. This is used for floating +/// point values which can have imprecise results when doing arithmetic on them. +/// +/// @see equal +public func beCloseTo(_ expectedValue: NMBDoubleConvertible, within delta: Double = DefaultDelta) -> Predicate { + return Predicate.define { actualExpression in + return isCloseTo(try actualExpression.evaluate(), expectedValue: expectedValue, delta: delta) + } +} + +#if canImport(Darwin) +public class NMBObjCBeCloseToMatcher: NSObject, NMBMatcher { + // swiftlint:disable identifier_name + var _expected: NSNumber + var _delta: CDouble + // swiftlint:enable identifier_name + init(expected: NSNumber, within: CDouble) { + _expected = expected + _delta = within + } + + @objc public func matches(_ actualExpression: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool { + let actualBlock: () -> NMBDoubleConvertible? = ({ + return actualExpression() as? NMBDoubleConvertible + }) + let expr = Expression(expression: actualBlock, location: location) + let predicate = beCloseTo(self._expected, within: self._delta) + + do { + let result = try predicate.satisfies(expr) + result.message.update(failureMessage: failureMessage) + return result.toBoolean(expectation: .toMatch) + } catch let error { + failureMessage.stringValue = "unexpected error thrown: <\(error)>" + return false + } + } + + @objc public func doesNotMatch(_ actualExpression: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool { + let actualBlock: () -> NMBDoubleConvertible? = ({ + return actualExpression() as? NMBDoubleConvertible + }) + let expr = Expression(expression: actualBlock, location: location) + let predicate = beCloseTo(self._expected, within: self._delta) + + do { + let result = try predicate.satisfies(expr) + result.message.update(failureMessage: failureMessage) + return result.toBoolean(expectation: .toNotMatch) + } catch let error { + failureMessage.stringValue = "unexpected error thrown: <\(error)>" + return false + } + } + + @objc public var within: (CDouble) -> NMBObjCBeCloseToMatcher { + return { delta in + return NMBObjCBeCloseToMatcher(expected: self._expected, within: delta) + } + } +} + +extension NMBObjCMatcher { + @objc public class func beCloseToMatcher(_ expected: NSNumber, within: CDouble) -> NMBObjCBeCloseToMatcher { + return NMBObjCBeCloseToMatcher(expected: expected, within: within) + } +} +#endif + +public func beCloseTo(_ expectedValues: [Double], within delta: Double = DefaultDelta) -> Predicate<[Double]> { + let errorMessage = "be close to <\(stringify(expectedValues))> (each within \(stringify(delta)))" + return Predicate.simple(errorMessage) { actualExpression in + if let actual = try actualExpression.evaluate() { + if actual.count != expectedValues.count { + return .doesNotMatch + } else { + for (index, actualItem) in actual.enumerated() { + if fabs(actualItem - expectedValues[index]) > delta { + return .doesNotMatch + } + } + return .matches + } + } + return .doesNotMatch + } +} + +// MARK: - Operators + +infix operator ≈ : ComparisonPrecedence + +// swiftlint:disable:next identifier_name +public func ≈(lhs: Expectation<[Double]>, rhs: [Double]) { + lhs.to(beCloseTo(rhs)) +} + +// swiftlint:disable:next identifier_name +public func ≈(lhs: Expectation, rhs: NMBDoubleConvertible) { + lhs.to(beCloseTo(rhs)) +} + +// swiftlint:disable:next identifier_name +public func ≈(lhs: Expectation, rhs: (expected: NMBDoubleConvertible, delta: Double)) { + lhs.to(beCloseTo(rhs.expected, within: rhs.delta)) +} + +public func == (lhs: Expectation, rhs: (expected: NMBDoubleConvertible, delta: Double)) { + lhs.to(beCloseTo(rhs.expected, within: rhs.delta)) +} + +// make this higher precedence than exponents so the Doubles either end aren't pulled in +// unexpectantly +precedencegroup PlusMinusOperatorPrecedence { + higherThan: BitwiseShiftPrecedence +} + +infix operator ± : PlusMinusOperatorPrecedence +// swiftlint:disable:next identifier_name +public func ±(lhs: NMBDoubleConvertible, rhs: Double) -> (expected: NMBDoubleConvertible, delta: Double) { + return (expected: lhs, delta: rhs) +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeEmpty.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeEmpty.swift new file mode 100644 index 0000000..860287f --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeEmpty.swift @@ -0,0 +1,116 @@ +import Foundation + +/// A Nimble matcher that succeeds when a value is "empty". For collections, this +/// means the are no items in that collection. For strings, it is an empty string. +public func beEmpty() -> Predicate { + return Predicate.simple("be empty") { actualExpression in + guard let actual = try actualExpression.evaluate() else { + return .fail + } + var generator = actual.makeIterator() + return PredicateStatus(bool: generator.next() == nil) + } +} + +/// A Nimble matcher that succeeds when a value is "empty". For collections, this +/// means the are no items in that collection. For strings, it is an empty string. +public func beEmpty() -> Predicate { + return Predicate.simple("be empty") { actualExpression in + guard let actual = try actualExpression.evaluate() else { + return .fail + } + return PredicateStatus(bool: actual.isEmpty) + } +} + +/// A Nimble matcher that succeeds when a value is "empty". For collections, this +/// means the are no items in that collection. For strings, it is an empty string. +public func beEmpty() -> Predicate { + return Predicate.simple("be empty") { actualExpression in + guard let actual = try actualExpression.evaluate() else { + return .fail + } + return PredicateStatus(bool: actual.isEmpty) + } +} + +/// A Nimble matcher that succeeds when a value is "empty". For collections, this +/// means the are no items in that collection. For strings, it is an empty string. +public func beEmpty() -> Predicate { + return Predicate.simple("be empty") { actualExpression in + let actualString = try actualExpression.evaluate() + return PredicateStatus(bool: actualString == nil || NSString(string: actualString!).length == 0) + } +} + +/// A Nimble matcher that succeeds when a value is "empty". For collections, this +/// means the are no items in that collection. For NSString instances, it is an empty string. +public func beEmpty() -> Predicate { + return Predicate.simple("be empty") { actualExpression in + let actualString = try actualExpression.evaluate() + return PredicateStatus(bool: actualString == nil || actualString!.length == 0) + } +} + +// Without specific overrides, beEmpty() is ambiguous for NSDictionary, NSArray, +// etc, since they conform to Sequence as well as NMBCollection. + +/// A Nimble matcher that succeeds when a value is "empty". For collections, this +/// means the are no items in that collection. For strings, it is an empty string. +public func beEmpty() -> Predicate { + return Predicate.simple("be empty") { actualExpression in + let actualDictionary = try actualExpression.evaluate() + return PredicateStatus(bool: actualDictionary == nil || actualDictionary!.count == 0) + } +} + +/// A Nimble matcher that succeeds when a value is "empty". For collections, this +/// means the are no items in that collection. For strings, it is an empty string. +public func beEmpty() -> Predicate { + return Predicate.simple("be empty") { actualExpression in + let actualArray = try actualExpression.evaluate() + return PredicateStatus(bool: actualArray == nil || actualArray!.count == 0) + } +} + +/// A Nimble matcher that succeeds when a value is "empty". For collections, this +/// means the are no items in that collection. For strings, it is an empty string. +public func beEmpty() -> Predicate { + return Predicate.simple("be empty") { actualExpression in + let actual = try actualExpression.evaluate() + return PredicateStatus(bool: actual == nil || actual!.count == 0) + } +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func beEmptyMatcher() -> NMBPredicate { + return NMBPredicate { actualExpression in + let location = actualExpression.location + let actualValue = try actualExpression.evaluate() + + if let value = actualValue as? NMBCollection { + let expr = Expression(expression: ({ value as NMBCollection }), location: location) + return try beEmpty().satisfies(expr).toObjectiveC() + } else if let value = actualValue as? NSString { + let expr = Expression(expression: ({ value as String }), location: location) + return try beEmpty().satisfies(expr).toObjectiveC() + } else if let actualValue = actualValue { + // swiftlint:disable:next line_length + let badTypeErrorMsg = "be empty (only works for NSArrays, NSSets, NSIndexSets, NSDictionaries, NSHashTables, and NSStrings)" + return NMBPredicateResult( + status: NMBPredicateStatus.fail, + message: NMBExpectationMessage( + expectedActualValueTo: badTypeErrorMsg, + customActualValue: "\(String(describing: type(of: actualValue))) type" + ) + ) + } + return NMBPredicateResult( + status: NMBPredicateStatus.fail, + message: NMBExpectationMessage(expectedActualValueTo: "be empty").appendedBeNilHint() + ) + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThan.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThan.swift new file mode 100644 index 0000000..782c771 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThan.swift @@ -0,0 +1,44 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value is greater than the expected value. +public func beGreaterThan(_ expectedValue: T?) -> Predicate { + let errorMessage = "be greater than <\(stringify(expectedValue))>" + return Predicate.simple(errorMessage) { actualExpression in + if let actual = try actualExpression.evaluate(), let expected = expectedValue { + return PredicateStatus(bool: actual > expected) + } + return .fail + } +} + +public func >(lhs: Expectation, rhs: T) { + lhs.to(beGreaterThan(rhs)) +} + +#if canImport(Darwin) || !compiler(>=5.1) +/// A Nimble matcher that succeeds when the actual value is greater than the expected value. +public func beGreaterThan(_ expectedValue: NMBComparable?) -> Predicate { + let errorMessage = "be greater than <\(stringify(expectedValue))>" + return Predicate.simple(errorMessage) { actualExpression in + let actualValue = try actualExpression.evaluate() + let matches = actualValue != nil + && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedDescending + return PredicateStatus(bool: matches) + } +} + +public func > (lhs: Expectation, rhs: NMBComparable?) { + lhs.to(beGreaterThan(rhs)) +} +#endif + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func beGreaterThanMatcher(_ expected: NMBComparable?) -> NMBMatcher { + return NMBPredicate { actualExpression in + let expr = actualExpression.cast { $0 as? NMBComparable } + return try beGreaterThan(expected).satisfies(expr).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift new file mode 100644 index 0000000..c3fc523 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift @@ -0,0 +1,46 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value is greater than +/// or equal to the expected value. +public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> Predicate { + let message = "be greater than or equal to <\(stringify(expectedValue))>" + return Predicate.simple(message) { actualExpression in + let actualValue = try actualExpression.evaluate() + if let actual = actualValue, let expected = expectedValue { + return PredicateStatus(bool: actual >= expected) + } + return .fail + } +} + +public func >=(lhs: Expectation, rhs: T) { + lhs.to(beGreaterThanOrEqualTo(rhs)) +} + +#if canImport(Darwin) || !compiler(>=5.1) +/// A Nimble matcher that succeeds when the actual value is greater than +/// or equal to the expected value. +public func beGreaterThanOrEqualTo(_ expectedValue: T?) -> Predicate { + let message = "be greater than or equal to <\(stringify(expectedValue))>" + return Predicate.simple(message) { actualExpression in + let actualValue = try actualExpression.evaluate() + let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) != ComparisonResult.orderedAscending + return PredicateStatus(bool: matches) + } +} + +public func >=(lhs: Expectation, rhs: T) { + lhs.to(beGreaterThanOrEqualTo(rhs)) +} +#endif + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func beGreaterThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBMatcher { + return NMBPredicate { actualExpression in + let expr = actualExpression.cast { $0 as? NMBComparable } + return try beGreaterThanOrEqualTo(expected).satisfies(expr).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeIdenticalTo.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeIdenticalTo.swift new file mode 100644 index 0000000..7644b4c --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeIdenticalTo.swift @@ -0,0 +1,44 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value is the same instance +/// as the expected instance. +public func beIdenticalTo(_ expected: Any?) -> Predicate { + return Predicate.define { actualExpression in + let actual = try actualExpression.evaluate() as AnyObject? + + let bool = actual === (expected as AnyObject?) && actual !== nil + return PredicateResult( + bool: bool, + message: .expectedCustomValueTo( + "be identical to \(identityAsString(expected))", + "\(identityAsString(actual))" + ) + ) + } +} + +public func === (lhs: Expectation, rhs: Any?) { + lhs.to(beIdenticalTo(rhs)) +} +public func !== (lhs: Expectation, rhs: Any?) { + lhs.toNot(beIdenticalTo(rhs)) +} + +/// A Nimble matcher that succeeds when the actual value is the same instance +/// as the expected instance. +/// +/// Alias for "beIdenticalTo". +public func be(_ expected: Any?) -> Predicate { + return beIdenticalTo(expected) +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func beIdenticalToMatcher(_ expected: NSObject?) -> NMBMatcher { + return NMBPredicate { actualExpression in + let aExpr = actualExpression.cast { $0 as Any? } + return try beIdenticalTo(expected).satisfies(aExpr).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLessThan.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLessThan.swift new file mode 100644 index 0000000..12fc9c2 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLessThan.swift @@ -0,0 +1,43 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value is less than the expected value. +public func beLessThan(_ expectedValue: T?) -> Predicate { + let message = "be less than <\(stringify(expectedValue))>" + return Predicate.simple(message) { actualExpression in + if let actual = try actualExpression.evaluate(), let expected = expectedValue { + return PredicateStatus(bool: actual < expected) + } + return .fail + } +} + +public func <(lhs: Expectation, rhs: T) { + lhs.to(beLessThan(rhs)) +} + +#if canImport(Darwin) || !compiler(>=5.1) +/// A Nimble matcher that succeeds when the actual value is less than the expected value. +public func beLessThan(_ expectedValue: NMBComparable?) -> Predicate { + let message = "be less than <\(stringify(expectedValue))>" + return Predicate.simple(message) { actualExpression in + let actualValue = try actualExpression.evaluate() + let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == ComparisonResult.orderedAscending + return PredicateStatus(bool: matches) + } +} + +public func < (lhs: Expectation, rhs: NMBComparable?) { + lhs.to(beLessThan(rhs)) +} +#endif + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func beLessThanMatcher(_ expected: NMBComparable?) -> NMBMatcher { + return NMBPredicate { actualExpression in + let expr = actualExpression.cast { $0 as? NMBComparable } + return try beLessThan(expected).satisfies(expr).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLessThanOrEqual.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLessThanOrEqual.swift new file mode 100644 index 0000000..bf6ba16 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLessThanOrEqual.swift @@ -0,0 +1,43 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value is less than +/// or equal to the expected value. +public func beLessThanOrEqualTo(_ expectedValue: T?) -> Predicate { + return Predicate.simple("be less than or equal to <\(stringify(expectedValue))>") { actualExpression in + if let actual = try actualExpression.evaluate(), let expected = expectedValue { + return PredicateStatus(bool: actual <= expected) + } + return .fail + } +} + +public func <=(lhs: Expectation, rhs: T) { + lhs.to(beLessThanOrEqualTo(rhs)) +} + +#if canImport(Darwin) || !compiler(>=5.1) +/// A Nimble matcher that succeeds when the actual value is less than +/// or equal to the expected value. +public func beLessThanOrEqualTo(_ expectedValue: T?) -> Predicate { + return Predicate.simple("be less than or equal to <\(stringify(expectedValue))>") { actualExpression in + let actualValue = try actualExpression.evaluate() + let matches = actualValue.map { $0.NMB_compare(expectedValue) != .orderedDescending } ?? false + return PredicateStatus(bool: matches) + } +} + +public func <=(lhs: Expectation, rhs: T) { + lhs.to(beLessThanOrEqualTo(rhs)) +} +#endif + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func beLessThanOrEqualToMatcher(_ expected: NMBComparable?) -> NMBMatcher { + return NMBPredicate { actualExpression in + let expr = actualExpression.cast { $0 as? NMBComparable } + return try beLessThanOrEqualTo(expected).satisfies(expr).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLogical.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLogical.swift new file mode 100644 index 0000000..788234b --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeLogical.swift @@ -0,0 +1,154 @@ +import Foundation + +extension Int8: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).int8Value + } +} + +extension UInt8: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).uint8Value + } +} + +extension Int16: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).int16Value + } +} + +extension UInt16: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).uint16Value + } +} + +extension Int32: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).int32Value + } +} + +extension UInt32: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).uint32Value + } +} + +extension Int64: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).int64Value + } +} + +extension UInt64: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).uint64Value + } +} + +extension Float: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).floatValue + } +} + +extension Double: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).doubleValue + } +} + +extension Int: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).intValue + } +} + +extension UInt: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = NSNumber(value: value).uintValue + } +} + +internal func rename(_ matcher: Predicate, failureMessage message: ExpectationMessage) -> Predicate { + return Predicate { actualExpression in + let result = try matcher.satisfies(actualExpression) + return PredicateResult(status: result.status, message: message) + }.requireNonNil +} + +// MARK: beTrue() / beFalse() + +/// A Nimble matcher that succeeds when the actual value is exactly true. +/// This matcher will not match against nils. +public func beTrue() -> Predicate { + return rename(equal(true), failureMessage: .expectedActualValueTo("be true")) +} + +/// A Nimble matcher that succeeds when the actual value is exactly false. +/// This matcher will not match against nils. +public func beFalse() -> Predicate { + return rename(equal(false), failureMessage: .expectedActualValueTo("be false")) +} + +// MARK: beTruthy() / beFalsy() + +/// A Nimble matcher that succeeds when the actual value is not logically false. +public func beTruthy() -> Predicate { + return Predicate.simpleNilable("be truthy") { actualExpression in + let actualValue = try actualExpression.evaluate() + if let actualValue = actualValue { + return PredicateStatus(bool: actualValue == (true as T)) + } + return PredicateStatus(bool: actualValue != nil) + } +} + +/// A Nimble matcher that succeeds when the actual value is logically false. +/// This matcher will match against nils. +public func beFalsy() -> Predicate { + return Predicate.simpleNilable("be falsy") { actualExpression in + let actualValue = try actualExpression.evaluate() + if let actualValue = actualValue { + return PredicateStatus(bool: actualValue == (false as T)) + } + return PredicateStatus(bool: actualValue == nil) + } +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func beTruthyMatcher() -> NMBMatcher { + return NMBPredicate { actualExpression in + let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false } + return try beTruthy().satisfies(expr).toObjectiveC() + } + } + + @objc public class func beFalsyMatcher() -> NMBMatcher { + return NMBPredicate { actualExpression in + let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false } + return try beFalsy().satisfies(expr).toObjectiveC() + } + } + + @objc public class func beTrueMatcher() -> NMBMatcher { + return NMBPredicate { actualExpression in + let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false } + return try beTrue().satisfies(expr).toObjectiveC() + } + } + + @objc public class func beFalseMatcher() -> NMBMatcher { + return NMBPredicate { actualExpression in + let expr = actualExpression.cast { value -> Bool? in + guard let value = value else { return nil } + return (value as? NSNumber)?.boolValue ?? false + } + return try beFalse().satisfies(expr).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeNil.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeNil.swift new file mode 100644 index 0000000..0f21d41 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeNil.swift @@ -0,0 +1,19 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value is nil. +public func beNil() -> Predicate { + return Predicate.simpleNilable("be nil") { actualExpression in + let actualValue = try actualExpression.evaluate() + return PredicateStatus(bool: actualValue == nil) + } +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func beNilMatcher() -> NMBMatcher { + return NMBPredicate { actualExpression in + return try beNil().satisfies(actualExpression).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeVoid.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeVoid.swift new file mode 100644 index 0000000..9a7eafd --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeVoid.swift @@ -0,0 +1,19 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value is Void. +public func beVoid() -> Predicate<()> { + return Predicate.simpleNilable("be void") { actualExpression in + let actualValue: ()? = try actualExpression.evaluate() + return PredicateStatus(bool: actualValue != nil) + } +} + +extension Expectation where T == () { + public static func == (lhs: Expectation<()>, rhs: ()) { + lhs.to(beVoid()) + } + + public static func != (lhs: Expectation<()>, rhs: ()) { + lhs.toNot(beVoid()) + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/BeginWith.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeginWith.swift new file mode 100644 index 0000000..3183eb9 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/BeginWith.swift @@ -0,0 +1,60 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual sequence's first element +/// is equal to the expected value. +public func beginWith(_ startingElement: T) -> Predicate + where S.Iterator.Element == T { + return Predicate.simple("begin with <\(startingElement)>") { actualExpression in + if let actualValue = try actualExpression.evaluate() { + var actualGenerator = actualValue.makeIterator() + return PredicateStatus(bool: actualGenerator.next() == startingElement) + } + return .fail + } +} + +/// A Nimble matcher that succeeds when the actual collection's first element +/// is equal to the expected object. +public func beginWith(_ startingElement: Any) -> Predicate { + return Predicate.simple("begin with <\(startingElement)>") { actualExpression in + guard let collection = try actualExpression.evaluate() else { return .fail } + guard collection.count > 0 else { return .doesNotMatch } + #if os(Linux) + guard let collectionValue = collection.object(at: 0) as? NSObject else { + return .fail + } + #else + let collectionValue = collection.object(at: 0) as AnyObject + #endif + return PredicateStatus(bool: collectionValue.isEqual(startingElement)) + } +} + +/// A Nimble matcher that succeeds when the actual string contains expected substring +/// where the expected substring's location is zero. +public func beginWith(_ startingSubstring: String) -> Predicate { + return Predicate.simple("begin with <\(startingSubstring)>") { actualExpression in + if let actual = try actualExpression.evaluate() { + return PredicateStatus(bool: actual.hasPrefix(startingSubstring)) + } + return .fail + } +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func beginWithMatcher(_ expected: Any) -> NMBMatcher { + return NMBPredicate { actualExpression in + let actual = try actualExpression.evaluate() + if actual is String { + let expr = actualExpression.cast { $0 as? String } + // swiftlint:disable:next force_cast + return try beginWith(expected as! String).satisfies(expr).toObjectiveC() + } else { + let expr = actualExpression.cast { $0 as? NMBOrderedCollection } + return try beginWith(expected).satisfies(expr).toObjectiveC() + } + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/Contain.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/Contain.swift new file mode 100644 index 0000000..6974a4d --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/Contain.swift @@ -0,0 +1,144 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual sequence contains the expected values. +public func contain(_ items: T...) -> Predicate + where S.Element == T { + return contain(items) +} + +/// A Nimble matcher that succeeds when the actual sequence contains the expected values. +public func contain(_ items: [T]) -> Predicate + where S.Element == T { + return Predicate.simple("contain <\(arrayAsString(items))>") { actualExpression in + if let actual = try actualExpression.evaluate() { + let matches = items.allSatisfy { + return actual.contains($0) + } + return PredicateStatus(bool: matches) + } + return .fail + } +} + +/// A Nimble matcher that succeeds when the actual set contains the expected values. +public func contain(_ items: T...) -> Predicate + where S.Element == T { + return contain(items) +} + +/// A Nimble matcher that succeeds when the actual set contains the expected values. +public func contain(_ items: [T]) -> Predicate + where S.Element == T { + return Predicate.simple("contain <\(arrayAsString(items))>") { actualExpression in + if let actual = try actualExpression.evaluate() { + let matches = items.allSatisfy { + return actual.contains($0) + } + return PredicateStatus(bool: matches) + } + return .fail + } +} + +/// A Nimble matcher that succeeds when the actual set contains the expected values. +public func contain(_ items: T...) -> Predicate + where S.Element == T { + return contain(items) +} + +/// A Nimble matcher that succeeds when the actual set contains the expected values. +public func contain(_ items: [T]) -> Predicate + where S.Element == T { + return Predicate.simple("contain <\(arrayAsString(items))>") { actualExpression in + if let actual = try actualExpression.evaluate() { + let matches = items.allSatisfy { + return actual.contains($0) + } + return PredicateStatus(bool: matches) + } + return .fail + } +} + +/// A Nimble matcher that succeeds when the actual string contains the expected substring. +public func contain(_ substrings: String...) -> Predicate { + return contain(substrings) +} + +public func contain(_ substrings: [String]) -> Predicate { + return Predicate.simple("contain <\(arrayAsString(substrings))>") { actualExpression in + if let actual = try actualExpression.evaluate() { + let matches = substrings.allSatisfy { + let range = actual.range(of: $0) + return range != nil && !range!.isEmpty + } + return PredicateStatus(bool: matches) + } + return .fail + } +} + +/// A Nimble matcher that succeeds when the actual string contains the expected substring. +public func contain(_ substrings: NSString...) -> Predicate { + return contain(substrings) +} + +public func contain(_ substrings: [NSString]) -> Predicate { + return Predicate.simple("contain <\(arrayAsString(substrings))>") { actualExpression in + if let actual = try actualExpression.evaluate() { + let matches = substrings.allSatisfy { actual.range(of: $0.description).length != 0 } + return PredicateStatus(bool: matches) + } + return .fail + } +} + +/// A Nimble matcher that succeeds when the actual collection contains the expected object. +public func contain(_ items: Any?...) -> Predicate { + return contain(items) +} + +public func contain(_ items: [Any?]) -> Predicate { + return Predicate.simple("contain <\(arrayAsString(items))>") { actualExpression in + guard let actual = try actualExpression.evaluate() else { return .fail } + let matches = items.allSatisfy { item in + return item.map { actual.contains($0) } ?? false + } + return PredicateStatus(bool: matches) + } +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func containMatcher(_ expected: [NSObject]) -> NMBMatcher { + return NMBPredicate { actualExpression in + let location = actualExpression.location + let actualValue = try actualExpression.evaluate() + if let value = actualValue as? NMBContainer { + let expr = Expression(expression: ({ value as NMBContainer }), location: location) + + // A straightforward cast on the array causes this to crash, so we have to cast the individual items + let expectedOptionals: [Any?] = expected.map({ $0 as Any? }) + return try contain(expectedOptionals).satisfies(expr).toObjectiveC() + } else if let value = actualValue as? NSString { + let expr = Expression(expression: ({ value as String }), location: location) + // swiftlint:disable:next force_cast + return try contain(expected as! [String]).satisfies(expr).toObjectiveC() + } + + let message: ExpectationMessage + if actualValue != nil { + message = ExpectationMessage.expectedActualValueTo( + // swiftlint:disable:next line_length + "contain <\(arrayAsString(expected))> (only works for NSArrays, NSSets, NSHashTables, and NSStrings)" + ) + } else { + message = ExpectationMessage + .expectedActualValueTo("contain <\(arrayAsString(expected))>") + .appendedBeNilHint() + } + return NMBPredicateResult(status: .fail, message: message.toObjectiveC()) + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/ContainElementSatisfying.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/ContainElementSatisfying.swift new file mode 100644 index 0000000..331f3bc --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/ContainElementSatisfying.swift @@ -0,0 +1,58 @@ +import Foundation + +public func containElementSatisfying(_ predicate: @escaping ((T) -> Bool), _ predicateDescription: String = "") -> Predicate where S.Iterator.Element == T { + + return Predicate.define { actualExpression in + let message: ExpectationMessage + if predicateDescription == "" { + message = .expectedTo("find object in collection that satisfies predicate") + } else { + message = .expectedTo("find object in collection \(predicateDescription)") + } + + if let sequence = try actualExpression.evaluate() { + for object in sequence { + if predicate(object) { + return PredicateResult(bool: true, message: message) + } + } + + return PredicateResult(bool: false, message: message) + } + + return PredicateResult(status: .fail, message: message) + } +} + +#if canImport(Darwin) + extension NMBObjCMatcher { + @objc public class func containElementSatisfyingMatcher(_ predicate: @escaping ((NSObject) -> Bool)) -> NMBMatcher { + return NMBPredicate { actualExpression in + let value = try actualExpression.evaluate() + guard let enumeration = value as? NSFastEnumeration else { + let message = ExpectationMessage.fail( + "containElementSatisfying must be provided an NSFastEnumeration object" + ) + return NMBPredicateResult(status: .fail, message: message.toObjectiveC()) + } + + let message = ExpectationMessage + .expectedTo("find object in collection that satisfies predicate") + .toObjectiveC() + + var iterator = NSFastEnumerationIterator(enumeration) + while let item = iterator.next() { + guard let object = item as? NSObject else { + continue + } + + if predicate(object) { + return NMBPredicateResult(status: .matches, message: message) + } + } + + return NMBPredicateResult(status: .doesNotMatch, message: message) + } + } + } +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/ElementsEqual.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/ElementsEqual.swift new file mode 100644 index 0000000..1704e94 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/ElementsEqual.swift @@ -0,0 +1,16 @@ +/// A Nimble matcher that succeeds when the actual sequence contain the same elements in the same order to the exepected sequence. +public func elementsEqual(_ expectedValue: S?) -> Predicate where S.Element: Equatable { + // A matcher abstraction for https://developer.apple.com/documentation/swift/sequence/2949668-elementsequal + return Predicate.define("elementsEqual <\(stringify(expectedValue))>") { (actualExpression, msg) in + let actualValue = try actualExpression.evaluate() + switch (expectedValue, actualValue) { + case (nil, _?): + return PredicateResult(status: .fail, message: msg.appendedBeNilHint()) + case (nil, nil), (_, nil): + return PredicateResult(status: .fail, message: msg) + case (let expected?, let actual?): + let matches = expected.elementsEqual(actual) + return PredicateResult(bool: matches, message: msg) + } + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/EndWith.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/EndWith.swift new file mode 100644 index 0000000..13bdb31 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/EndWith.swift @@ -0,0 +1,69 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual sequence's last element +/// is equal to the expected value. +public func endWith(_ endingElement: T) -> Predicate + where S.Iterator.Element == T { + return Predicate.simple("end with <\(endingElement)>") { actualExpression in + if let actualValue = try actualExpression.evaluate() { + var actualGenerator = actualValue.makeIterator() + var lastItem: T? + var item: T? + repeat { + lastItem = item + item = actualGenerator.next() + } while(item != nil) + + return PredicateStatus(bool: lastItem == endingElement) + } + return .fail + } +} + +/// A Nimble matcher that succeeds when the actual collection's last element +/// is equal to the expected object. +public func endWith(_ endingElement: Any) -> Predicate { + return Predicate.simple("end with <\(endingElement)>") { actualExpression in + guard let collection = try actualExpression.evaluate() else { return .fail } + guard collection.count > 0 else { return PredicateStatus(bool: false) } + #if os(Linux) + guard let collectionValue = collection.object(at: collection.count - 1) as? NSObject else { + return .fail + } + #else + let collectionValue = collection.object(at: collection.count - 1) as AnyObject + #endif + + return PredicateStatus(bool: collectionValue.isEqual(endingElement)) + } +} + +/// A Nimble matcher that succeeds when the actual string contains the expected substring +/// where the expected substring's location is the actual string's length minus the +/// expected substring's length. +public func endWith(_ endingSubstring: String) -> Predicate { + return Predicate.simple("end with <\(endingSubstring)>") { actualExpression in + if let collection = try actualExpression.evaluate() { + return PredicateStatus(bool: collection.hasSuffix(endingSubstring)) + } + return .fail + } +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func endWithMatcher(_ expected: Any) -> NMBMatcher { + return NMBPredicate { actualExpression in + let actual = try actualExpression.evaluate() + if actual is String { + let expr = actualExpression.cast { $0 as? String } + // swiftlint:disable:next force_cast + return try endWith(expected as! String).satisfies(expr).toObjectiveC() + } else { + let expr = actualExpression.cast { $0 as? NMBOrderedCollection } + return try endWith(expected).satisfies(expr).toObjectiveC() + } + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/Equal.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/Equal.swift new file mode 100644 index 0000000..b08d5f6 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/Equal.swift @@ -0,0 +1,148 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value is equal to the expected value. +/// Values can support equal by supporting the Equatable protocol. +/// +/// @see beCloseTo if you want to match imprecise types (eg - floats, doubles). +public func equal(_ expectedValue: T?) -> Predicate { + return Predicate.define("equal <\(stringify(expectedValue))>") { actualExpression, msg in + let actualValue = try actualExpression.evaluate() + switch (expectedValue, actualValue) { + case (nil, _?): + return PredicateResult(status: .fail, message: msg.appendedBeNilHint()) + case (nil, nil), (_, nil): + return PredicateResult(status: .fail, message: msg) + case (let expected?, let actual?): + let matches = expected == actual + return PredicateResult(bool: matches, message: msg) + } + } +} + +/// A Nimble matcher allowing comparison of collection with optional type +public func equal(_ expectedValue: [T?]) -> Predicate<[T?]> { + return Predicate.define("equal <\(stringify(expectedValue))>") { actualExpression, msg in + guard let actualValue = try actualExpression.evaluate() else { + return PredicateResult( + status: .fail, + message: msg.appendedBeNilHint() + ) + } + + let matches = expectedValue == actualValue + return PredicateResult(bool: matches, message: msg) + } +} + +/// A Nimble matcher that succeeds when the actual set is equal to the expected set. +public func equal(_ expectedValue: Set?) -> Predicate> { + return equal(expectedValue, stringify: { stringify($0) }) +} + +/// A Nimble matcher that succeeds when the actual set is equal to the expected set. +public func equal(_ expectedValue: Set?) -> Predicate> { + return equal(expectedValue, stringify: { + if let set = $0 { + return stringify(Array(set).sorted { $0 < $1 }) + } else { + return "nil" + } + }) +} + +private func equal(_ expectedValue: Set?, stringify: @escaping (Set?) -> String) -> Predicate> { + return Predicate { actualExpression in + var errorMessage: ExpectationMessage = + .expectedActualValueTo("equal <\(stringify(expectedValue))>") + + guard let expectedValue = expectedValue else { + return PredicateResult( + status: .fail, + message: errorMessage.appendedBeNilHint() + ) + } + + guard let actualValue = try actualExpression.evaluate() else { + return PredicateResult( + status: .fail, + message: errorMessage.appendedBeNilHint() + ) + } + + errorMessage = .expectedCustomValueTo( + "equal <\(stringify(expectedValue))>", + "<\(stringify(actualValue))>" + ) + + if expectedValue == actualValue { + return PredicateResult( + status: .matches, + message: errorMessage + ) + } + + let missing = expectedValue.subtracting(actualValue) + if missing.count > 0 { + errorMessage = errorMessage.appended(message: ", missing <\(stringify(missing))>") + } + + let extra = actualValue.subtracting(expectedValue) + if extra.count > 0 { + errorMessage = errorMessage.appended(message: ", extra <\(stringify(extra))>") + } + return PredicateResult( + status: .doesNotMatch, + message: errorMessage + ) + } +} + +public func ==(lhs: Expectation, rhs: T?) { + lhs.to(equal(rhs)) +} + +public func !=(lhs: Expectation, rhs: T?) { + lhs.toNot(equal(rhs)) +} + +public func ==(lhs: Expectation<[T]>, rhs: [T]?) { + lhs.to(equal(rhs)) +} + +public func !=(lhs: Expectation<[T]>, rhs: [T]?) { + lhs.toNot(equal(rhs)) +} + +public func == (lhs: Expectation>, rhs: Set?) { + lhs.to(equal(rhs)) +} + +public func != (lhs: Expectation>, rhs: Set?) { + lhs.toNot(equal(rhs)) +} + +public func ==(lhs: Expectation>, rhs: Set?) { + lhs.to(equal(rhs)) +} + +public func !=(lhs: Expectation>, rhs: Set?) { + lhs.toNot(equal(rhs)) +} + +public func ==(lhs: Expectation<[T: C]>, rhs: [T: C]?) { + lhs.to(equal(rhs)) +} + +public func !=(lhs: Expectation<[T: C]>, rhs: [T: C]?) { + lhs.toNot(equal(rhs)) +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func equalMatcher(_ expected: NSObject) -> NMBMatcher { + return NMBPredicate { actualExpression in + return try equal(expected).satisfies(actualExpression).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/HaveCount.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/HaveCount.swift new file mode 100644 index 0000000..984e2d4 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/HaveCount.swift @@ -0,0 +1,74 @@ +import Foundation + +// The `haveCount` matchers do not print the full string representation of the collection value, +// instead they only print the type name and the expected count. This makes it easier to understand +// the reason for failed expectations. See: https://github.com/Quick/Nimble/issues/308. +// The representation of the collection content is provided in a new line as an `extendedMessage`. + +/// A Nimble matcher that succeeds when the actual Collection's count equals +/// the expected value +public func haveCount(_ expectedValue: Int) -> Predicate { + return Predicate.define { actualExpression in + if let actualValue = try actualExpression.evaluate() { + let message = ExpectationMessage + .expectedCustomValueTo( + "have \(prettyCollectionType(actualValue)) with count \(stringify(expectedValue))", + "\(actualValue.count)" + ) + .appended(details: "Actual Value: \(stringify(actualValue))") + + let result = expectedValue == actualValue.count + return PredicateResult(bool: result, message: message) + } else { + return PredicateResult(status: .fail, message: .fail("")) + } + } +} + +/// A Nimble matcher that succeeds when the actual collection's count equals +/// the expected value +public func haveCount(_ expectedValue: Int) -> Predicate { + return Predicate { actualExpression in + if let actualValue = try actualExpression.evaluate() { + let message = ExpectationMessage + .expectedCustomValueTo( + "have \(prettyCollectionType(actualValue)) with count \(stringify(expectedValue))", + "\(actualValue.count)" + ) + .appended(details: "Actual Value: \(stringify(actualValue))") + + let result = expectedValue == actualValue.count + return PredicateResult(bool: result, message: message) + } else { + return PredicateResult(status: .fail, message: .fail("")) + } + } +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func haveCountMatcher(_ expected: NSNumber) -> NMBMatcher { + return NMBPredicate { actualExpression in + let location = actualExpression.location + let actualValue = try actualExpression.evaluate() + if let value = actualValue as? NMBCollection { + let expr = Expression(expression: ({ value as NMBCollection}), location: location) + return try haveCount(expected.intValue).satisfies(expr).toObjectiveC() + } + + let message: ExpectationMessage + if let actualValue = actualValue { + message = ExpectationMessage.expectedCustomValueTo( + "get type of NSArray, NSSet, NSDictionary, or NSHashTable", + "\(String(describing: type(of: actualValue)))" + ) + } else { + message = ExpectationMessage + .expectedActualValueTo("have a collection with count \(stringify(expected.intValue))") + .appendedBeNilHint() + } + return NMBPredicateResult(status: .fail, message: message.toObjectiveC()) + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/Match.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/Match.swift new file mode 100644 index 0000000..dbcff09 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/Match.swift @@ -0,0 +1,29 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual string satisfies the regular expression +/// described by the expected string. +public func match(_ expectedValue: String?) -> Predicate { + return Predicate.simple("match <\(stringify(expectedValue))>") { actualExpression in + if let actual = try actualExpression.evaluate() { + if let regexp = expectedValue { + let bool = actual.range(of: regexp, options: .regularExpression) != nil + return PredicateStatus(bool: bool) + } + } + + return .fail + } +} + +#if canImport(Darwin) + +extension NMBObjCMatcher { + @objc public class func matchMatcher(_ expected: NSString) -> NMBMatcher { + return NMBPredicate { actualExpression in + let actual = actualExpression.cast { $0 as? String } + return try match(expected.description).satisfies(actual).toObjectiveC() + } + } +} + +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/MatchError.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/MatchError.swift new file mode 100644 index 0000000..4ad71d4 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/MatchError.swift @@ -0,0 +1,76 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual expression evaluates to an +/// error from the specified case. +/// +/// Errors are tried to be compared by their implementation of Equatable, +/// otherwise they fallback to comparison by _domain and _code. +public func matchError(_ error: T) -> Predicate { + return Predicate.define { actualExpression in + let actualError = try actualExpression.evaluate() + + let failureMessage = FailureMessage() + setFailureMessageForError( + failureMessage, + postfixMessageVerb: "match", + actualError: actualError, + error: error + ) + + var matches = false + if let actualError = actualError, errorMatchesExpectedError(actualError, expectedError: error) { + matches = true + } + + return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) + } +} + +/// A Nimble matcher that succeeds when the actual expression evaluates to an +/// error from the specified case. +/// +/// Errors are tried to be compared by their implementation of Equatable, +/// otherwise they fallback to comparision by _domain and _code. +public func matchError(_ error: T) -> Predicate { + return Predicate.define { actualExpression in + let actualError = try actualExpression.evaluate() + + let failureMessage = FailureMessage() + setFailureMessageForError( + failureMessage, + postfixMessageVerb: "match", + actualError: actualError, + error: error + ) + + var matches = false + if let actualError = actualError as? T, error == actualError { + matches = true + } + + return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) + } +} + +/// A Nimble matcher that succeeds when the actual expression evaluates to an +/// error of the specified type +public func matchError(_ errorType: T.Type) -> Predicate { + return Predicate.define { actualExpression in + let actualError = try actualExpression.evaluate() + + let failureMessage = FailureMessage() + setFailureMessageForError( + failureMessage, + postfixMessageVerb: "match", + actualError: actualError, + errorType: errorType + ) + + var matches = false + if actualError as? T != nil { + matches = true + } + + return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/MatcherFunc.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/MatcherFunc.swift new file mode 100644 index 0000000..abcafa9 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/MatcherFunc.swift @@ -0,0 +1,85 @@ +/// DEPRECATED: A convenience API to build matchers that don't need special negation +/// behavior. The toNot() behavior is the negation of to(). +/// +/// @see NonNilMatcherFunc if you prefer to have this matcher fail when nil +/// values are received in an expectation. +/// +/// You may use this when implementing your own custom matchers. +/// +/// Use the Matcher protocol instead of this type to accept custom matchers as +/// input parameters. +/// @see allPass for an example that uses accepts other matchers as input. +@available(*, deprecated, message: "Use to Predicate instead") +public struct MatcherFunc: Matcher { + public let matcher: (Expression, FailureMessage) throws -> Bool + + public init(_ matcher: @escaping (Expression, FailureMessage) throws -> Bool) { + self.matcher = matcher + } + + public func matches(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { + return try matcher(actualExpression, failureMessage) + } + + public func doesNotMatch(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { + return try !matcher(actualExpression, failureMessage) + } + + /// Compatibility layer to new Matcher API. Converts an old-style matcher to a new one. + /// Note: You should definitely spend the time to convert to the new api as soon as possible + /// since this struct type is deprecated. + public var predicate: Predicate { + return Predicate.fromDeprecatedMatcher(self) + } +} + +/// DEPRECATED: A convenience API to build matchers that don't need special negation +/// behavior. The toNot() behavior is the negation of to(). +/// +/// Unlike MatcherFunc, this will always fail if an expectation contains nil. +/// This applies regardless of using to() or toNot(). +/// +/// You may use this when implementing your own custom matchers. +/// +/// Use the Matcher protocol instead of this type to accept custom matchers as +/// input parameters. +/// @see allPass for an example that uses accepts other matchers as input. +@available(*, deprecated, message: "Use to Predicate instead") +public struct NonNilMatcherFunc: Matcher { + public let matcher: (Expression, FailureMessage) throws -> Bool + + public init(_ matcher: @escaping (Expression, FailureMessage) throws -> Bool) { + self.matcher = matcher + } + + public func matches(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { + let pass = try matcher(actualExpression, failureMessage) + if try attachNilErrorIfNeeded(actualExpression, failureMessage: failureMessage) { + return false + } + return pass + } + + public func doesNotMatch(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { + let pass = try !matcher(actualExpression, failureMessage) + if try attachNilErrorIfNeeded(actualExpression, failureMessage: failureMessage) { + return false + } + return pass + } + + internal func attachNilErrorIfNeeded(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { + if try actualExpression.evaluate() == nil { + failureMessage.postfixActual = " (use beNil() to match nils)" + return true + } + return false + } + + /// Compatibility layer to new Matcher API. Converts an old-style matcher to a new one. + /// Note: You should definitely spend the time to convert to the new api as soon as possible + /// since this struct type is deprecated. + public var predicate: Predicate { + return Predicate.fromDeprecatedMatcher(self) + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/MatcherProtocols.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/MatcherProtocols.swift new file mode 100644 index 0000000..21ffd77 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/MatcherProtocols.swift @@ -0,0 +1,159 @@ +import Foundation +// `CGFloat` is in Foundation (swift-corelibs-foundation) on Linux. +#if canImport(Darwin) + import CoreGraphics +#endif + +/// Implement this protocol to implement a custom matcher for Swift +@available(*, deprecated, message: "Use Predicate instead") +public protocol Matcher { + associatedtype ValueType + func matches(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool + func doesNotMatch(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool +} + +extension Matcher { + var predicate: Predicate { + return Predicate.fromDeprecatedMatcher(self) + } + + var toClosure: (Expression, FailureMessage, Bool) throws -> Bool { + return { expr, msg, expectedResult in + if expectedResult { + return try self.matches(expr, failureMessage: msg) + } else { + return try self.doesNotMatch(expr, failureMessage: msg) + } + } + } +} + +#if canImport(Darwin) +/// Objective-C interface to the Swift variant of Matcher. +@objc public protocol NMBMatcher { + func matches(_ actualBlock: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool + func doesNotMatch(_ actualBlock: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool +} +#endif + +/// Protocol for types that support contain() matcher. +public protocol NMBContainer { + func contains(_ anObject: Any) -> Bool +} + +#if canImport(Darwin) +// swiftlint:disable:next todo +// FIXME: NSHashTable can not conform to NMBContainer since swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a +//extension NSHashTable : NMBContainer {} // Corelibs Foundation does not include this class yet +#endif + +extension NSArray: NMBContainer {} +extension NSSet: NMBContainer {} + +/// Protocol for types that support only beEmpty(), haveCount() matchers +public protocol NMBCollection { + var count: Int { get } +} + +#if canImport(Darwin) +extension NSHashTable: NMBCollection {} // Corelibs Foundation does not include these classes yet +extension NSMapTable: NMBCollection {} +#endif + +extension NSSet: NMBCollection {} +extension NSIndexSet: NMBCollection {} +extension NSDictionary: NMBCollection {} + +/// Protocol for types that support beginWith(), endWith(), beEmpty() matchers +public protocol NMBOrderedCollection: NMBCollection { + func object(at index: Int) -> Any +} + +extension NSArray: NMBOrderedCollection {} + +public protocol NMBDoubleConvertible { + var doubleValue: CDouble { get } +} + +extension Double: NMBDoubleConvertible { + public var doubleValue: CDouble { + return self + } +} + +extension Float: NMBDoubleConvertible { + public var doubleValue: CDouble { + return CDouble(self) + } +} + +extension CGFloat: NMBDoubleConvertible { + public var doubleValue: CDouble { + return CDouble(self) + } +} + +extension NSNumber: NMBDoubleConvertible { +} + +private let dateFormatter: DateFormatter = { + let formatter = DateFormatter() + formatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSSS" + formatter.locale = Locale(identifier: "en_US_POSIX") + + return formatter +}() + +extension Date: NMBDoubleConvertible { + public var doubleValue: CDouble { + return self.timeIntervalSinceReferenceDate + } +} + +extension NSDate: NMBDoubleConvertible { + public var doubleValue: CDouble { + return self.timeIntervalSinceReferenceDate + } +} + +extension Date: TestOutputStringConvertible { + public var testDescription: String { + return dateFormatter.string(from: self) + } +} + +extension NSDate: TestOutputStringConvertible { + public var testDescription: String { + return dateFormatter.string(from: Date(timeIntervalSinceReferenceDate: self.timeIntervalSinceReferenceDate)) + } +} + +/// Protocol for types to support beLessThan(), beLessThanOrEqualTo(), +/// beGreaterThan(), beGreaterThanOrEqualTo(), and equal() matchers. +/// +/// Types that conform to Swift's Comparable protocol will work implicitly too +#if canImport(Darwin) +@objc public protocol NMBComparable { + func NMB_compare(_ otherObject: NMBComparable!) -> ComparisonResult +} +#elseif !compiler(>=5.1) +// This should become obsolete once Corelibs Foundation adds Comparable conformance to NSNumber +public protocol NMBComparable { + func NMB_compare(_ otherObject: NMBComparable!) -> ComparisonResult +} +#endif + +#if canImport(Darwin) || !compiler(>=5.1) +extension NSNumber: NMBComparable { + public func NMB_compare(_ otherObject: NMBComparable!) -> ComparisonResult { + // swiftlint:disable:next force_cast + return compare(otherObject as! NSNumber) + } +} +extension NSString: NMBComparable { + public func NMB_compare(_ otherObject: NMBComparable!) -> ComparisonResult { + // swiftlint:disable:next force_cast + return compare(otherObject as! String) + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/PostNotification.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/PostNotification.swift new file mode 100644 index 0000000..5e8bee3 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/PostNotification.swift @@ -0,0 +1,100 @@ +import Foundation + +internal class NotificationCollector { + private(set) var observedNotifications: [Notification] + private let notificationCenter: NotificationCenter + private var token: NSObjectProtocol? + + required init(notificationCenter: NotificationCenter) { + self.notificationCenter = notificationCenter + self.observedNotifications = [] + } + + func startObserving() { + // swiftlint:disable:next line_length + self.token = self.notificationCenter.addObserver(forName: nil, object: nil, queue: nil) { [weak self] notification in + // linux-swift gets confused by .append(n) + self?.observedNotifications.append(notification) + } + } + + deinit { + if let token = self.token { + self.notificationCenter.removeObserver(token) + } + } +} + +private let mainThread = pthread_self() + +public func postNotifications( + _ predicate: Predicate<[Notification]>, + fromNotificationCenter center: NotificationCenter = .default +) -> Predicate { + _ = mainThread // Force lazy-loading of this value + let collector = NotificationCollector(notificationCenter: center) + collector.startObserving() + var once: Bool = false + + return Predicate { actualExpression in + let collectorNotificationsExpression = Expression( + memoizedExpression: { _ in + return collector.observedNotifications + }, + location: actualExpression.location, + withoutCaching: true + ) + + assert(pthread_equal(mainThread, pthread_self()) != 0, "Only expecting closure to be evaluated on main thread.") + if !once { + once = true + _ = try actualExpression.evaluate() + } + + let actualValue: String + if collector.observedNotifications.isEmpty { + actualValue = "no notifications" + } else { + actualValue = "<\(stringify(collector.observedNotifications))>" + } + + var result = try predicate.satisfies(collectorNotificationsExpression) + result.message = result.message.replacedExpectation { message in + return .expectedCustomValueTo(message.expectedMessage, actualValue) + } + return result + } +} + +public func postNotifications( + _ notificationsMatcher: T, + fromNotificationCenter center: NotificationCenter = .default) + -> Predicate + where T: Matcher, T.ValueType == [Notification] +{ + _ = mainThread // Force lazy-loading of this value + let collector = NotificationCollector(notificationCenter: center) + collector.startObserving() + var once: Bool = false + + return Predicate { actualExpression in + let collectorNotificationsExpression = Expression(memoizedExpression: { _ in + return collector.observedNotifications + }, location: actualExpression.location, withoutCaching: true) + + assert(pthread_equal(mainThread, pthread_self()) != 0, "Only expecting closure to be evaluated on main thread.") + if !once { + once = true + _ = try actualExpression.evaluate() + } + + let failureMessage = FailureMessage() + let match = try notificationsMatcher.matches(collectorNotificationsExpression, failureMessage: failureMessage) + if collector.observedNotifications.isEmpty { + failureMessage.actualValue = "no notifications" + } else { + failureMessage.actualValue = "<\(stringify(collector.observedNotifications))>" + } + return PredicateResult(bool: match, message: failureMessage.toExpectationMessage()) + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/Predicate.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/Predicate.swift new file mode 100644 index 0000000..2604411 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/Predicate.swift @@ -0,0 +1,353 @@ +// New Matcher API +// +import Foundation + +/// A Predicate is part of the new matcher API that provides assertions to expectations. +/// +/// Given a code snippet: +/// +/// expect(1).to(equal(2)) +/// ^^^^^^^^ +/// Called a "matcher" +/// +/// A matcher consists of two parts a constructor function and the Predicate. The term Predicate +/// is used as a separate name from Matcher to help transition custom matchers to the new Nimble +/// matcher API. +/// +/// The Predicate provide the heavy lifting on how to assert against a given value. Internally, +/// predicates are simple wrappers around closures to provide static type information and +/// allow composition and wrapping of existing behaviors. +public struct Predicate { + fileprivate var matcher: (Expression) throws -> PredicateResult + + /// Constructs a predicate that knows how take a given value + public init(_ matcher: @escaping (Expression) throws -> PredicateResult) { + self.matcher = matcher + } + + /// Uses a predicate on a given value to see if it passes the predicate. + /// + /// @param expression The value to run the predicate's logic against + /// @returns A predicate result indicate passing or failing and an associated error message. + public func satisfies(_ expression: Expression) throws -> PredicateResult { + return try matcher(expression) + } +} + +/// Provides convenience helpers to defining predicates +extension Predicate { + /// Like Predicate() constructor, but automatically guard against nil (actual) values + public static func define(matcher: @escaping (Expression) throws -> PredicateResult) -> Predicate { + return Predicate { actual in + return try matcher(actual) + }.requireNonNil + } + + /// Defines a predicate with a default message that can be returned in the closure + /// Also ensures the predicate's actual value cannot pass with `nil` given. + public static func define(_ msg: String, matcher: @escaping (Expression, ExpectationMessage) throws -> PredicateResult) -> Predicate { + return Predicate { actual in + return try matcher(actual, .expectedActualValueTo(msg)) + }.requireNonNil + } + + /// Defines a predicate with a default message that can be returned in the closure + /// Unlike `define`, this allows nil values to succeed if the given closure chooses to. + public static func defineNilable(_ msg: String, matcher: @escaping (Expression, ExpectationMessage) throws -> PredicateResult) -> Predicate { + return Predicate { actual in + return try matcher(actual, .expectedActualValueTo(msg)) + } + } +} + +extension Predicate { + /// Provides a simple predicate definition that provides no control over the predefined + /// error message. + /// + /// Also ensures the predicate's actual value cannot pass with `nil` given. + public static func simple(_ msg: String, matcher: @escaping (Expression) throws -> PredicateStatus) -> Predicate { + return Predicate { actual in + return PredicateResult(status: try matcher(actual), message: .expectedActualValueTo(msg)) + }.requireNonNil + } + + /// Provides a simple predicate definition that provides no control over the predefined + /// error message. + /// + /// Unlike `simple`, this allows nil values to succeed if the given closure chooses to. + public static func simpleNilable(_ msg: String, matcher: @escaping (Expression) throws -> PredicateStatus) -> Predicate { + return Predicate { actual in + return PredicateResult(status: try matcher(actual), message: .expectedActualValueTo(msg)) + } + } +} + +// The Expectation style intended for comparison to a PredicateStatus. +public enum ExpectationStyle { + case toMatch, toNotMatch +} + +/// The value that a Predicates return to describe if the given (actual) value matches the +/// predicate. +public struct PredicateResult { + /// Status indicates if the predicate matches, does not match, or fails. + public var status: PredicateStatus + /// The error message that can be displayed if it does not match + public var message: ExpectationMessage + + /// Constructs a new PredicateResult with a given status and error message + public init(status: PredicateStatus, message: ExpectationMessage) { + self.status = status + self.message = message + } + + /// Shorthand to PredicateResult(status: PredicateStatus(bool: bool), message: message) + public init(bool: Bool, message: ExpectationMessage) { + self.status = PredicateStatus(bool: bool) + self.message = message + } + + /// Converts the result to a boolean based on what the expectation intended + public func toBoolean(expectation style: ExpectationStyle) -> Bool { + return status.toBoolean(expectation: style) + } +} + +/// PredicateStatus is a trinary that indicates if a Predicate matches a given value or not +public enum PredicateStatus { + /// Matches indicates if the predicate / matcher passes with the given value + /// + /// For example, `equals(1)` returns `.matches` for `expect(1).to(equal(1))`. + case matches + /// DoesNotMatch indicates if the predicate / matcher fails with the given value, but *would* + /// succeed if the expectation was inverted. + /// + /// For example, `equals(2)` returns `.doesNotMatch` for `expect(1).toNot(equal(2))`. + case doesNotMatch + /// Fail indicates the predicate will never satisfy with the given value in any case. + /// A perfect example is that most matchers fail whenever given `nil`. + /// + /// Using `equal(1)` fails both `expect(nil).to(equal(1))` and `expect(nil).toNot(equal(1))`. + /// Note: Predicate's `requireNonNil` property will also provide this feature mostly for free. + /// Your predicate will still need to guard against nils, but error messaging will be + /// handled for you. + case fail + + /// Converts a boolean to either .matches (if true) or .doesNotMatch (if false). + public init(bool matches: Bool) { + if matches { + self = .matches + } else { + self = .doesNotMatch + } + } + + private func shouldMatch() -> Bool { + switch self { + case .matches: return true + case .doesNotMatch, .fail: return false + } + } + + private func shouldNotMatch() -> Bool { + switch self { + case .doesNotMatch: return true + case .matches, .fail: return false + } + } + + /// Converts the PredicateStatus result to a boolean based on what the expectation intended + internal func toBoolean(expectation style: ExpectationStyle) -> Bool { + if style == .toMatch { + return shouldMatch() + } else { + return shouldNotMatch() + } + } +} + +// Backwards compatibility until Old Matcher API removal +extension Predicate: Matcher { + /// Compatibility layer for old Matcher API, deprecated + public static func fromDeprecatedFullClosure(_ matcher: @escaping (Expression, FailureMessage, Bool) throws -> Bool) -> Predicate { + return Predicate { actual in + let failureMessage = FailureMessage() + let result = try matcher(actual, failureMessage, true) + return PredicateResult( + status: PredicateStatus(bool: result), + message: failureMessage.toExpectationMessage() + ) + } + } + + /// Compatibility layer for old Matcher API, deprecated. + /// Emulates the MatcherFunc API + public static func fromDeprecatedClosure(_ matcher: @escaping (Expression, FailureMessage) throws -> Bool) -> Predicate { + return Predicate { actual in + let failureMessage = FailureMessage() + let result = try matcher(actual, failureMessage) + return PredicateResult( + status: PredicateStatus(bool: result), + message: failureMessage.toExpectationMessage() + ) + } + + } + + /// Compatibility layer for old Matcher API, deprecated. + /// Same as calling .predicate on a MatcherFunc or NonNilMatcherFunc type. + public static func fromDeprecatedMatcher(_ matcher: M) -> Predicate where M: Matcher, M.ValueType == T { + return self.fromDeprecatedFullClosure(matcher.toClosure) + } + + /// Deprecated Matcher API, use satisfies(_:_) instead + public func matches(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { + let result = try satisfies(actualExpression) + result.message.update(failureMessage: failureMessage) + return result.toBoolean(expectation: .toMatch) + } + + /// Deprecated Matcher API, use satisfies(_:_) instead + public func doesNotMatch(_ actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { + let result = try satisfies(actualExpression) + result.message.update(failureMessage: failureMessage) + return result.toBoolean(expectation: .toNotMatch) + } +} + +extension Predicate { + // Someday, make this public? Needs documentation + internal func after(f: @escaping (Expression, PredicateResult) throws -> PredicateResult) -> Predicate { + // swiftlint:disable:previous identifier_name + return Predicate { actual -> PredicateResult in + let result = try self.satisfies(actual) + return try f(actual, result) + } + } + + /// Returns a new Predicate based on the current one that always fails if nil is given as + /// the actual value. + /// + /// This replaces `NonNilMatcherFunc`. + public var requireNonNil: Predicate { + return after { actual, result in + if try actual.evaluate() == nil { + return PredicateResult( + status: .fail, + message: result.message.appendedBeNilHint() + ) + } + return result + } + } +} + +#if canImport(Darwin) +public typealias PredicateBlock = (_ actualExpression: Expression) throws -> NMBPredicateResult + +public class NMBPredicate: NSObject { + private let predicate: PredicateBlock + + public init(predicate: @escaping PredicateBlock) { + self.predicate = predicate + } + + func satisfies(_ expression: @escaping () throws -> NSObject?, location: SourceLocation) -> NMBPredicateResult { + let expr = Expression(expression: expression, location: location) + do { + return try self.predicate(expr) + } catch let error { + return PredicateResult(status: .fail, message: .fail("unexpected error thrown: <\(error)>")).toObjectiveC() + } + } +} + +extension NMBPredicate: NMBMatcher { + public func matches(_ actualBlock: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool { + let result = satisfies(actualBlock, location: location).toSwift() + result.message.update(failureMessage: failureMessage) + return result.status.toBoolean(expectation: .toMatch) + } + + public func doesNotMatch(_ actualBlock: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool { + let result = satisfies(actualBlock, location: location).toSwift() + result.message.update(failureMessage: failureMessage) + return result.status.toBoolean(expectation: .toNotMatch) + } +} + +final public class NMBPredicateResult: NSObject { + public var status: NMBPredicateStatus + public var message: NMBExpectationMessage + + public init(status: NMBPredicateStatus, message: NMBExpectationMessage) { + self.status = status + self.message = message + } + + public init(bool success: Bool, message: NMBExpectationMessage) { + self.status = NMBPredicateStatus.from(bool: success) + self.message = message + } + + public func toSwift() -> PredicateResult { + return PredicateResult(status: status.toSwift(), + message: message.toSwift()) + } +} + +extension PredicateResult { + public func toObjectiveC() -> NMBPredicateResult { + return NMBPredicateResult(status: status.toObjectiveC(), message: message.toObjectiveC()) + } +} + +final public class NMBPredicateStatus: NSObject { + private let status: Int + private init(status: Int) { + self.status = status + } + + public static let matches: NMBPredicateStatus = NMBPredicateStatus(status: 0) + public static let doesNotMatch: NMBPredicateStatus = NMBPredicateStatus(status: 1) + public static let fail: NMBPredicateStatus = NMBPredicateStatus(status: 2) + + public override var hash: Int { return self.status.hashValue } + + public override func isEqual(_ object: Any?) -> Bool { + guard let otherPredicate = object as? NMBPredicateStatus else { + return false + } + return self.status == otherPredicate.status + } + + public static func from(status: PredicateStatus) -> NMBPredicateStatus { + switch status { + case .matches: return self.matches + case .doesNotMatch: return self.doesNotMatch + case .fail: return self.fail + } + } + + public static func from(bool success: Bool) -> NMBPredicateStatus { + return self.from(status: PredicateStatus(bool: success)) + } + + public func toSwift() -> PredicateStatus { + switch status { + case NMBPredicateStatus.matches.status: return .matches + case NMBPredicateStatus.doesNotMatch.status: return .doesNotMatch + case NMBPredicateStatus.fail.status: return .fail + default: + internalError("Unhandle status for NMBPredicateStatus") + } + } +} + +extension PredicateStatus { + public func toObjectiveC() -> NMBPredicateStatus { + return NMBPredicateStatus.from(status: self) + } +} + +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/RaisesException.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/RaisesException.swift new file mode 100644 index 0000000..4dd9304 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/RaisesException.swift @@ -0,0 +1,213 @@ +import Foundation + +// This matcher requires the Objective-C, and being built by Xcode rather than the Swift Package Manager +#if canImport(Darwin) && !SWIFT_PACKAGE + +/// A Nimble matcher that succeeds when the actual expression raises an +/// exception with the specified name, reason, and/or userInfo. +/// +/// Alternatively, you can pass a closure to do any arbitrary custom matching +/// to the raised exception. The closure only gets called when an exception +/// is raised. +/// +/// nil arguments indicates that the matcher should not attempt to match against +/// that parameter. +public func raiseException( + named: String? = nil, + reason: String? = nil, + userInfo: NSDictionary? = nil, + closure: ((NSException) -> Void)? = nil) -> Predicate { + return Predicate { actualExpression in + var exception: NSException? + let capture = NMBExceptionCapture(handler: ({ e in + exception = e + }), finally: nil) + + do { + try capture.tryBlockThrows { + _ = try actualExpression.evaluate() + } + } catch { + return PredicateResult(status: .fail, message: .fail("unexpected error thrown: <\(error)>")) + } + + let failureMessage = FailureMessage() + setFailureMessageForException( + failureMessage, + exception: exception, + named: named, + reason: reason, + userInfo: userInfo, + closure: closure + ) + + let matches = exceptionMatchesNonNilFieldsOrClosure( + exception, + named: named, + reason: reason, + userInfo: userInfo, + closure: closure + ) + return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) + } +} + +// swiftlint:disable:next function_parameter_count +internal func setFailureMessageForException( + _ failureMessage: FailureMessage, + exception: NSException?, + named: String?, + reason: String?, + userInfo: NSDictionary?, + closure: ((NSException) -> Void)?) { + failureMessage.postfixMessage = "raise exception" + + if let named = named { + failureMessage.postfixMessage += " with name <\(named)>" + } + if let reason = reason { + failureMessage.postfixMessage += " with reason <\(reason)>" + } + if let userInfo = userInfo { + failureMessage.postfixMessage += " with userInfo <\(userInfo)>" + } + if closure != nil { + failureMessage.postfixMessage += " that satisfies block" + } + if named == nil && reason == nil && userInfo == nil && closure == nil { + failureMessage.postfixMessage = "raise any exception" + } + + if let exception = exception { + // swiftlint:disable:next line_length + failureMessage.actualValue = "\(String(describing: type(of: exception))) { name=\(exception.name), reason='\(stringify(exception.reason))', userInfo=\(stringify(exception.userInfo)) }" + } else { + failureMessage.actualValue = "no exception" + } +} + +internal func exceptionMatchesNonNilFieldsOrClosure( + _ exception: NSException?, + named: String?, + reason: String?, + userInfo: NSDictionary?, + closure: ((NSException) -> Void)?) -> Bool { + var matches = false + + if let exception = exception { + matches = true + + if let named = named, exception.name.rawValue != named { + matches = false + } + if reason != nil && exception.reason != reason { + matches = false + } + if let userInfo = userInfo, let exceptionUserInfo = exception.userInfo, + (exceptionUserInfo as NSDictionary) != userInfo { + matches = false + } + if let closure = closure { + let assertions = gatherFailingExpectations { + closure(exception) + } + let messages = assertions.map { $0.message } + if messages.count > 0 { + matches = false + } + } + } + + return matches +} + +public class NMBObjCRaiseExceptionMatcher: NSObject, NMBMatcher { + // swiftlint:disable identifier_name + internal var _name: String? + internal var _reason: String? + internal var _userInfo: NSDictionary? + internal var _block: ((NSException) -> Void)? + // swiftlint:enable identifier_name + + internal init(name: String?, reason: String?, userInfo: NSDictionary?, block: ((NSException) -> Void)?) { + _name = name + _reason = reason + _userInfo = userInfo + _block = block + } + + @objc public func matches(_ actualBlock: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool { + let block: () -> Any? = ({ _ = actualBlock(); return nil }) + let expr = Expression(expression: block, location: location) + + do { + let predicate = raiseException( + named: _name, + reason: _reason, + userInfo: _userInfo, + closure: _block + ) + let result = try predicate.satisfies(expr) + result.message.update(failureMessage: failureMessage) + return result.toBoolean(expectation: .toMatch) + } catch let error { + failureMessage.stringValue = "unexpected error thrown: <\(error)>" + return false + } + } + + @objc public func doesNotMatch(_ actualBlock: @escaping () -> NSObject?, failureMessage: FailureMessage, location: SourceLocation) -> Bool { + return !matches(actualBlock, failureMessage: failureMessage, location: location) + } + + @objc public var named: (_ name: String) -> NMBObjCRaiseExceptionMatcher { + return { name in + return NMBObjCRaiseExceptionMatcher( + name: name, + reason: self._reason, + userInfo: self._userInfo, + block: self._block + ) + } + } + + @objc public var reason: (_ reason: String?) -> NMBObjCRaiseExceptionMatcher { + return { reason in + return NMBObjCRaiseExceptionMatcher( + name: self._name, + reason: reason, + userInfo: self._userInfo, + block: self._block + ) + } + } + + @objc public var userInfo: (_ userInfo: NSDictionary?) -> NMBObjCRaiseExceptionMatcher { + return { userInfo in + return NMBObjCRaiseExceptionMatcher( + name: self._name, + reason: self._reason, + userInfo: userInfo, + block: self._block + ) + } + } + + @objc public var satisfyingBlock: (_ block: ((NSException) -> Void)?) -> NMBObjCRaiseExceptionMatcher { + return { block in + return NMBObjCRaiseExceptionMatcher( + name: self._name, + reason: self._reason, + userInfo: self._userInfo, + block: block + ) + } + } +} + +extension NMBObjCMatcher { + @objc public class func raiseExceptionMatcher() -> NMBObjCRaiseExceptionMatcher { + return NMBObjCRaiseExceptionMatcher(name: nil, reason: nil, userInfo: nil, block: nil) + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/SatisfyAllOf.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/SatisfyAllOf.swift new file mode 100644 index 0000000..15de060 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/SatisfyAllOf.swift @@ -0,0 +1,86 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value matches with all of the matchers +/// provided in the variable list of matchers. +public func satisfyAllOf(_ predicates: Predicate...) -> Predicate { + return satisfyAllOf(predicates) +} + +/// A Nimble matcher that succeeds when the actual value matches with all of the matchers +/// provided in the variable list of matchers. +public func satisfyAllOf(_ matchers: U...) -> Predicate + where U: Matcher, U.ValueType == T { + return satisfyAllOf(matchers.map { $0.predicate }) +} + +internal func satisfyAllOf(_ predicates: [Predicate]) -> Predicate { + return Predicate.define { actualExpression in + var postfixMessages = [String]() + var matches = true + for predicate in predicates { + let result = try predicate.satisfies(actualExpression) + if result.toBoolean(expectation: .toNotMatch) { + matches = false + } + postfixMessages.append("{\(result.message.expectedMessage)}") + } + + var msg: ExpectationMessage + if let actualValue = try actualExpression.evaluate() { + msg = .expectedCustomValueTo( + "match all of: " + postfixMessages.joined(separator: ", and "), + "\(actualValue)" + ) + } else { + msg = .expectedActualValueTo( + "match all of: " + postfixMessages.joined(separator: ", and ") + ) + } + + return PredicateResult(bool: matches, message: msg) + } +} + +public func && (left: Predicate, right: Predicate) -> Predicate { + return satisfyAllOf(left, right) +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func satisfyAllOfMatcher(_ matchers: [NMBMatcher]) -> NMBPredicate { + return NMBPredicate { actualExpression in + if matchers.isEmpty { + return NMBPredicateResult( + status: NMBPredicateStatus.fail, + message: NMBExpectationMessage( + fail: "satisfyAllOf must be called with at least one matcher" + ) + ) + } + + var elementEvaluators = [Predicate]() + for matcher in matchers { + let elementEvaluator = Predicate { expression in + if let predicate = matcher as? NMBPredicate { + // swiftlint:disable:next line_length + return predicate.satisfies({ try expression.evaluate() }, location: actualExpression.location).toSwift() + } else { + let failureMessage = FailureMessage() + let success = matcher.matches( + // swiftlint:disable:next force_try + { try! expression.evaluate() }, + failureMessage: failureMessage, + location: actualExpression.location + ) + return PredicateResult(bool: success, message: failureMessage.toExpectationMessage()) + } + } + + elementEvaluators.append(elementEvaluator) + } + + return try satisfyAllOf(elementEvaluators).satisfies(actualExpression).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/SatisfyAnyOf.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/SatisfyAnyOf.swift new file mode 100644 index 0000000..e8b379f --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/SatisfyAnyOf.swift @@ -0,0 +1,94 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual value matches with any of the matchers +/// provided in the variable list of matchers. +public func satisfyAnyOf(_ predicates: Predicate...) -> Predicate { + return satisfyAnyOf(predicates) +} + +/// A Nimble matcher that succeeds when the actual value matches with any of the matchers +/// provided in the variable list of matchers. +public func satisfyAnyOf(_ matchers: U...) -> Predicate + where U: Matcher, U.ValueType == T { + return satisfyAnyOf(matchers.map { $0.predicate }) +} + +internal func satisfyAnyOf(_ predicates: [Predicate]) -> Predicate { + return Predicate.define { actualExpression in + var postfixMessages = [String]() + var matches = false + for predicate in predicates { + let result = try predicate.satisfies(actualExpression) + if result.toBoolean(expectation: .toMatch) { + matches = true + } + postfixMessages.append("{\(result.message.expectedMessage)}") + } + + var msg: ExpectationMessage + if let actualValue = try actualExpression.evaluate() { + msg = .expectedCustomValueTo( + "match one of: " + postfixMessages.joined(separator: ", or "), + "\(actualValue)" + ) + } else { + msg = .expectedActualValueTo( + "match one of: " + postfixMessages.joined(separator: ", or ") + ) + } + + return PredicateResult(bool: matches, message: msg) + } +} + +public func || (left: Predicate, right: Predicate) -> Predicate { + return satisfyAnyOf(left, right) +} + +public func || (left: NonNilMatcherFunc, right: NonNilMatcherFunc) -> Predicate { + return satisfyAnyOf(left, right) +} + +public func || (left: MatcherFunc, right: MatcherFunc) -> Predicate { + return satisfyAnyOf(left, right) +} + +#if canImport(Darwin) +extension NMBObjCMatcher { + @objc public class func satisfyAnyOfMatcher(_ matchers: [NMBMatcher]) -> NMBPredicate { + return NMBPredicate { actualExpression in + if matchers.isEmpty { + return NMBPredicateResult( + status: NMBPredicateStatus.fail, + message: NMBExpectationMessage( + fail: "satisfyAnyOf must be called with at least one matcher" + ) + ) + } + + var elementEvaluators = [Predicate]() + for matcher in matchers { + let elementEvaluator = Predicate { expression in + if let predicate = matcher as? NMBPredicate { + // swiftlint:disable:next line_length + return predicate.satisfies({ try expression.evaluate() }, location: actualExpression.location).toSwift() + } else { + let failureMessage = FailureMessage() + let success = matcher.matches( + // swiftlint:disable:next force_try + { try! expression.evaluate() }, + failureMessage: failureMessage, + location: actualExpression.location + ) + return PredicateResult(bool: success, message: failureMessage.toExpectationMessage()) + } + } + + elementEvaluators.append(elementEvaluator) + } + + return try satisfyAnyOf(elementEvaluators).satisfies(actualExpression).toObjectiveC() + } + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/ThrowAssertion.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/ThrowAssertion.swift new file mode 100644 index 0000000..53d9191 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/ThrowAssertion.swift @@ -0,0 +1,51 @@ +import Foundation + +public func throwAssertion() -> Predicate { + return Predicate { actualExpression in + #if arch(x86_64) && canImport(Darwin) && !SWIFT_PACKAGE + let message = ExpectationMessage.expectedTo("throw an assertion") + + var actualError: Error? + let caughtException: BadInstructionException? = catchBadInstruction { + #if os(tvOS) + if !NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning { + print() + print("[Nimble Warning]: If you're getting stuck on a debugger breakpoint for a " + + "fatal error while using throwAssertion(), please disable 'Debug Executable' " + + "in your scheme. Go to 'Edit Scheme > Test > Info' and uncheck " + + "'Debug Executable'. If you've already done that, suppress this warning " + + "by setting `NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning = true`. " + + "This is required because the standard methods of catching assertions " + + "(mach APIs) are unavailable for tvOS. Instead, the same mechanism the " + + "debugger uses is the fallback method for tvOS." + ) + print() + NimbleEnvironment.activeInstance.suppressTVOSAssertionWarning = true + } + #endif + do { + try actualExpression.evaluate() + } catch { + actualError = error + } + } + + if let actualError = actualError { + return PredicateResult( + bool: false, + message: message.appended(message: "; threw error instead <\(actualError)>") + ) + } else { + return PredicateResult(bool: caughtException != nil, message: message) + } + #elseif SWIFT_PACKAGE + fatalError("The throwAssertion Nimble matcher does not currently support Swift CLI." + + " You can silence this error by placing the test case inside an #if !SWIFT_PACKAGE" + + " conditional statement") + #else + fatalError("The throwAssertion Nimble matcher can only run on x86_64 platforms with " + + "Objective-C (e.g. macOS, iPhone 5s or later simulators). You can silence this error " + + "by placing the test case inside an #if arch(x86_64) or canImport(Darwin) conditional statement") + #endif + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/ThrowError.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/ThrowError.swift new file mode 100644 index 0000000..d294ba3 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/ThrowError.swift @@ -0,0 +1,264 @@ +import Foundation + +/// A Nimble matcher that succeeds when the actual expression throws an +/// error of the specified type or from the specified case. +/// +/// Errors are tried to be compared by their implementation of Equatable, +/// otherwise they fallback to comparison by _domain and _code. +/// +/// Alternatively, you can pass a closure to do any arbitrary custom matching +/// to the thrown error. The closure only gets called when an error was thrown. +/// +/// nil arguments indicates that the matcher should not attempt to match against +/// that parameter. +public func throwError() -> Predicate { + return Predicate { actualExpression in + var actualError: Error? + do { + _ = try actualExpression.evaluate() + } catch { + actualError = error + } + + if let actualError = actualError { + return PredicateResult(bool: true, message: .expectedCustomValueTo("throw any error", "<\(actualError)>")) + } else { + return PredicateResult(bool: false, message: .expectedCustomValueTo("throw any error", "no error")) + } + } +} + +/// A Nimble matcher that succeeds when the actual expression throws an +/// error of the specified type or from the specified case. +/// +/// Errors are tried to be compared by their implementation of Equatable, +/// otherwise they fallback to comparision by _domain and _code. +/// +/// Alternatively, you can pass a closure to do any arbitrary custom matching +/// to the thrown error. The closure only gets called when an error was thrown. +/// +/// nil arguments indicates that the matcher should not attempt to match against +/// that parameter. +public func throwError(_ error: T, closure: ((Error) -> Void)? = nil) -> Predicate { + return Predicate { actualExpression in + var actualError: Error? + do { + _ = try actualExpression.evaluate() + } catch { + actualError = error + } + + let failureMessage = FailureMessage() + setFailureMessageForError( + failureMessage, + actualError: actualError, + error: error, + errorType: nil, + closure: closure + ) + + var matches = false + if let actualError = actualError, errorMatchesExpectedError(actualError, expectedError: error) { + matches = true + + if let closure = closure { + let assertions = gatherFailingExpectations { + closure(actualError) + } + let messages = assertions.map { $0.message } + if !messages.isEmpty { + matches = false + } + } + } + + return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) + } +} + +/// A Nimble matcher that succeeds when the actual expression throws an +/// error of the specified type or from the specified case. +/// +/// Errors are tried to be compared by their implementation of Equatable, +/// otherwise they fallback to comparision by _domain and _code. +/// +/// Alternatively, you can pass a closure to do any arbitrary custom matching +/// to the thrown error. The closure only gets called when an error was thrown. +/// +/// nil arguments indicates that the matcher should not attempt to match against +/// that parameter. +public func throwError(_ error: T, closure: ((T) -> Void)? = nil) -> Predicate { + return Predicate { actualExpression in + var actualError: Error? + do { + _ = try actualExpression.evaluate() + } catch { + actualError = error + } + + let failureMessage = FailureMessage() + setFailureMessageForError( + failureMessage, + actualError: actualError, + error: error, + errorType: nil, + closure: closure + ) + + var matches = false + if let actualError = actualError as? T, error == actualError { + matches = true + + if let closure = closure { + let assertions = gatherFailingExpectations { + closure(actualError) + } + let messages = assertions.map { $0.message } + if !messages.isEmpty { + matches = false + } + } + } + + return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) + } +} + +/// A Nimble matcher that succeeds when the actual expression throws an +/// error of the specified type or from the specified case. +/// +/// Errors are tried to be compared by their implementation of Equatable, +/// otherwise they fallback to comparision by _domain and _code. +/// +/// Alternatively, you can pass a closure to do any arbitrary custom matching +/// to the thrown error. The closure only gets called when an error was thrown. +/// +/// nil arguments indicates that the matcher should not attempt to match against +/// that parameter. +public func throwError( + errorType: T.Type, + closure: ((T) -> Void)? = nil) -> Predicate { + return Predicate { actualExpression in + var actualError: Error? + do { + _ = try actualExpression.evaluate() + } catch { + actualError = error + } + + let failureMessage = FailureMessage() + setFailureMessageForError( + failureMessage, + actualError: actualError, + error: nil, + errorType: errorType, + closure: closure + ) + + var matches = false + if let actualError = actualError { + matches = true + + if let actualError = actualError as? T { + if let closure = closure { + let assertions = gatherFailingExpectations { + closure(actualError) + } + let messages = assertions.map { $0.message } + if !messages.isEmpty { + matches = false + } + } + } else { + matches = (actualError is T) + // The closure expects another ErrorProtocol as argument, so this + // is _supposed_ to fail, so that it becomes more obvious. + if let closure = closure { + let assertions = gatherExpectations { + if let actual = actualError as? T { + closure(actual) + } + } + let messages = assertions.map { $0.message } + if !messages.isEmpty { + matches = false + } + } + } + } + + return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) + } +} + +/// A Nimble matcher that succeeds when the actual expression throws any +/// error or when the passed closures' arbitrary custom matching succeeds. +/// +/// This duplication to it's generic adequate is required to allow to receive +/// values of the existential type `Error` in the closure. +/// +/// The closure only gets called when an error was thrown. +public func throwError(closure: @escaping ((Error) -> Void)) -> Predicate { + return Predicate { actualExpression in + var actualError: Error? + do { + _ = try actualExpression.evaluate() + } catch { + actualError = error + } + + let failureMessage = FailureMessage() + setFailureMessageForError(failureMessage, actualError: actualError, closure: closure) + + var matches = false + if let actualError = actualError { + matches = true + + let assertions = gatherFailingExpectations { + closure(actualError) + } + let messages = assertions.map { $0.message } + if !messages.isEmpty { + matches = false + } + } + + return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) + } +} + +/// A Nimble matcher that succeeds when the actual expression throws any +/// error or when the passed closures' arbitrary custom matching succeeds. +/// +/// This duplication to it's generic adequate is required to allow to receive +/// values of the existential type `Error` in the closure. +/// +/// The closure only gets called when an error was thrown. +public func throwError(closure: @escaping ((T) -> Void)) -> Predicate { + return Predicate { actualExpression in + var actualError: Error? + do { + _ = try actualExpression.evaluate() + } catch { + actualError = error + } + + let failureMessage = FailureMessage() + setFailureMessageForError(failureMessage, actualError: actualError, closure: closure) + + var matches = false + if let actualError = actualError as? T { + matches = true + + let assertions = gatherFailingExpectations { + closure(actualError) + } + let messages = assertions.map { $0.message } + if !messages.isEmpty { + matches = false + } + } + + return PredicateResult(bool: matches, message: failureMessage.toExpectationMessage()) + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Matchers/ToSucceed.swift b/Example/Pods/Nimble/Sources/Nimble/Matchers/ToSucceed.swift new file mode 100644 index 0000000..01369bb --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Matchers/ToSucceed.swift @@ -0,0 +1,37 @@ +/** + Used by the `toSucceed` matcher. + + This is the return type for the closure. + */ +public enum ToSucceedResult { + case succeeded + case failed(reason: String) +} + +/** + A Nimble matcher that takes in a closure for validation. + + Return `.succeeded` when the validation succeeds. + Return `.failed` with a failure reason when the validation fails. + */ +public func succeed() -> Predicate<() -> ToSucceedResult> { + return Predicate.define { actualExpression in + let optActual = try actualExpression.evaluate() + guard let actual = optActual else { + return PredicateResult(status: .fail, message: .fail("expected a closure, got ")) + } + + switch actual() { + case .succeeded: + return PredicateResult( + bool: true, + message: .expectedCustomValueTo("succeed", "") + ) + case .failed(let reason): + return PredicateResult( + bool: false, + message: .expectedCustomValueTo("succeed", " because <\(reason)>") + ) + } + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Nimble.h b/Example/Pods/Nimble/Sources/Nimble/Nimble.h new file mode 100644 index 0000000..2bbc693 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Nimble.h @@ -0,0 +1,13 @@ +#import +#import "NMBExceptionCapture.h" +#import "NMBStringify.h" +#import "DSL.h" + +#if TARGET_OS_TV + #import "CwlPreconditionTesting_POSIX.h" +#else + #import "CwlPreconditionTesting.h" +#endif + +FOUNDATION_EXPORT double NimbleVersionNumber; +FOUNDATION_EXPORT const unsigned char NimbleVersionString[]; diff --git a/Example/Pods/Nimble/Sources/Nimble/Utils/Await.swift b/Example/Pods/Nimble/Sources/Nimble/Utils/Await.swift new file mode 100644 index 0000000..abe1237 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Utils/Await.swift @@ -0,0 +1,371 @@ +import CoreFoundation +import Dispatch +import Foundation + +#if canImport(CDispatch) + import CDispatch +#endif + +private let timeoutLeeway = DispatchTimeInterval.milliseconds(1) +private let pollLeeway = DispatchTimeInterval.milliseconds(1) + +/// Stores debugging information about callers +internal struct WaitingInfo: CustomStringConvertible { + let name: String + let file: FileString + let lineNumber: UInt + + var description: String { + return "\(name) at \(file):\(lineNumber)" + } +} + +internal protocol WaitLock { + func acquireWaitingLock(_ fnName: String, file: FileString, line: UInt) + func releaseWaitingLock() + func isWaitingLocked() -> Bool +} + +internal class AssertionWaitLock: WaitLock { + private var currentWaiter: WaitingInfo? + init() { } + + func acquireWaitingLock(_ fnName: String, file: FileString, line: UInt) { + let info = WaitingInfo(name: fnName, file: file, lineNumber: line) + let isMainThread = Thread.isMainThread + nimblePrecondition( + isMainThread, + "InvalidNimbleAPIUsage", + "\(fnName) can only run on the main thread." + ) + nimblePrecondition( + currentWaiter == nil, + "InvalidNimbleAPIUsage", + """ + Nested async expectations are not allowed to avoid creating flaky tests. + + The call to + \t\(info) + triggered this exception because + \t\(currentWaiter!) + is currently managing the main run loop. + """ + ) + currentWaiter = info + } + + func isWaitingLocked() -> Bool { + return currentWaiter != nil + } + + func releaseWaitingLock() { + currentWaiter = nil + } +} + +internal enum AwaitResult { + /// Incomplete indicates None (aka - this value hasn't been fulfilled yet) + case incomplete + /// TimedOut indicates the result reached its defined timeout limit before returning + case timedOut + /// BlockedRunLoop indicates the main runloop is too busy processing other blocks to trigger + /// the timeout code. + /// + /// This may also mean the async code waiting upon may have never actually ran within the + /// required time because other timers & sources are running on the main run loop. + case blockedRunLoop + /// The async block successfully executed and returned a given result + case completed(T) + /// When a Swift Error is thrown + case errorThrown(Error) + /// When an Objective-C Exception is raised + case raisedException(NSException) + + func isIncomplete() -> Bool { + switch self { + case .incomplete: return true + default: return false + } + } + + func isCompleted() -> Bool { + switch self { + case .completed: return true + default: return false + } + } +} + +/// Holds the resulting value from an asynchronous expectation. +/// This class is thread-safe at receiving an "response" to this promise. +internal class AwaitPromise { + private(set) internal var asyncResult: AwaitResult = .incomplete + private var signal: DispatchSemaphore + + init() { + signal = DispatchSemaphore(value: 1) + } + + deinit { + signal.signal() + } + + /// Resolves the promise with the given result if it has not been resolved. Repeated calls to + /// this method will resolve in a no-op. + /// + /// @returns a Bool that indicates if the async result was accepted or rejected because another + /// value was received first. + func resolveResult(_ result: AwaitResult) -> Bool { + if signal.wait(timeout: .now()) == .success { + self.asyncResult = result + return true + } else { + return false + } + } +} + +internal struct AwaitTrigger { + let timeoutSource: DispatchSourceTimer + let actionSource: DispatchSourceTimer? + let start: () throws -> Void +} + +/// Factory for building fully configured AwaitPromises and waiting for their results. +/// +/// This factory stores all the state for an async expectation so that Await doesn't +/// doesn't have to manage it. +internal class AwaitPromiseBuilder { + let awaiter: Awaiter + let waitLock: WaitLock + let trigger: AwaitTrigger + let promise: AwaitPromise + + internal init( + awaiter: Awaiter, + waitLock: WaitLock, + promise: AwaitPromise, + trigger: AwaitTrigger) { + self.awaiter = awaiter + self.waitLock = waitLock + self.promise = promise + self.trigger = trigger + } + + func timeout(_ timeoutInterval: TimeInterval, forcefullyAbortTimeout: TimeInterval) -> Self { + // = Discussion = + // + // There's a lot of technical decisions here that is useful to elaborate on. This is + // definitely more lower-level than the previous NSRunLoop based implementation. + // + // + // Why Dispatch Source? + // + // + // We're using a dispatch source to have better control of the run loop behavior. + // A timer source gives us deferred-timing control without having to rely as much on + // a run loop's traditional dispatching machinery (eg - NSTimers, DefaultRunLoopMode, etc.) + // which is ripe for getting corrupted by application code. + // + // And unlike dispatch_async(), we can control how likely our code gets prioritized to + // executed (see leeway parameter) + DISPATCH_TIMER_STRICT. + // + // This timer is assumed to run on the HIGH priority queue to ensure it maintains the + // highest priority over normal application / test code when possible. + // + // + // Run Loop Management + // + // In order to properly interrupt the waiting behavior performed by this factory class, + // this timer stops the main run loop to tell the waiter code that the result should be + // checked. + // + // In addition, stopping the run loop is used to halt code executed on the main run loop. + trigger.timeoutSource.schedule( + deadline: DispatchTime.now() + timeoutInterval, + repeating: .never, + leeway: timeoutLeeway + ) + trigger.timeoutSource.setEventHandler { + guard self.promise.asyncResult.isIncomplete() else { return } + let timedOutSem = DispatchSemaphore(value: 0) + let semTimedOutOrBlocked = DispatchSemaphore(value: 0) + semTimedOutOrBlocked.signal() + let runLoop = CFRunLoopGetMain() + #if canImport(Darwin) + let runLoopMode = CFRunLoopMode.defaultMode.rawValue + #else + let runLoopMode = kCFRunLoopDefaultMode + #endif + CFRunLoopPerformBlock(runLoop, runLoopMode) { + if semTimedOutOrBlocked.wait(timeout: .now()) == .success { + timedOutSem.signal() + semTimedOutOrBlocked.signal() + if self.promise.resolveResult(.timedOut) { + CFRunLoopStop(CFRunLoopGetMain()) + } + } + } + // potentially interrupt blocking code on run loop to let timeout code run + CFRunLoopStop(runLoop) + let now = DispatchTime.now() + forcefullyAbortTimeout + let didNotTimeOut = timedOutSem.wait(timeout: now) != .success + let timeoutWasNotTriggered = semTimedOutOrBlocked.wait(timeout: .now()) == .success + if didNotTimeOut && timeoutWasNotTriggered { + if self.promise.resolveResult(.blockedRunLoop) { + CFRunLoopStop(CFRunLoopGetMain()) + } + } + } + return self + } + + /// Blocks for an asynchronous result. + /// + /// @discussion + /// This function must be executed on the main thread and cannot be nested. This is because + /// this function (and it's related methods) coordinate through the main run loop. Tampering + /// with the run loop can cause undesirable behavior. + /// + /// This method will return an AwaitResult in the following cases: + /// + /// - The main run loop is blocked by other operations and the async expectation cannot be + /// be stopped. + /// - The async expectation timed out + /// - The async expectation succeeded + /// - The async expectation raised an unexpected exception (objc) + /// - The async expectation raised an unexpected error (swift) + /// + /// The returned AwaitResult will NEVER be .incomplete. + func wait(_ fnName: String = #function, file: FileString = #file, line: UInt = #line) -> AwaitResult { + waitLock.acquireWaitingLock( + fnName, + file: file, + line: line) + + let capture = NMBExceptionCapture(handler: ({ exception in + _ = self.promise.resolveResult(.raisedException(exception)) + }), finally: ({ + self.waitLock.releaseWaitingLock() + })) + capture.tryBlock { + do { + try self.trigger.start() + } catch let error { + _ = self.promise.resolveResult(.errorThrown(error)) + } + self.trigger.timeoutSource.resume() + while self.promise.asyncResult.isIncomplete() { + // Stopping the run loop does not work unless we run only 1 mode + #if (swift(>=4.2) && canImport(Darwin)) || compiler(>=5.0) + _ = RunLoop.current.run(mode: .default, before: .distantFuture) + #else + _ = RunLoop.current.run(mode: .defaultRunLoopMode, before: .distantFuture) + #endif + } + + self.trigger.timeoutSource.cancel() + if let asyncSource = self.trigger.actionSource { + asyncSource.cancel() + } + } + + return promise.asyncResult + } +} + +internal class Awaiter { + let waitLock: WaitLock + let timeoutQueue: DispatchQueue + let asyncQueue: DispatchQueue + + internal init( + waitLock: WaitLock, + asyncQueue: DispatchQueue, + timeoutQueue: DispatchQueue) { + self.waitLock = waitLock + self.asyncQueue = asyncQueue + self.timeoutQueue = timeoutQueue + } + + private func createTimerSource(_ queue: DispatchQueue) -> DispatchSourceTimer { + return DispatchSource.makeTimerSource(flags: .strict, queue: queue) + } + + func performBlock( + file: FileString, + line: UInt, + _ closure: @escaping (@escaping (T) -> Void) throws -> Void + ) -> AwaitPromiseBuilder { + let promise = AwaitPromise() + let timeoutSource = createTimerSource(timeoutQueue) + var completionCount = 0 + let trigger = AwaitTrigger(timeoutSource: timeoutSource, actionSource: nil) { + try closure { + completionCount += 1 + if completionCount < 2 { + if promise.resolveResult(.completed($0)) { + CFRunLoopStop(CFRunLoopGetMain()) + } + } else { + fail("waitUntil(..) expects its completion closure to be only called once", + file: file, line: line) + } + } + } + + return AwaitPromiseBuilder( + awaiter: self, + waitLock: waitLock, + promise: promise, + trigger: trigger) + } + + func poll(_ pollInterval: TimeInterval, closure: @escaping () throws -> T?) -> AwaitPromiseBuilder { + let promise = AwaitPromise() + let timeoutSource = createTimerSource(timeoutQueue) + let asyncSource = createTimerSource(asyncQueue) + let trigger = AwaitTrigger(timeoutSource: timeoutSource, actionSource: asyncSource) { + let interval = DispatchTimeInterval.nanoseconds(Int(pollInterval * TimeInterval(NSEC_PER_SEC))) + asyncSource.schedule(deadline: .now(), repeating: interval, leeway: pollLeeway) + asyncSource.setEventHandler { + do { + if let result = try closure() { + if promise.resolveResult(.completed(result)) { + CFRunLoopStop(CFRunLoopGetCurrent()) + } + } + } catch let error { + if promise.resolveResult(.errorThrown(error)) { + CFRunLoopStop(CFRunLoopGetCurrent()) + } + } + } + asyncSource.resume() + } + + return AwaitPromiseBuilder( + awaiter: self, + waitLock: waitLock, + promise: promise, + trigger: trigger) + } +} + +internal func pollBlock( + pollInterval: TimeInterval, + timeoutInterval: TimeInterval, + file: FileString, + line: UInt, + fnName: String = #function, + expression: @escaping () throws -> Bool) -> AwaitResult { + let awaiter = NimbleEnvironment.activeInstance.awaiter + let result = awaiter.poll(pollInterval) { () throws -> Bool? in + if try expression() { + return true + } + return nil + }.timeout(timeoutInterval, forcefullyAbortTimeout: timeoutInterval / 2.0).wait(fnName, file: file, line: line) + + return result +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Utils/Errors.swift b/Example/Pods/Nimble/Sources/Nimble/Utils/Errors.swift new file mode 100644 index 0000000..074cb20 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Utils/Errors.swift @@ -0,0 +1,59 @@ +import Foundation + +// Generic + +internal func setFailureMessageForError( + _ failureMessage: FailureMessage, + postfixMessageVerb: String = "throw", + actualError: Error?, + error: T? = nil, + errorType: T.Type? = nil, + closure: ((T) -> Void)? = nil) { + failureMessage.postfixMessage = "\(postfixMessageVerb) error" + + if let error = error { + failureMessage.postfixMessage += " <\(error)>" + } else if errorType != nil || closure != nil { + failureMessage.postfixMessage += " from type <\(T.self)>" + } + if closure != nil { + failureMessage.postfixMessage += " that satisfies block" + } + if error == nil && errorType == nil && closure == nil { + failureMessage.postfixMessage = "\(postfixMessageVerb) any error" + } + + if let actualError = actualError { + failureMessage.actualValue = "<\(actualError)>" + } else { + failureMessage.actualValue = "no error" + } +} + +internal func errorMatchesExpectedError( + _ actualError: Error, + expectedError: T) -> Bool { + return actualError._domain == expectedError._domain + && actualError._code == expectedError._code +} + +// Non-generic + +internal func setFailureMessageForError( + _ failureMessage: FailureMessage, + actualError: Error?, + closure: ((Error) -> Void)?) { + failureMessage.postfixMessage = "throw error" + + if closure != nil { + failureMessage.postfixMessage += " that satisfies block" + } else { + failureMessage.postfixMessage = "throw any error" + } + + if let actualError = actualError { + failureMessage.actualValue = "<\(actualError)>" + } else { + failureMessage.actualValue = "no error" + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Utils/Functional.swift b/Example/Pods/Nimble/Sources/Nimble/Utils/Functional.swift new file mode 100644 index 0000000..c87af76 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Utils/Functional.swift @@ -0,0 +1,14 @@ +import Foundation + +#if !swift(>=4.2) +extension Sequence { + internal func allSatisfy(_ predicate: (Element) throws -> Bool) rethrows -> Bool { + for item in self { + if try !predicate(item) { + return false + } + } + return true + } +} +#endif diff --git a/Example/Pods/Nimble/Sources/Nimble/Utils/SourceLocation.swift b/Example/Pods/Nimble/Sources/Nimble/Utils/SourceLocation.swift new file mode 100644 index 0000000..4e37aef --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Utils/SourceLocation.swift @@ -0,0 +1,31 @@ +import Foundation + +// Ideally we would always use `StaticString` as the type for tracking the file name +// that expectations originate from, for consistency with `assert` etc. from the +// stdlib, and because recent versions of the XCTest overlay require `StaticString` +// when calling `XCTFail`. Under the Objective-C runtime (i.e. building on Mac), we +// have to use `String` instead because StaticString can't be generated from Objective-C +#if SWIFT_PACKAGE +public typealias FileString = StaticString +#else +public typealias FileString = String +#endif + +public final class SourceLocation: NSObject { + public let file: FileString + public let line: UInt + + override init() { + file = "Unknown File" + line = 0 + } + + init(file: FileString, line: UInt) { + self.file = file + self.line = line + } + + override public var description: String { + return "\(file):\(line)" + } +} diff --git a/Example/Pods/Nimble/Sources/Nimble/Utils/Stringers.swift b/Example/Pods/Nimble/Sources/Nimble/Utils/Stringers.swift new file mode 100644 index 0000000..7caea26 --- /dev/null +++ b/Example/Pods/Nimble/Sources/Nimble/Utils/Stringers.swift @@ -0,0 +1,196 @@ +import Foundation + +internal func identityAsString(_ value: Any?) -> String { + let anyObject = value as AnyObject? + if let value = anyObject { + return NSString(format: "<%p>", unsafeBitCast(value, to: Int.self)).description + } else { + return "nil" + } +} + +internal func arrayAsString(_ items: [T], joiner: String = ", ") -> String { + return items.reduce("") { accum, item in + let prefix = (accum.isEmpty ? "" : joiner) + return accum + prefix + "\(stringify(item))" + } +} + +/// A type with a customized test output text representation. +/// +/// This textual representation is produced when values will be +/// printed in test runs, and may be useful when producing +/// error messages in custom matchers. +/// +/// - SeeAlso: `CustomDebugStringConvertible` +public protocol TestOutputStringConvertible { + var testDescription: String { get } +} + +extension Double: TestOutputStringConvertible { + public var testDescription: String { + return NSNumber(value: self).testDescription + } +} + +extension Float: TestOutputStringConvertible { + public var testDescription: String { + return NSNumber(value: self).testDescription + } +} + +extension NSNumber: TestOutputStringConvertible { + // This is using `NSString(format:)` instead of + // `String(format:)` because the latter somehow breaks + // the travis CI build on linux. + public var testDescription: String { + let description = self.description + + if description.contains(".") { + // Travis linux swiftpm build doesn't like casting String to NSString, + // which is why this annoying nested initializer thing is here. + // Maybe this will change in a future snapshot. + let decimalPlaces = NSString(string: NSString(string: description) + .components(separatedBy: ".")[1]) + + // SeeAlso: https://bugs.swift.org/browse/SR-1464 + switch decimalPlaces.length { + case 1: + return NSString(format: "%0.1f", self.doubleValue).description + case 2: + return NSString(format: "%0.2f", self.doubleValue).description + case 3: + return NSString(format: "%0.3f", self.doubleValue).description + default: + return NSString(format: "%0.4f", self.doubleValue).description + } + } + return self.description + } +} + +extension Array: TestOutputStringConvertible { + public var testDescription: String { + let list = self.map(Nimble.stringify).joined(separator: ", ") + return "[\(list)]" + } +} + +extension AnySequence: TestOutputStringConvertible { + public var testDescription: String { + let generator = self.makeIterator() + var strings = [String]() + var value: AnySequence.Iterator.Element? + + repeat { + value = generator.next() + if let value = value { + strings.append(stringify(value)) + } + } while value != nil + + let list = strings.joined(separator: ", ") + return "[\(list)]" + } +} + +extension NSArray: TestOutputStringConvertible { + public var testDescription: String { + let list = Array(self).map(Nimble.stringify).joined(separator: ", ") + return "(\(list))" + } +} + +extension NSIndexSet: TestOutputStringConvertible { + public var testDescription: String { + let list = Array(self).map(Nimble.stringify).joined(separator: ", ") + return "(\(list))" + } +} + +extension String: TestOutputStringConvertible { + public var testDescription: String { + return self + } +} + +extension Data: TestOutputStringConvertible { + public var testDescription: String { + return "Data" + } +} + +/// +/// Returns a string appropriate for displaying in test output +/// from the provided value. +/// +/// - parameter value: A value that will show up in a test's output. +/// +/// - returns: The string that is returned can be +/// customized per type by conforming a type to the `TestOutputStringConvertible` +/// protocol. When stringifying a non-`TestOutputStringConvertible` type, this +/// function will return the value's debug description and then its +/// normal description if available and in that order. Otherwise it +/// will return the result of constructing a string from the value. +/// +/// - SeeAlso: `TestOutputStringConvertible` +public func stringify(_ value: T?) -> String { + guard let value = value else { return "nil" } + + if let value = value as? TestOutputStringConvertible { + return value.testDescription + } + + if let value = value as? CustomDebugStringConvertible { + return value.debugDescription + } + + return String(describing: value) +} + +#if canImport(Darwin) +@objc public class NMBStringer: NSObject { + @objc public class func stringify(_ obj: Any?) -> String { + return Nimble.stringify(obj) + } +} +#endif + +// MARK: Collection Type Stringers + +/// Attempts to generate a pretty type string for a given value. If the value is of a Objective-C +/// collection type, or a subclass thereof, (e.g. `NSArray`, `NSDictionary`, etc.). +/// This function will return the type name of the root class of the class cluster for better +/// readability (e.g. `NSArray` instead of `__NSArrayI`). +/// +/// For values that don't have a type of an Objective-C collection, this function returns the +/// default type description. +/// +/// - parameter value: A value that will be used to determine a type name. +/// +/// - returns: The name of the class cluster root class for Objective-C collection types, or the +/// the `dynamicType` of the value for values of any other type. +public func prettyCollectionType(_ value: T) -> String { + switch value { + case is NSArray: + return String(describing: NSArray.self) + case is NSDictionary: + return String(describing: NSDictionary.self) + case is NSSet: + return String(describing: NSSet.self) + case is NSIndexSet: + return String(describing: NSIndexSet.self) + default: + return String(describing: value) + } +} + +/// Returns the type name for a given collection type. This overload is used by Swift +/// collection types. +/// +/// - parameter collection: A Swift `CollectionType` value. +/// +/// - returns: A string representing the `dynamicType` of the value. +public func prettyCollectionType(_ collection: T) -> String { + return String(describing: type(of: collection)) +} diff --git a/Example/Pods/Nimble/Sources/NimbleObjectiveC/DSL.h b/Example/Pods/Nimble/Sources/NimbleObjectiveC/DSL.h new file mode 100644 index 0000000..9170541 --- /dev/null +++ b/Example/Pods/Nimble/Sources/NimbleObjectiveC/DSL.h @@ -0,0 +1,389 @@ +#import + +@class NMBExpectation; +@class NMBObjCBeCloseToMatcher; +@class NMBObjCRaiseExceptionMatcher; +@protocol NMBMatcher; + + +NS_ASSUME_NONNULL_BEGIN + + +#define NIMBLE_OVERLOADABLE __attribute__((overloadable)) +#define NIMBLE_EXPORT FOUNDATION_EXPORT +#define NIMBLE_EXPORT_INLINE FOUNDATION_STATIC_INLINE + +#define NIMBLE_VALUE_OF(VAL) ({ \ + __typeof__((VAL)) val = (VAL); \ + [NSValue valueWithBytes:&val objCType:@encode(__typeof__((VAL)))]; \ +}) + +#ifdef NIMBLE_DISABLE_SHORT_SYNTAX +#define NIMBLE_SHORT(PROTO, ORIGINAL) +#define NIMBLE_SHORT_OVERLOADED(PROTO, ORIGINAL) +#else +#define NIMBLE_SHORT(PROTO, ORIGINAL) FOUNDATION_STATIC_INLINE PROTO { return (ORIGINAL); } +#define NIMBLE_SHORT_OVERLOADED(PROTO, ORIGINAL) FOUNDATION_STATIC_INLINE NIMBLE_OVERLOADABLE PROTO { return (ORIGINAL); } +#endif + + + +#define DEFINE_NMB_EXPECT_OVERLOAD(TYPE, EXPR) \ + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE \ + NMBExpectation *NMB_expect(TYPE(^actualBlock)(void), NSString *file, NSUInteger line) { \ + return NMB_expect(^id { return EXPR; }, file, line); \ + } + + NIMBLE_EXPORT NIMBLE_OVERLOADABLE + NMBExpectation *NMB_expect(id(^actualBlock)(void), NSString *file, NSUInteger line); + + // overloaded dispatch for nils - expect(nil) + DEFINE_NMB_EXPECT_OVERLOAD(void*, nil) + DEFINE_NMB_EXPECT_OVERLOAD(NSRange, NIMBLE_VALUE_OF(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(long, @(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(unsigned long, @(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(int, @(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(unsigned int, @(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(float, @(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(double, @(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(long long, @(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(unsigned long long, @(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(char, @(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(unsigned char, @(actualBlock())) + // bool doesn't get the compiler to dispatch to BOOL types, but using BOOL here seems to allow + // the compiler to dispatch to bool. + DEFINE_NMB_EXPECT_OVERLOAD(BOOL, @(actualBlock())) + DEFINE_NMB_EXPECT_OVERLOAD(char *, @(actualBlock())) + + +#undef DEFINE_NMB_EXPECT_OVERLOAD + + + +NIMBLE_EXPORT NMBExpectation *NMB_expectAction(void(^actualBlock)(void), NSString *file, NSUInteger line); + + + +#define DEFINE_OVERLOAD(TYPE, EXPR) \ + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE \ + id NMB_equal(TYPE expectedValue) { \ + return NMB_equal((EXPR)); \ + } \ + NIMBLE_SHORT_OVERLOADED(id equal(TYPE expectedValue), NMB_equal(expectedValue)); + + + NIMBLE_EXPORT NIMBLE_OVERLOADABLE + id NMB_equal(__nullable id expectedValue); + + NIMBLE_SHORT_OVERLOADED(id equal(__nullable id expectedValue), + NMB_equal(expectedValue)); + + // overloaded dispatch for nils - expect(nil) + DEFINE_OVERLOAD(void*__nullable, (id)nil) + DEFINE_OVERLOAD(NSRange, NIMBLE_VALUE_OF(expectedValue)) + DEFINE_OVERLOAD(long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long, @(expectedValue)) + DEFINE_OVERLOAD(int, @(expectedValue)) + DEFINE_OVERLOAD(unsigned int, @(expectedValue)) + DEFINE_OVERLOAD(float, @(expectedValue)) + DEFINE_OVERLOAD(double, @(expectedValue)) + DEFINE_OVERLOAD(long long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long long, @(expectedValue)) + DEFINE_OVERLOAD(char, @(expectedValue)) + DEFINE_OVERLOAD(unsigned char, @(expectedValue)) + // bool doesn't get the compiler to dispatch to BOOL types, but using BOOL here seems to allow + // the compiler to dispatch to bool. + DEFINE_OVERLOAD(BOOL, @(expectedValue)) + DEFINE_OVERLOAD(char *, @(expectedValue)) + +#undef DEFINE_OVERLOAD + + +#define DEFINE_OVERLOAD(TYPE, EXPR) \ + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE \ + id NMB_haveCount(TYPE expectedValue) { \ + return NMB_haveCount((EXPR)); \ + } \ + NIMBLE_SHORT_OVERLOADED(id haveCount(TYPE expectedValue), \ + NMB_haveCount(expectedValue)); + + + NIMBLE_EXPORT NIMBLE_OVERLOADABLE + id NMB_haveCount(id expectedValue); + + NIMBLE_SHORT_OVERLOADED(id haveCount(id expectedValue), + NMB_haveCount(expectedValue)); + + DEFINE_OVERLOAD(long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long, @(expectedValue)) + DEFINE_OVERLOAD(int, @(expectedValue)) + DEFINE_OVERLOAD(unsigned int, @(expectedValue)) + DEFINE_OVERLOAD(long long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long long, @(expectedValue)) + DEFINE_OVERLOAD(char, @(expectedValue)) + DEFINE_OVERLOAD(unsigned char, @(expectedValue)) + +#undef DEFINE_OVERLOAD + +#define DEFINE_OVERLOAD(TYPE, EXPR) \ + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE \ + NMBObjCBeCloseToMatcher *NMB_beCloseTo(TYPE expectedValue) { \ + return NMB_beCloseTo((NSNumber *)(EXPR)); \ + } \ + NIMBLE_SHORT_OVERLOADED(NMBObjCBeCloseToMatcher *beCloseTo(TYPE expectedValue), \ + NMB_beCloseTo(expectedValue)); + + NIMBLE_EXPORT NIMBLE_OVERLOADABLE NMBObjCBeCloseToMatcher *NMB_beCloseTo(NSNumber *expectedValue); + NIMBLE_SHORT_OVERLOADED(NMBObjCBeCloseToMatcher *beCloseTo(NSNumber *expectedValue), + NMB_beCloseTo(expectedValue)); + + // it would be better to only overload float & double, but zero becomes ambigious + + DEFINE_OVERLOAD(long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long, @(expectedValue)) + DEFINE_OVERLOAD(int, @(expectedValue)) + DEFINE_OVERLOAD(unsigned int, @(expectedValue)) + DEFINE_OVERLOAD(float, @(expectedValue)) + DEFINE_OVERLOAD(double, @(expectedValue)) + DEFINE_OVERLOAD(long long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long long, @(expectedValue)) + DEFINE_OVERLOAD(char, @(expectedValue)) + DEFINE_OVERLOAD(unsigned char, @(expectedValue)) + +#undef DEFINE_OVERLOAD + +NIMBLE_EXPORT id NMB_beAnInstanceOf(Class expectedClass); +NIMBLE_EXPORT_INLINE id beAnInstanceOf(Class expectedClass) { + return NMB_beAnInstanceOf(expectedClass); +} + +NIMBLE_EXPORT id NMB_beAKindOf(Class expectedClass); +NIMBLE_EXPORT_INLINE id beAKindOf(Class expectedClass) { + return NMB_beAKindOf(expectedClass); +} + +NIMBLE_EXPORT id NMB_beginWith(id itemElementOrSubstring); +NIMBLE_EXPORT_INLINE id beginWith(id itemElementOrSubstring) { + return NMB_beginWith(itemElementOrSubstring); +} + +#define DEFINE_OVERLOAD(TYPE, EXPR) \ + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE \ + id NMB_beGreaterThan(TYPE expectedValue) { \ + return NMB_beGreaterThan((EXPR)); \ + } \ + NIMBLE_SHORT_OVERLOADED(id beGreaterThan(TYPE expectedValue), NMB_beGreaterThan(expectedValue)); + + NIMBLE_EXPORT NIMBLE_OVERLOADABLE + id NMB_beGreaterThan(NSNumber *expectedValue); + + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE + id beGreaterThan(NSNumber *expectedValue) { + return NMB_beGreaterThan(expectedValue); + } + + DEFINE_OVERLOAD(long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long, @(expectedValue)) + DEFINE_OVERLOAD(int, @(expectedValue)) + DEFINE_OVERLOAD(unsigned int, @(expectedValue)) + DEFINE_OVERLOAD(float, @(expectedValue)) + DEFINE_OVERLOAD(double, @(expectedValue)) + DEFINE_OVERLOAD(long long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long long, @(expectedValue)) + DEFINE_OVERLOAD(char, @(expectedValue)) + DEFINE_OVERLOAD(unsigned char, @(expectedValue)) + +#undef DEFINE_OVERLOAD + +#define DEFINE_OVERLOAD(TYPE, EXPR) \ + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE \ + id NMB_beGreaterThanOrEqualTo(TYPE expectedValue) { \ + return NMB_beGreaterThanOrEqualTo((EXPR)); \ + } \ + NIMBLE_SHORT_OVERLOADED(id beGreaterThanOrEqualTo(TYPE expectedValue), \ + NMB_beGreaterThanOrEqualTo(expectedValue)); + + NIMBLE_EXPORT NIMBLE_OVERLOADABLE + id NMB_beGreaterThanOrEqualTo(NSNumber *expectedValue); + + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE + id beGreaterThanOrEqualTo(NSNumber *expectedValue) { + return NMB_beGreaterThanOrEqualTo(expectedValue); + } + + DEFINE_OVERLOAD(long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long, @(expectedValue)) + DEFINE_OVERLOAD(int, @(expectedValue)) + DEFINE_OVERLOAD(unsigned int, @(expectedValue)) + DEFINE_OVERLOAD(float, @(expectedValue)) + DEFINE_OVERLOAD(double, @(expectedValue)) + DEFINE_OVERLOAD(long long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long long, @(expectedValue)) + DEFINE_OVERLOAD(char, @(expectedValue)) + DEFINE_OVERLOAD(unsigned char, @(expectedValue)) + + +#undef DEFINE_OVERLOAD + +NIMBLE_EXPORT id NMB_beIdenticalTo(id expectedInstance); +NIMBLE_SHORT(id beIdenticalTo(id expectedInstance), + NMB_beIdenticalTo(expectedInstance)); + +NIMBLE_EXPORT id NMB_be(id expectedInstance); +NIMBLE_SHORT(id be(id expectedInstance), + NMB_be(expectedInstance)); + + +#define DEFINE_OVERLOAD(TYPE, EXPR) \ + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE \ + id NMB_beLessThan(TYPE expectedValue) { \ + return NMB_beLessThan((EXPR)); \ + } \ + NIMBLE_SHORT_OVERLOADED(id beLessThan(TYPE expectedValue), \ + NMB_beLessThan(expectedValue)); + + NIMBLE_EXPORT NIMBLE_OVERLOADABLE + id NMB_beLessThan(NSNumber *expectedValue); + + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE + id beLessThan(NSNumber *expectedValue) { + return NMB_beLessThan(expectedValue); + } + + DEFINE_OVERLOAD(long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long, @(expectedValue)) + DEFINE_OVERLOAD(int, @(expectedValue)) + DEFINE_OVERLOAD(unsigned int, @(expectedValue)) + DEFINE_OVERLOAD(float, @(expectedValue)) + DEFINE_OVERLOAD(double, @(expectedValue)) + DEFINE_OVERLOAD(long long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long long, @(expectedValue)) + DEFINE_OVERLOAD(char, @(expectedValue)) + DEFINE_OVERLOAD(unsigned char, @(expectedValue)) + +#undef DEFINE_OVERLOAD + + +#define DEFINE_OVERLOAD(TYPE, EXPR) \ + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE \ + id NMB_beLessThanOrEqualTo(TYPE expectedValue) { \ + return NMB_beLessThanOrEqualTo((EXPR)); \ + } \ + NIMBLE_SHORT_OVERLOADED(id beLessThanOrEqualTo(TYPE expectedValue), \ + NMB_beLessThanOrEqualTo(expectedValue)); + + + NIMBLE_EXPORT NIMBLE_OVERLOADABLE + id NMB_beLessThanOrEqualTo(NSNumber *expectedValue); + + NIMBLE_EXPORT_INLINE NIMBLE_OVERLOADABLE + id beLessThanOrEqualTo(NSNumber *expectedValue) { + return NMB_beLessThanOrEqualTo(expectedValue); + } + + DEFINE_OVERLOAD(long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long, @(expectedValue)) + DEFINE_OVERLOAD(int, @(expectedValue)) + DEFINE_OVERLOAD(unsigned int, @(expectedValue)) + DEFINE_OVERLOAD(float, @(expectedValue)) + DEFINE_OVERLOAD(double, @(expectedValue)) + DEFINE_OVERLOAD(long long, @(expectedValue)) + DEFINE_OVERLOAD(unsigned long long, @(expectedValue)) + DEFINE_OVERLOAD(char, @(expectedValue)) + DEFINE_OVERLOAD(unsigned char, @(expectedValue)) + +#undef DEFINE_OVERLOAD + +NIMBLE_EXPORT id NMB_beTruthy(void); +NIMBLE_SHORT(id beTruthy(void), + NMB_beTruthy()); + +NIMBLE_EXPORT id NMB_beFalsy(void); +NIMBLE_SHORT(id beFalsy(void), + NMB_beFalsy()); + +NIMBLE_EXPORT id NMB_beTrue(void); +NIMBLE_SHORT(id beTrue(void), + NMB_beTrue()); + +NIMBLE_EXPORT id NMB_beFalse(void); +NIMBLE_SHORT(id beFalse(void), + NMB_beFalse()); + +NIMBLE_EXPORT id NMB_beNil(void); +NIMBLE_SHORT(id beNil(void), + NMB_beNil()); + +NIMBLE_EXPORT id NMB_beEmpty(void); +NIMBLE_SHORT(id beEmpty(void), + NMB_beEmpty()); + +NIMBLE_EXPORT id NMB_containWithNilTermination(id itemOrSubstring, ...) NS_REQUIRES_NIL_TERMINATION; +#define NMB_contain(...) NMB_containWithNilTermination(__VA_ARGS__, nil) +#ifndef NIMBLE_DISABLE_SHORT_SYNTAX +#define contain(...) NMB_contain(__VA_ARGS__) +#endif + +NIMBLE_EXPORT id NMB_containElementSatisfying(BOOL(^predicate)(id)); +NIMBLE_SHORT(id containElementSatisfying(BOOL(^predicate)(id)), + NMB_containElementSatisfying(predicate)); + +NIMBLE_EXPORT id NMB_endWith(id itemElementOrSubstring); +NIMBLE_SHORT(id endWith(id itemElementOrSubstring), + NMB_endWith(itemElementOrSubstring)); + +NIMBLE_EXPORT NMBObjCRaiseExceptionMatcher *NMB_raiseException(void); +NIMBLE_SHORT(NMBObjCRaiseExceptionMatcher *raiseException(void), + NMB_raiseException()); + +NIMBLE_EXPORT id NMB_match(id expectedValue); +NIMBLE_SHORT(id match(id expectedValue), + NMB_match(expectedValue)); + +NIMBLE_EXPORT id NMB_allPass(id matcher); +NIMBLE_SHORT(id allPass(id matcher), + NMB_allPass(matcher)); + +NIMBLE_EXPORT id NMB_satisfyAnyOfWithMatchers(id matchers); +#define NMB_satisfyAnyOf(...) NMB_satisfyAnyOfWithMatchers(@[__VA_ARGS__]) +#ifndef NIMBLE_DISABLE_SHORT_SYNTAX +#define satisfyAnyOf(...) NMB_satisfyAnyOf(__VA_ARGS__) +#endif + +NIMBLE_EXPORT id NMB_satisfyAllOfWithMatchers(id matchers); +#define NMB_satisfyAllOf(...) NMB_satisfyAllOfWithMatchers(@[__VA_ARGS__]) +#ifndef NIMBLE_DISABLE_SHORT_SYNTAX +#define satisfyAllOf(...) NMB_satisfyAllOf(__VA_ARGS__) +#endif + +// In order to preserve breakpoint behavior despite using macros to fill in __FILE__ and __LINE__, +// define a builder that populates __FILE__ and __LINE__, and returns a block that takes timeout +// and action arguments. See https://github.com/Quick/Quick/pull/185 for details. +typedef void (^NMBWaitUntilTimeoutBlock)(NSTimeInterval timeout, void (^action)(void (^)(void))); +typedef void (^NMBWaitUntilBlock)(void (^action)(void (^)(void))); + +NIMBLE_EXPORT void NMB_failWithMessage(NSString *msg, NSString *file, NSUInteger line); + +NIMBLE_EXPORT NMBWaitUntilTimeoutBlock NMB_waitUntilTimeoutBuilder(NSString *file, NSUInteger line); +NIMBLE_EXPORT NMBWaitUntilBlock NMB_waitUntilBuilder(NSString *file, NSUInteger line); + +NIMBLE_EXPORT void NMB_failWithMessage(NSString *msg, NSString *file, NSUInteger line); + +#define NMB_waitUntilTimeout NMB_waitUntilTimeoutBuilder(@(__FILE__), __LINE__) +#define NMB_waitUntil NMB_waitUntilBuilder(@(__FILE__), __LINE__) + +#ifndef NIMBLE_DISABLE_SHORT_SYNTAX +#define expect(...) NMB_expect(^{ return (__VA_ARGS__); }, @(__FILE__), __LINE__) +#define expectAction(BLOCK) NMB_expectAction((BLOCK), @(__FILE__), __LINE__) +#define failWithMessage(msg) NMB_failWithMessage(msg, @(__FILE__), __LINE__) +#define fail() failWithMessage(@"fail() always fails") + + +#define waitUntilTimeout NMB_waitUntilTimeout +#define waitUntil NMB_waitUntil + +#undef NIMBLE_VALUE_OF + +#endif + +NS_ASSUME_NONNULL_END diff --git a/Example/Pods/Nimble/Sources/NimbleObjectiveC/DSL.m b/Example/Pods/Nimble/Sources/NimbleObjectiveC/DSL.m new file mode 100644 index 0000000..670415b --- /dev/null +++ b/Example/Pods/Nimble/Sources/NimbleObjectiveC/DSL.m @@ -0,0 +1,161 @@ +#import + +#if __has_include("Nimble-Swift.h") +#import "Nimble-Swift.h" +#else +#import +#endif + + +NS_ASSUME_NONNULL_BEGIN + + +NIMBLE_EXPORT NIMBLE_OVERLOADABLE NMBExpectation *__nonnull NMB_expect(id __nullable(^actualBlock)(void), NSString *__nonnull file, NSUInteger line) { + return [[NMBExpectation alloc] initWithActualBlock:actualBlock + negative:NO + file:file + line:line]; +} + +NIMBLE_EXPORT NMBExpectation *NMB_expectAction(void(^actualBlock)(void), NSString *file, NSUInteger line) { + return NMB_expect(^id{ + actualBlock(); + return nil; + }, file, line); +} + +NIMBLE_EXPORT void NMB_failWithMessage(NSString *msg, NSString *file, NSUInteger line) { + return [NMBExpectation failWithMessage:msg file:file line:line]; +} + +NIMBLE_EXPORT id NMB_beAnInstanceOf(Class expectedClass) { + return [NMBObjCMatcher beAnInstanceOfMatcher:expectedClass]; +} + +NIMBLE_EXPORT id NMB_beAKindOf(Class expectedClass) { + return [NMBObjCMatcher beAKindOfMatcher:expectedClass]; +} + +NIMBLE_EXPORT NIMBLE_OVERLOADABLE NMBObjCBeCloseToMatcher *NMB_beCloseTo(NSNumber *expectedValue) { + return [NMBObjCMatcher beCloseToMatcher:expectedValue within:0.001]; +} + +NIMBLE_EXPORT id NMB_beginWith(id itemElementOrSubstring) { + return [NMBObjCMatcher beginWithMatcher:itemElementOrSubstring]; +} + +NIMBLE_EXPORT NIMBLE_OVERLOADABLE id NMB_beGreaterThan(NSNumber *expectedValue) { + return [NMBObjCMatcher beGreaterThanMatcher:expectedValue]; +} + +NIMBLE_EXPORT NIMBLE_OVERLOADABLE id NMB_beGreaterThanOrEqualTo(NSNumber *expectedValue) { + return [NMBObjCMatcher beGreaterThanOrEqualToMatcher:expectedValue]; +} + +NIMBLE_EXPORT id NMB_beIdenticalTo(id expectedInstance) { + return [NMBObjCMatcher beIdenticalToMatcher:expectedInstance]; +} + +NIMBLE_EXPORT id NMB_be(id expectedInstance) { + return [NMBObjCMatcher beIdenticalToMatcher:expectedInstance]; +} + +NIMBLE_EXPORT NIMBLE_OVERLOADABLE id NMB_beLessThan(NSNumber *expectedValue) { + return [NMBObjCMatcher beLessThanMatcher:expectedValue]; +} + +NIMBLE_EXPORT NIMBLE_OVERLOADABLE id NMB_beLessThanOrEqualTo(NSNumber *expectedValue) { + return [NMBObjCMatcher beLessThanOrEqualToMatcher:expectedValue]; +} + +NIMBLE_EXPORT id NMB_beTruthy() { + return [NMBObjCMatcher beTruthyMatcher]; +} + +NIMBLE_EXPORT id NMB_beFalsy() { + return [NMBObjCMatcher beFalsyMatcher]; +} + +NIMBLE_EXPORT id NMB_beTrue() { + return [NMBObjCMatcher beTrueMatcher]; +} + +NIMBLE_EXPORT id NMB_beFalse() { + return [NMBObjCMatcher beFalseMatcher]; +} + +NIMBLE_EXPORT id NMB_beNil() { + return [NMBObjCMatcher beNilMatcher]; +} + +NIMBLE_EXPORT id NMB_beEmpty() { + return [NMBObjCMatcher beEmptyMatcher]; +} + +NIMBLE_EXPORT id NMB_containWithNilTermination(id itemOrSubstring, ...) { + NSMutableArray *itemOrSubstringArray = [NSMutableArray array]; + + if (itemOrSubstring) { + [itemOrSubstringArray addObject:itemOrSubstring]; + + va_list args; + va_start(args, itemOrSubstring); + id next; + while ((next = va_arg(args, id))) { + [itemOrSubstringArray addObject:next]; + } + va_end(args); + } + + return [NMBObjCMatcher containMatcher:itemOrSubstringArray]; +} + +NIMBLE_EXPORT id NMB_containElementSatisfying(BOOL(^predicate)(id)) { + return [NMBObjCMatcher containElementSatisfyingMatcher:predicate]; +} + +NIMBLE_EXPORT id NMB_endWith(id itemElementOrSubstring) { + return [NMBObjCMatcher endWithMatcher:itemElementOrSubstring]; +} + +NIMBLE_EXPORT NIMBLE_OVERLOADABLE id NMB_equal(__nullable id expectedValue) { + return [NMBObjCMatcher equalMatcher:expectedValue]; +} + +NIMBLE_EXPORT NIMBLE_OVERLOADABLE id NMB_haveCount(id expectedValue) { + return [NMBObjCMatcher haveCountMatcher:expectedValue]; +} + +NIMBLE_EXPORT id NMB_match(id expectedValue) { + return [NMBObjCMatcher matchMatcher:expectedValue]; +} + +NIMBLE_EXPORT id NMB_allPass(id expectedValue) { + return [NMBObjCMatcher allPassMatcher:expectedValue]; +} + +NIMBLE_EXPORT id NMB_satisfyAnyOfWithMatchers(id matchers) { + return [NMBObjCMatcher satisfyAnyOfMatcher:matchers]; +} + +NIMBLE_EXPORT id NMB_satisfyAllOfWithMatchers(id matchers) { + return [NMBObjCMatcher satisfyAllOfMatcher:matchers]; +} + +NIMBLE_EXPORT NMBObjCRaiseExceptionMatcher *NMB_raiseException() { + return [NMBObjCMatcher raiseExceptionMatcher]; +} + +NIMBLE_EXPORT NMBWaitUntilTimeoutBlock NMB_waitUntilTimeoutBuilder(NSString *file, NSUInteger line) { + return ^(NSTimeInterval timeout, void (^ _Nonnull action)(void (^ _Nonnull)(void))) { + [NMBWait untilTimeout:timeout file:file line:line action:action]; + }; +} + +NIMBLE_EXPORT NMBWaitUntilBlock NMB_waitUntilBuilder(NSString *file, NSUInteger line) { + return ^(void (^ _Nonnull action)(void (^ _Nonnull)(void))) { + [NMBWait untilFile:file line:line action:action]; + }; +} + +NS_ASSUME_NONNULL_END diff --git a/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.h b/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.h new file mode 100644 index 0000000..e6e0272 --- /dev/null +++ b/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.h @@ -0,0 +1,11 @@ +#import +#import + +@interface NMBExceptionCapture : NSObject + +- (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)(void))finally; +- (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock NS_SWIFT_NAME(tryBlock(_:)); + +@end + +typedef void(^NMBSourceCallbackBlock)(BOOL successful); diff --git a/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.m b/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.m new file mode 100644 index 0000000..52684b7 --- /dev/null +++ b/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBExceptionCapture.m @@ -0,0 +1,35 @@ +#import "NMBExceptionCapture.h" + +@interface NMBExceptionCapture () +@property (nonatomic, copy) void(^ _Nullable handler)(NSException * _Nullable); +@property (nonatomic, copy) void(^ _Nullable finally)(void); +@end + +@implementation NMBExceptionCapture + +- (nonnull instancetype)initWithHandler:(void(^ _Nullable)(NSException * _Nonnull))handler finally:(void(^ _Nullable)(void))finally { + self = [super init]; + if (self) { + self.handler = handler; + self.finally = finally; + } + return self; +} + +- (void)tryBlock:(__attribute__((noescape)) void(^ _Nonnull)(void))unsafeBlock { + @try { + unsafeBlock(); + } + @catch (NSException *exception) { + if (self.handler) { + self.handler(exception); + } + } + @finally { + if (self.finally) { + self.finally(); + } + } +} + +@end diff --git a/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.h b/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.h new file mode 100644 index 0000000..7938bca --- /dev/null +++ b/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.h @@ -0,0 +1,18 @@ +@class NSString; + +/** + * Returns a string appropriate for displaying in test output + * from the provided value. + * + * @param anyObject A value that will show up in a test's output. + * + * @return The string that is returned can be + * customized per type by conforming a type to the `TestOutputStringConvertible` + * protocol. When stringifying a non-`TestOutputStringConvertible` type, this + * function will return the value's debug description and then its + * normal description if available and in that order. Otherwise it + * will return the result of constructing a string from the value. + * + * @see `TestOutputStringConvertible` + */ +extern NSString *_Nonnull NMBStringify(id _Nullable anyObject) __attribute__((warn_unused_result)); diff --git a/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.m b/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.m new file mode 100644 index 0000000..31a80d6 --- /dev/null +++ b/Example/Pods/Nimble/Sources/NimbleObjectiveC/NMBStringify.m @@ -0,0 +1,11 @@ +#import "NMBStringify.h" + +#if __has_include("Nimble-Swift.h") +#import "Nimble-Swift.h" +#else +#import +#endif + +NSString *_Nonnull NMBStringify(id _Nullable anyObject) { + return [NMBStringer stringify:anyObject]; +} diff --git a/Example/Pods/Nimble/Sources/NimbleObjectiveC/XCTestObservationCenter+Register.m b/Example/Pods/Nimble/Sources/NimbleObjectiveC/XCTestObservationCenter+Register.m new file mode 100644 index 0000000..fa5030a --- /dev/null +++ b/Example/Pods/Nimble/Sources/NimbleObjectiveC/XCTestObservationCenter+Register.m @@ -0,0 +1,83 @@ +#import +#import + +#if __has_include("Nimble-Swift.h") +#import "Nimble-Swift.h" +#else +#import +#endif + +#pragma mark - Method Swizzling + +/// Swaps the implementations between two instance methods. +/// +/// @param class The class containing `originalSelector`. +/// @param originalSelector Original method to replace. +/// @param replacementSelector Replacement method. +void swizzleSelectors(Class class, SEL originalSelector, SEL replacementSelector) { + Method originalMethod = class_getInstanceMethod(class, originalSelector); + Method replacementMethod = class_getInstanceMethod(class, replacementSelector); + + BOOL didAddMethod = + class_addMethod(class, + originalSelector, + method_getImplementation(replacementMethod), + method_getTypeEncoding(replacementMethod)); + + if (didAddMethod) { + class_replaceMethod(class, + replacementSelector, + method_getImplementation(originalMethod), + method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, replacementMethod); + } +} + +#pragma mark - Private + +@interface XCTestObservationCenter (Private) +- (void)_addLegacyTestObserver:(id)observer; +@end + +@implementation XCTestObservationCenter (Register) + +/// Uses objc method swizzling to register `CurrentTestCaseTracker` as a test observer. This is necessary +/// because Xcode 7.3 introduced timing issues where if a custom `XCTestObservation` is registered too early +/// it suppresses all console output (generated by `XCTestLog`), breaking any tools that depend on this output. +/// This approach waits to register our custom test observer until XCTest adds its first "legacy" observer, +/// falling back to registering after the first normal observer if this private method ever changes. ++ (void)load { + if (class_getInstanceMethod([self class], @selector(_addLegacyTestObserver:))) { + // Swizzle -_addLegacyTestObserver: + swizzleSelectors([self class], @selector(_addLegacyTestObserver:), @selector(NMB_original__addLegacyTestObserver:)); + } else { + // Swizzle -addTestObserver:, only if -_addLegacyTestObserver: is not implemented + swizzleSelectors([self class], @selector(addTestObserver:), @selector(NMB_original_addTestObserver:)); + } +} + +#pragma mark - Replacement Methods + +/// Registers `CurrentTestCaseTracker` as a test observer after `XCTestLog` has been added. +- (void)NMB_original__addLegacyTestObserver:(id)observer { + [self NMB_original__addLegacyTestObserver:observer]; + + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self addTestObserver:[CurrentTestCaseTracker sharedInstance]]; + }); +} + +/// Registers `CurrentTestCaseTracker` as a test observer after `XCTestLog` has been added. +/// This method is only used if `-_addLegacyTestObserver:` is not impelemented. (added in Xcode 7.3) +- (void)NMB_original_addTestObserver:(id)observer { + [self NMB_original_addTestObserver:observer]; + + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + [self NMB_original_addTestObserver:[CurrentTestCaseTracker sharedInstance]]; + }); +} + +@end diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj index 6726d83..d715c89 100644 --- a/Example/Pods/Pods.xcodeproj/project.pbxproj +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -7,1467 +7,1961 @@ objects = { /* Begin PBXBuildFile section */ - 032E47F62AE062F29029512E8E534717 /* Poll.swift in Sources */ = {isa = PBXBuildFile; fileRef = 768B106CF8116EDB0C6830AF7F4EEF1B /* Poll.swift */; }; - 066563795376AFDFB39F4EC98CB4B129 /* NMBExceptionCapture.h in Headers */ = {isa = PBXBuildFile; fileRef = B068DA44A3F9A0CCBE7CCE98CAF09C32 /* NMBExceptionCapture.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 08C51942CC4D09E0656E126FC5941299 /* QuickSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 802AAD1D90891718BB823EDA010ECE09 /* QuickSpec.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 11F86D4E8971E192FAD1F2A6F5AB3249 /* BeAnInstanceOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65EE5D01998D0C315455F137386476DA /* BeAnInstanceOf.swift */; }; - 14D83FFF42F4DB5F5BD0EEFA3317E467 /* OuputStreams.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1BCAA70F3D0609272B4012AA37D0FEF /* OuputStreams.swift */; }; - 16E3695680CE40DED7AACD165F417758 /* BeAKindOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79D25D06CF4A364C27B940631A4F4101 /* BeAKindOf.swift */; }; - 1A53D3AAD5D6B836FDD26C7FE89C0C33 /* BeLogical.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8ACBD62C4BCA19645C0D09AE0643CFA9 /* BeLogical.swift */; }; - 1B39E248E790BCED2E47B22A615333FF /* HealthKitDataImporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE217CBE45F36BFBFB00395B0C116120 /* HealthKitDataImporter.swift */; }; - 1B7D8B785FC5302FA552C87E439A8D25 /* QuickConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = C7B35D4EA6471948D6C91A7FDE6F47D5 /* QuickConfiguration.m */; }; - 1B97CD23B61DEA10E88769F3B1EE578D /* Util.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45BD400FBF5D623D08667E12C2A5949F /* Util.swift */; }; - 1D0E73C4F4BDE8D75036C2FFF989C3A3 /* HealthKitSampleGenerator.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D1DC8F50B9C12FC5068F88985400C2BF /* HealthKitSampleGenerator.bundle */; }; - 1E608EAF8009FC82D841B180F7C6793A /* NMBExceptionCapture.m in Sources */ = {isa = PBXBuildFile; fileRef = 1FE9E62B60B72E1688DB605366DA964A /* NMBExceptionCapture.m */; }; - 1EB0395E90DC786D257E35F4BB737D6B /* EndWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = ADB2573055CDD988719A774B9A78C2B2 /* EndWith.swift */; }; - 1FE799F6E3BF45982DEB8D03BD84D125 /* World.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2314F9D831C73EA35E0E19E09E97C2 /* World.h */; settings = {ATTRIBUTES = (Project, ); }; }; - 2241BD9DF0F7D0711B0E7225D4974BBD /* MatcherProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5268D6308FD81E6D31EB2B5EB9648544 /* MatcherProtocols.swift */; }; - 29E8C8A05F9FCFC71F7B2253D61D4FF8 /* HealthKitSampleGenerator-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = DCBFDDCFDF4EA1701C922C06B3827998 /* HealthKitSampleGenerator-dummy.m */; }; - 2F044DF21BE298FD00A0B51F /* SampleCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F044DF11BE298FD00A0B51F /* SampleCreator.swift */; }; - 2F3C4D771BDA7BBF00B91D60 /* HealthKitProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3C4D761BDA7BBF00B91D60 /* HealthKitProfile.swift */; }; - 2F3C4D791BDAAACA00B91D60 /* JsonReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3C4D781BDAAACA00B91D60 /* JsonReader.swift */; }; - 2F3C4D811BDB60BE00B91D60 /* HealthKitProfileReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3C4D801BDB60BE00B91D60 /* HealthKitProfileReader.swift */; }; - 2F3C4D8C1BDD66D700B91D60 /* HealthKitProfileImporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3C4D8B1BDD66D700B91D60 /* HealthKitProfileImporter.swift */; }; - 2F3C4D8F1BDE81E300B91D60 /* HealthKitConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3C4D8E1BDE81E300B91D60 /* HealthKitConstants.swift */; }; - 2F3C4D911BDE82ED00B91D60 /* HealthKitStoreCleaner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F3C4D901BDE82ED00B91D60 /* HealthKitStoreCleaner.swift */; }; - 34DCFCCAA82FE906F481ACD5A6797422 /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C163EB363ABEA376EA74FBF8C1BCACB9 /* Filter.swift */; }; - 35046BFF06F9602D2A04AE23115E7952 /* BeGreaterThanOrEqualTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = BBFA48AD4CBF2294E94626E2803758E1 /* BeGreaterThanOrEqualTo.swift */; }; - 3689360651A699DC84CD3A88F843A2EF /* Quick-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 09ED86DD95111B4BA74888E09DB678C5 /* Quick-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3A3A941BD21684A8A71F6CF0E22F1051 /* MatcherFunc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F5F6EB9441474C247F801F9A31D56C5 /* MatcherFunc.swift */; }; - 3BA9C7629BFEF8254D3BF091D028D464 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 279AA6492631DEFA8C439A9C088EEB8A /* XCTest.framework */; }; - 3D903B746E80BF5C7DEB126F0E1BA1A7 /* Nimble-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = DB988A31017DBFF17C082F6370337655 /* Nimble-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4235336690B33526741E90D25B8C1E29 /* ObjCMatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1577FF53CF0CE7F1C287BB55F0DA509 /* ObjCMatcher.swift */; }; - 43FE57E9EADCA1F6FFC44CC4DCE18A18 /* ExportTargets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30E4405FB9FCECB537AEC528E63D2686 /* ExportTargets.swift */; }; - 45730181FDB3CB399510A26E3CBB33EE /* AsyncMatcherWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB0AAC5C2C17AB91FC015B6F025C4236 /* AsyncMatcherWrapper.swift */; }; - 4EF33872216FA19CA4BA75EF38826536 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E351727CD07BB90B2A3CAE2C2433F6C5 /* Foundation.framework */; }; - 5433EA2F1D2B468A2514CF3E3FA829F6 /* Equal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93B98129D40B8C3F2FDD553D34874099 /* Equal.swift */; }; - 54E4B6051D80C89296290E0182EA926F /* Pods-HealthKitSampleGenerator_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 11235C435F86042FE510687D4B645729 /* Pods-HealthKitSampleGenerator_Tests-dummy.m */; }; - 57E8B56ABCF519D03835D18D7AAB56A2 /* QuickSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = C49618EC5BECDEE62524BB52A46534DA /* QuickSpec.m */; }; - 58B7EBEA00D03BA8AE7C63D6F868E671 /* Match.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C747D50EBC2ACF5417760BE6F0E33CB /* Match.swift */; }; - 59DAB6ECC3246840EE664EDA0EE97BAA /* AllPass.swift in Sources */ = {isa = PBXBuildFile; fileRef = F78842A0EDB440C836A713C1EB30BED0 /* AllPass.swift */; }; - 61EB2E179E270A4616645474C35D4CEE /* ExampleGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9097DBBE46F35689B923B137D9136541 /* ExampleGroup.swift */; }; - 6265B55A93A55A970B458AB2DEAC0F41 /* World+DSL.h in Headers */ = {isa = PBXBuildFile; fileRef = E37339CB80C2FBEECEBA71D03FD1EFD1 /* World+DSL.h */; settings = {ATTRIBUTES = (Project, ); }; }; - 652BA4C1DF3ABDA2120CF89B42FD7F2E /* World.swift in Sources */ = {isa = PBXBuildFile; fileRef = E22AC725FB3B945BCE450EB7986BF35C /* World.swift */; }; - 6B0C0269F98E13DEA720BF4BEB0B4561 /* BeEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = B084C81C036B7746D76266AB1EECFF87 /* BeEmpty.swift */; }; - 6B844E97A77B46EFEDB9AF7C0215799D /* HealthKitSampleGenerator-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F73B652E33588342E0DA69D1303A62B /* HealthKitSampleGenerator-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 746BDF7CA2B6615E4F1CD891F553B8BD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E351727CD07BB90B2A3CAE2C2433F6C5 /* Foundation.framework */; }; - 7B1C8150C1475A6B1CD548FAE2BA3CA3 /* DSL+Wait.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D7A20C09F57F76DE513CA0E69DC58CD /* DSL+Wait.swift */; }; - 7B20BAEC2471554CC4E969671EFA497E /* SuiteHooks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CD69DF15FF8FAA02D9EFB321AFC3DB4 /* SuiteHooks.swift */; }; - 815A52BF0FEDAB1BDC52BD4598BA974A /* AssertionRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335CFF9F10075C8B76653D3514A5E0E9 /* AssertionRecorder.swift */; }; - 8742D2CD66D2340C5A5980CCF4C4950F /* Nimble-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8281C58776C609918D11EC8982489EC2 /* Nimble-dummy.m */; }; - 880EBB50B0FC86451EBD490C24A39E45 /* ExampleMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45D0453B7BD5D8EFAADCBE834E887A52 /* ExampleMetadata.swift */; }; - 896C41CF61875F4FC83E605B4C6735A5 /* BeLessThanOrEqual.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDA8E18FE726B211EFFD968840822D /* BeLessThanOrEqual.swift */; }; - 8B77C531EB3F66A07096DB3C2B1CBEA4 /* Quick.h in Headers */ = {isa = PBXBuildFile; fileRef = C1F8B216A9FEF603006ADB7AC3148FD7 /* Quick.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 920A2E35EBBC1C19A7E3681631CACAEC /* AssertionDispatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E8D1C01B51D84AF46DFD636322A626F /* AssertionDispatcher.swift */; }; - 928340C2AB8F2A25E61F0F9CE8F2B7F9 /* BeGreaterThan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22EB29F62F015520EDFE36A7546DC59B /* BeGreaterThan.swift */; }; - 93857B1E4D50E1A05D5E807B4BE23D8E /* BeIdenticalTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D97656C1C2771474F6A2D4DA5967D6B6 /* BeIdenticalTo.swift */; }; - 9386CCFB04A315BFA4A5D1031EB6B9A7 /* RaisesException.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B4EE4B2DE224D286FF6E24BEE413D86 /* RaisesException.swift */; }; - 95A56C9C61C1DF44928CFC7153F0972B /* DSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4CE2926E22543AE2A5A2BD8EBA1444E /* DSL.swift */; }; - 9A62DA8294BEE7AC988BD386E8272BEE /* ExportConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDAB173328DCC7344CE320F9B0EA96D3 /* ExportConfiguration.swift */; }; - 9D57D991598DD9E5C3D4F6344D19750C /* Expression.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9807B49E75E1BD31C6B1C0B82A605446 /* Expression.swift */; }; - 9F4B4F498A623D63B64CD747A5F2CBFD /* Pods-HealthKitSampleGenerator_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E5D76E71FC213B2E6761F0723AD0FEF /* Pods-HealthKitSampleGenerator_Example-dummy.m */; }; - A0CF2C9AD1DF98FA71C0DC64B9D070FE /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E351727CD07BB90B2A3CAE2C2433F6C5 /* Foundation.framework */; }; - A213A3F4F933863588DE9E717C1ECD14 /* DSL.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C29D0140F99F570B9C3CF9B2CAEB2D6 /* DSL.m */; }; - A4DD4686A303B828782BD3A0D3B6D804 /* Pods-HealthKitSampleGenerator_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 05392518CC0907AC7B9939ADBA69A9D2 /* Pods-HealthKitSampleGenerator_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - AEB148F5A0D8CA4CA7AFD3450C0A904F /* ObjCExpectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49C14BC51A6DA84A37B30353A6D01A6A /* ObjCExpectation.swift */; }; - AFD4473019156F312855F23BECCD0208 /* DSL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A30E01188DC863EA2CCCCC3AC7BF85C /* DSL.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B3D7CBC03B017A275428FC0051B2850F /* Contain.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1D6AE8CF6D24D4020AF1545FBF314AC /* Contain.swift */; }; - B8075EFE15EFA986DDC045A83BE77F04 /* Nimble.h in Headers */ = {isa = PBXBuildFile; fileRef = 88CC68431B40DD61E43E9A139896FE98 /* Nimble.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B8D76AA6614D554BDF4B77B2C1E7F50A /* SourceLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2FC6DDA74F238B17F46BC8E4AB02863 /* SourceLocation.swift */; }; - B9027ED6825D12E70D463ABE6B6DC03F /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 279AA6492631DEFA8C439A9C088EEB8A /* XCTest.framework */; }; - BA34E8BF868D0C9E18665C26840481F5 /* DSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B1A32AA2E30641BB916437CED9E453B /* DSL.swift */; }; - BC0CF55A707E45FA6237F81B2C67AB88 /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BBA70B64DD0AE4F3F7C98C7D3EDFA24 /* Functional.swift */; }; - BD9EC9FA64B3ADD302D49721154701CC /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1337F13C6FF1196F39508D0B79ADEFE1 /* Configuration.swift */; }; - BEBF004140316D42358B18B02B18553F /* QCKDSL.h in Headers */ = {isa = PBXBuildFile; fileRef = 6F1FA46C77C1ABFF98B31C78C3DACDD6 /* QCKDSL.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C38239AAB51ACB98ADB91690F4B73340 /* Quick-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B16B152669ADACF3254C0F790E2AB6DB /* Quick-dummy.m */; }; - CA7BCD73C987FA45C676A620A67A3F01 /* Closures.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94E7EA0ED6871CF048541B1B3D55C307 /* Closures.swift */; }; - CAD2553823C6A36247B855A27A9D1A86 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E351727CD07BB90B2A3CAE2C2433F6C5 /* Foundation.framework */; }; - CC6B6C3AC36B3526454C3104D93B2DBD /* NSString+QCKSelectorName.m in Sources */ = {isa = PBXBuildFile; fileRef = 174672AAE6E60F57BC16B7800B414692 /* NSString+QCKSelectorName.m */; }; - CCF69B213A6AA7F3091BE83E59D5378F /* QCKDSL.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A5B5E7033C99040FD17D5926F61BB3E /* QCKDSL.m */; }; - CD674C29C71E334A5597136C585E0633 /* JsonWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 533F352834CED5F5E3DC61AB1C12DAE1 /* JsonWriter.swift */; }; - CEE17B288AEA3D692DB64F3CC8E077CC /* Expectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2924F25F9C2725ED940553BE00291381 /* Expectation.swift */; }; - CF88FA0268B2B1FFD6D91A0B91D2CD66 /* Callsite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 210D48586090E8C608D986707DE18983 /* Callsite.swift */; }; - D43C26DFAD751BAC93BE26B55FDC4F11 /* ThrowError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E03A7CF3BBC2D4D1235C5F8CDACBC5 /* ThrowError.swift */; }; - D484442CEC37939F5E7FA1FC8E73B412 /* World+DSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7F4AE7B368BE50E4C84DCBC69A620ED /* World+DSL.swift */; }; - D4A7396949AA6A12CB7DE5CC3751E0C8 /* NSString+QCKSelectorName.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F541C535141045C63EB1B5F2EF84BBF /* NSString+QCKSelectorName.h */; settings = {ATTRIBUTES = (Project, ); }; }; - D65E3990C2D02BD772977584D7271FAD /* BeNil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 326A8B8239D07F9F25E079DFB644B266 /* BeNil.swift */; }; - DC68BFA158770805C8752CBC4EFB89DC /* BeginWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = B93004E59D8B110EA031F6792095E6F7 /* BeginWith.swift */; }; - DCF7896185304D0E923FB726A4E1F905 /* AdapterProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6E19A9388A0C8DA53D6C2937D614BC0 /* AdapterProtocols.swift */; }; - E3224745755D55F6A3736B0F89498E06 /* BeCloseTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65657B6DA73C51B28FA14CBA1826FA1B /* BeCloseTo.swift */; }; - E33E1FBEF7E59B906931AD0366141609 /* NimbleXCTestHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4407A26444065C3BE7EB897542AD0C9 /* NimbleXCTestHandler.swift */; }; - EBCFC6244C5C5FE8B10113A1F3BE6E58 /* FailureMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5FACF1560864472E1A30E5AB7219FD /* FailureMessage.swift */; }; - EF14B2C9A1EA5F4C1F10C144B1D069A6 /* HealthKitDataExport.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA8DC4FBCA1F640EA52C0518EA7B6927 /* HealthKitDataExport.swift */; }; - EF4B06672AD631288265FB7A483823F8 /* ExampleHooks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0548D863A02D310554351C2B5DE4F4A5 /* ExampleHooks.swift */; }; - F4ED851C84866AC96B995896531583DC /* Stringers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0B9C732794857EF894135327888153 /* Stringers.swift */; }; - F4FCB84B09C0FCEE15E16C5FA269A870 /* BeLessThan.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3DC3AB502D15DF6EB3C260E6A3DD5F1 /* BeLessThan.swift */; }; - F5F04D976C55DBA3A8DD2F1E2EF2B8C1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E351727CD07BB90B2A3CAE2C2433F6C5 /* Foundation.framework */; }; - F803A8468D5798FC74444D71CD157EF5 /* QuickConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 508FD3CB1567FCC5043EB0299338D4F9 /* QuickConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; - F85AC28B749BDC3C651D58A8BEF7CF68 /* Pods-HealthKitSampleGenerator_Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 37779ECAE7FF4B738D8C8CB02F6E9C78 /* Pods-HealthKitSampleGenerator_Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; - FA49C3CE336F2534DD1C6D9330D5C1CD /* HealthKitDataExporters.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D52E07D41BF006E3A20713663A1AE5D /* HealthKitDataExporters.swift */; }; - FF3D928D3C3E7463500A56935EE45EF9 /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D460A77A8D38641C7E3CBF7B83F5D7D /* Example.swift */; }; + 011CAC6A74AAEEAF9F54E817D1A9FD33 /* QuickTestSuite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8870A295B06D321277C67CED13393F6F /* QuickTestSuite.swift */; }; + 01692FC85BC6ECB122F1380ECBBA6EF5 /* String+C99ExtendedIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94A3A522E1EFCE6A2A59F49005B74E34 /* String+C99ExtendedIdentifier.swift */; }; + 01A100AE3D2AF7A7D6A6BF1A91A4EDF3 /* SuiteHooks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5CB541A541AF860EEA97FE5501182862 /* SuiteHooks.swift */; }; + 027B82CB1EFE52DB0FD5F00B9405640F /* JsonReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EA80C281F10007B4E1AD8A006D0D564 /* JsonReader.swift */; }; + 02A1AAA49758A955770775CD409D8635 /* CwlCatchException.m in Sources */ = {isa = PBXBuildFile; fileRef = 48FEC9D5A615C2DFE3E756E8D25871A8 /* CwlCatchException.m */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 05376A2B4A599FB919C25922E08EF492 /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 368540D083788E46A27376E7CB7215E0 /* Filter.swift */; }; + 0892D14FE7A3452423E9129D7917664B /* MatchError.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA112225FF526E65896DDDF956F74AF1 /* MatchError.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 0A0527D317A7EBC701746C94E20D3FFB /* HealthKitSampleGenerator.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 557C9B937132638D406A61D547A7C9C5 /* HealthKitSampleGenerator.bundle */; }; + 0BB767541C54223C6F9FC358D46FF8C0 /* Pods-HealthKitSampleGenerator_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E5735BFAA5EDB170F09EDDF59663561D /* Pods-HealthKitSampleGenerator_Example-dummy.m */; }; + 0BC004D67283D18826764E424B036D96 /* HealthKitProfileReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C400F272DB7F96D0B9053626461CB8D /* HealthKitProfileReader.swift */; }; + 12FEE7CACE56248EBCD65119D78F3B0E /* HealthKitDataExport.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB22F723F4A0AB766E7561491CE9F816 /* HealthKitDataExport.swift */; }; + 13D2A4D59DD9612E1AA7F3182A342162 /* mach_excServer.c in Sources */ = {isa = PBXBuildFile; fileRef = 9194C82BBC06F2BF3019F69BBA2CFE6A /* mach_excServer.c */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 17928A0BA262E3DF1F0D75DD05C9EDF7 /* ExportConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D1EC3746A3C8A778DC03BC2DC62107 /* ExportConfiguration.swift */; }; + 192A3F8BEC1A99FD8712D3E09724D72C /* FailureMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E416B96F586F3EB4A1DBACB1614B452 /* FailureMessage.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 19BA8AF46D9CC49E3E2CEDCAF6354442 /* CwlPreconditionTesting.h in Headers */ = {isa = PBXBuildFile; fileRef = A78650F56FB20B8C081C0B0A1AFEF5BC /* CwlPreconditionTesting.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1B4D25D41B2CE138D184DD18A534ADB2 /* ExampleHooks.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2FD3C0D4239C9AF15D57728ECFF539CA /* ExampleHooks.swift */; }; + 1BC91F1B56B3B926D762B134DAD4F362 /* HealthKitProfileReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C400F272DB7F96D0B9053626461CB8D /* HealthKitProfileReader.swift */; }; + 1E5C4F9EB261B75BECC921A303CA3AA6 /* ErrorUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACBC5226F7B70DA1DB008F41E4A01382 /* ErrorUtility.swift */; }; + 208F9DADCC8F01AAC14247BF0E54C863 /* ExampleGroup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A2FCA7814FB7C6B002B0AC80B728826 /* ExampleGroup.swift */; }; + 221ED892E5138A00F3CDF540E914519D /* CwlCatchException.h in Headers */ = {isa = PBXBuildFile; fileRef = 1208008CFB860726BD6C3DD35E138D78 /* CwlCatchException.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 22E080DCBB61D5412380BE0AD0584455 /* HealthKitSampleGenerator.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 2D63384B6DC0A389B7C876F33606A758 /* HealthKitSampleGenerator.bundle */; }; + 234849AD309265FD107C74357FC8C0CF /* DSL+Wait.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80EFA2D981F85EAF6601CE6AC577D669 /* DSL+Wait.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 2391FFD3230B40E2348B5257D6296BBB /* BeGreaterThanOrEqualTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64AD8B83D74F555E11F65FFF5385A326 /* BeGreaterThanOrEqualTo.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 25564FB1E03E7F0482FC43D17D00A066 /* HealthKitDataExporters.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7E199EC034A2CDD766B36ADAB700C77 /* HealthKitDataExporters.swift */; }; + 26B9FEAB3DE0C8B91709D53571752A3B /* MatcherFunc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2450165A9350C8074899189666ECDA5C /* MatcherFunc.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 26BFBD738BB96C6C730D4DC96D47A107 /* QuickConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = C2EE570836DA0A08CE51B59DB06BADC6 /* QuickConfiguration.m */; }; + 2B350015B9F7546D0769649EE12D7D1A /* NimbleXCTestHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACEB3B980103F727C9A633F3B80B1C75 /* NimbleXCTestHandler.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 2BE5D1B1D8986048A3B0E3D73B9EE158 /* XCTestSuite+QuickTestSuiteBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = 2934A3B4FE683A7B1077812515D6E5F0 /* XCTestSuite+QuickTestSuiteBuilder.m */; }; + 3262B230B938C8D6522790093FEAF69D /* EndWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D1C348A0AEB51F638DA71120681121C /* EndWith.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 330E8E4A6596ED625E9B34C94CC4136E /* Await.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC1D76E5BE2C06FDC8DD47B8BFBAE133 /* Await.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 3460FEA0CEADB05D3B56C2E1CAF9590C /* ElementsEqual.swift in Sources */ = {isa = PBXBuildFile; fileRef = B14E94646E4C206F66E9782E6E193B11 /* ElementsEqual.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 34EA8D74C57BC1A6AC8C0A5B5267E56C /* QuickConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 68938017DBE8BABA6FF05E15B614FA9B /* QuickConfiguration.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 36673119E34B37811B4673AC17D3AD67 /* Pods-HealthKitSampleGenerator_Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = B2596248E4BEEC94FA5EE72A3042E864 /* Pods-HealthKitSampleGenerator_Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 39133A7716CEDEB690A7DA9D12C45C4D /* CwlDarwinDefinitions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BD691153E3D635D7044FC779C5E82DB /* CwlDarwinDefinitions.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 3B25B738AEB65B8E3740B0C1258C6341 /* ExportTargets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFF1F21F44EFE6E2C3C5704991B7AAB /* ExportTargets.swift */; }; + 3BD0C370BBCEBDEA68B8EDBD969370EB /* mach_excServer.h in Headers */ = {isa = PBXBuildFile; fileRef = A4BBF0EC502678F53DF8E608F8A6ACAD /* mach_excServer.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 403F837F9B4AC86C901D238D847A767A /* QuickSpecBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 136C47632F7E7F3F6A79AABB1A23ABCC /* QuickSpecBase.h */; settings = {ATTRIBUTES = (Project, ); }; }; + 4203EF96811AE514D64AE069311B1575 /* AllPass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012EE64BD755D0863890CA9320E900A3 /* AllPass.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 42F76698690916E0407F51610D829412 /* BeGreaterThan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8248FB8AF316C9C78E22B71BC196957D /* BeGreaterThan.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 44C9470137EF941955A1FDCE71D68C26 /* MatcherProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 083FAD88BB13235D753745BB0BD020DC /* MatcherProtocols.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 46B90B2CF2EB97B38C43A31E9A5478C2 /* PostNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF37E74A9438A098FCB61CE88B18A3DF /* PostNotification.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 46BDEBF35D99D2CC53EF72DFC5BDCDCC /* BeLessThanOrEqual.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB7332A0B6ABF2ED2D514AA4D9D86E93 /* BeLessThanOrEqual.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 46CA7B981A87071E1C6E02086F9051FC /* ExportTargets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFF1F21F44EFE6E2C3C5704991B7AAB /* ExportTargets.swift */; }; + 4965EB19EC4E40D4CD45391FEB924593 /* Util.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD1C7AB842EDF1F1B035E15253D4DAB /* Util.swift */; }; + 4B13991A8177E64E788FC6FAE93B7A3C /* ExportConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88D1EC3746A3C8A778DC03BC2DC62107 /* ExportConfiguration.swift */; }; + 4BFC00DB8D9C674920D4CC05A6E29DB2 /* HealthKitProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28E0BB69496EDDC416745081F1FA2396 /* HealthKitProfile.swift */; }; + 4E737D040955550EACFE774A383EB4A2 /* World+DSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 364E9FAB6806BBBDFD1BD4E5C7A6126F /* World+DSL.swift */; }; + 4F84D700CB67C629F06824BD973B84D2 /* OuputStreams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757747E7F4E7FA6DCEE03B4ED599EC49 /* OuputStreams.swift */; }; + 5058FE06C715CB9D3F83AD72D0A24ACA /* HealthKitProfileImporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0638C38EB3A6ABECBBA923D00A334F54 /* HealthKitProfileImporter.swift */; }; + 52AB6461CAA9481D24835F3E48301FC6 /* BeIdenticalTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0D1AFC5AE24413DD273B5725D87879 /* BeIdenticalTo.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 5472B9C8CD82E0C5DE1B69FF135806C4 /* HealthKitStoreCleaner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5249F13837CE6F74AF85BCBBC3D73A2E /* HealthKitStoreCleaner.swift */; }; + 5578F928AEFA8B2B7CC542033590DFD6 /* Match.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDEBB03188E78EC76D213ABBD7B5B03E /* Match.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 58C9067713CFD8FBC5A97DA18C362AAE /* Pods-HealthKitSampleGenerator_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F56902052292F75D6808F9D5A12BFD45 /* Pods-HealthKitSampleGenerator_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 5B6F70DDD4C63CF6ED95291BCB633494 /* ContainElementSatisfying.swift in Sources */ = {isa = PBXBuildFile; fileRef = 516302BEEE3227BA3C6DAD440E033F8F /* ContainElementSatisfying.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 5FB8956C1D914698458B762A33BE8951 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 033A36A29482FD32230FE0CA177F9BD3 /* Foundation.framework */; }; + 5FFC8254039A54540761DC5656615630 /* QCKDSL.m in Sources */ = {isa = PBXBuildFile; fileRef = F6B1895FACA2B4330622FD41C6F39486 /* QCKDSL.m */; }; + 602E3758C0EF64AF6B7FCEA05BF5B9B9 /* Expectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE2CBFD5F43ED31F0DDCC57F9EC33207 /* Expectation.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 603A2FC60B90F1279D399DAF8104201F /* Callsite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3E96393F1B6CCA08BF22BD52182B718 /* Callsite.swift */; }; + 63B7ECA666221B5EE437EFE136434959 /* DSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = E4893AA0C4CC52C0B2A7A222C417D540 /* DSL.swift */; }; + 64E26D7D025AC4462DFA8BA66B38C9D8 /* HaveCount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F83AA747B59E2383BB6662A3B086129 /* HaveCount.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 6E4E4B9859D643DB058D7AAC230279DD /* HealthKitConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D8749CFCB600850D2F91C3FF84B598 /* HealthKitConstants.swift */; }; + 7034D0B6AE91D924AB27F6B828C79EB8 /* Closures.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E9F7D22BF5690CB87C3259789439181 /* Closures.swift */; }; + 712E987D79829DC53E38FC6DA1B17CFB /* QuickSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = A8313EAA34BE645217DF2852E1522C4B /* QuickSpec.m */; }; + 72FB8CEABF346A37D54CC08647489A98 /* ThrowAssertion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81F935EBD39724CDCD2E42790617701D /* ThrowAssertion.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 73F5EFC14ABF011EF02044CDD11BB5D1 /* HealthKitStoreCleaner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5249F13837CE6F74AF85BCBBC3D73A2E /* HealthKitStoreCleaner.swift */; }; + 78A51B7FCC1DFB888AAA254529013C12 /* BeginWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = 441B1D5DAE79FCCB2C541078158C4BF6 /* BeginWith.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 7AC93EB6DCDA9226165D5BC354FE7BC6 /* DSL.m in Sources */ = {isa = PBXBuildFile; fileRef = 02C2D11765F7EBF07D22F0B2B819E95E /* DSL.m */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 7B355C7DF254F7BD61D2A0C07224F5DC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 033A36A29482FD32230FE0CA177F9BD3 /* Foundation.framework */; }; + 7BCC1E21AD0581F508C189CA6CDBF923 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 033A36A29482FD32230FE0CA177F9BD3 /* Foundation.framework */; }; + 7DA04CD00F265069A1E858E2DF0D082A /* JsonReader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EA80C281F10007B4E1AD8A006D0D564 /* JsonReader.swift */; }; + 7DAC86DCBC36C10F43FA5FEB819B7BF1 /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8263FE30A0637516FC0C9EAF7D240603 /* Functional.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 7E011C2C205009C5BA7BF20FB18F4B52 /* HealthKitSampleGenerator-iOS12.0-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2FAF04F1A2F369A1D6F7791129334D8C /* HealthKitSampleGenerator-iOS12.0-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 806B9040D79A3DC58FB56EAC16FE19BF /* Stringers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86B89A93059F29AC9ACCCAC660F4AFEA /* Stringers.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 81FED3E061FA39538B0AA3092F6F380B /* Example.swift in Sources */ = {isa = PBXBuildFile; fileRef = C132106EC2A2B0BF3B777DF7150EC3A1 /* Example.swift */; }; + 82EF4959DF018B637E2AC680D720F22C /* HealthKitDataImporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA5D2C36B02E4980D87004A768FD5829 /* HealthKitDataImporter.swift */; }; + 86C69D07E4AE84026867343DC185D977 /* HealthKitDataExport.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB22F723F4A0AB766E7561491CE9F816 /* HealthKitDataExport.swift */; }; + 88F403109D33F993ACD635A3D01134BC /* NSBundle+CurrentTestBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE6F209352A13BD917FF5EC0A629FFF2 /* NSBundle+CurrentTestBundle.swift */; }; + 89EE4D6DBDB79963D65AA1E67B543B6D /* CwlCatchBadInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC0E8FB31B8A59EEDED9EC78DB693257 /* CwlCatchBadInstruction.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 8A0EF19254BAC5DF0885D1FBA345E016 /* CwlMachBadInstructionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EA4ACEB8BB07BE97686541FE31664DC /* CwlMachBadInstructionHandler.m */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 8D17749611AB0C8BD51C068749D8DF68 /* NMBExceptionCapture.h in Headers */ = {isa = PBXBuildFile; fileRef = 89C4E6BA342A6FC91795E2E7D80F58F6 /* NMBExceptionCapture.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8D543DAD9A6C0B8BF8A5DB38AD876677 /* SatisfyAnyOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = F13F7B116AF8EB86D89CA43A8D15C927 /* SatisfyAnyOf.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 8D75EC8969EA46FBD6E1BED7791A3C37 /* BeLogical.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406655908ED5468CE961BB85AB39C8A7 /* BeLogical.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 8DC01D68E99B6ECE23F6B3F50479D95F /* HealthKitSampleGenerator-iOS12.0-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F7760CD3D7DB18316E3B6A24BDDCE2F /* HealthKitSampleGenerator-iOS12.0-dummy.m */; }; + 8F34FF8D86952A401AD077A8084EAD20 /* JsonWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 553F1097B3BEC61A6B4B8557BE84845A /* JsonWriter.swift */; }; + 90818DF5D680C3C2812BA98A09DE61CB /* HealthKitConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D8749CFCB600850D2F91C3FF84B598 /* HealthKitConstants.swift */; }; + 94DA3131D64B3D904BE28E72F1871065 /* BeAKindOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4C7D88B76C4738E7B74168479A92315 /* BeAKindOf.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 99E8019F4689A514DAC6AA40AFF7352E /* NMBObjCMatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D4DE94AC94FFBF28441A0C36561FC78 /* NMBObjCMatcher.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 9B9714C476F416AD7FD803EA1184D113 /* BeLessThan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 071B61EF30BF90EC731B83F28117F075 /* BeLessThan.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 9BB2E6C13B25C0157C4BECFC9F8DF489 /* URL+FileName.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5E4175EF98E338D8D5D3702B8E48D7D /* URL+FileName.swift */; }; + 9BB5E9B6487FE95C710687B484C17161 /* Nimble.h in Headers */ = {isa = PBXBuildFile; fileRef = 5AA48BA1D17B1B83CE23CDC2248A7701 /* Nimble.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9C460BA614D4B1D314A252C4C5CE1D87 /* BeAnInstanceOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB983C01ACCC87D37C64FEEEBD015E6C /* BeAnInstanceOf.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + 9F70369EF71BD9ABAFF687AF532CC20D /* CwlMachBadInstructionHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 65191C87D7890AEF4187AC979AD0E5E2 /* CwlMachBadInstructionHandler.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9F9FFAE55C45DB46968944E5EA772436 /* JsonWriter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 553F1097B3BEC61A6B4B8557BE84845A /* JsonWriter.swift */; }; + A173703877A14EBF47A8A4FF41F7DBE6 /* QuickSelectedTestSuiteBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62E7A4D2583FD85F7DB51543BA1D94E9 /* QuickSelectedTestSuiteBuilder.swift */; }; + A4DB0E237BA83CE78680F923849FDB95 /* HealthKitDataImporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA5D2C36B02E4980D87004A768FD5829 /* HealthKitDataImporter.swift */; }; + A9996A6303084D17B9C439CB132A1F69 /* DSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCA5AB714E05DFC6CB1A9055125E47B3 /* DSL.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + A9BB549C0CC1CD0E9BECD284BAD75CDB /* HealthKitProfileImporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0638C38EB3A6ABECBBA923D00A334F54 /* HealthKitProfileImporter.swift */; }; + A9BF211D24462D531E278F2AE317AEA4 /* Quick.h in Headers */ = {isa = PBXBuildFile; fileRef = C583D55E93D2C23506816D0ECC9CB0B0 /* Quick.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AC2BA0586A98401B16320B70EB591E6B /* Util.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD1C7AB842EDF1F1B035E15253D4DAB /* Util.swift */; }; + AD69407E2FA1D39A9E09248052F2D81B /* ExpectationMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0FCB20926BF616C0519CF8F6AF0431A /* ExpectationMessage.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + AE191084C68BDF1A2878978CCFBF29E2 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 24869D429F09ACFA3227C2E18B5890BD /* Configuration.swift */; }; + B14047FBA5A5FE9360991CC72B593765 /* HealthKitSampleGenerator-iOS9.0-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 5A6E07526ACC83B911CBCE79E7BACEB5 /* HealthKitSampleGenerator-iOS9.0-dummy.m */; }; + B2A65EEDB5D5EC246EA68E10964FF7B3 /* ThrowError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 696B48A141606A71BC0ABD43B9A52D8F /* ThrowError.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + B327AE02407D753A4D7609262611F6E0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 033A36A29482FD32230FE0CA177F9BD3 /* Foundation.framework */; }; + B3CF42B77340FBA4F3E0993BD5C164DE /* SampleCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8358E15CADADA4BE099ED9BCB0183F /* SampleCreator.swift */; }; + B4058A2AA8486E9879F113E6F67B9679 /* AdapterProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 722949AE9C9F2FA0EF6CFB37D69144B8 /* AdapterProtocols.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + B44FBE4084A04C067CE860BA6F415F11 /* SampleCreator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8358E15CADADA4BE099ED9BCB0183F /* SampleCreator.swift */; }; + B4D4F58639206237B353808D9E70B30E /* HealthKitSampleGenerator-iOS9.0-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = FDBCE1A524206D6099978A443C2027FC /* HealthKitSampleGenerator-iOS9.0-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B5AEEFF5F31AC069BD96E8104301AD4D /* World.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05DDA5F5BD67D707AA716145591CA7D6 /* World.swift */; }; + B6CC23C6C288F4EB9EDD3A06F1F5F094 /* Predicate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F049F75F04FA056779DB22775048E7 /* Predicate.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + B71070160CF07EFA99ED0445B0D191E7 /* Nimble-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A0530A8F7FBFDC9F647711A1B1906204 /* Nimble-dummy.m */; }; + B7662703AF8D3FFFCB0070C50FEDCC58 /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EEEBEBF7B787898DF09E2EED055400F /* Errors.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + B7977833FE910D5DB829DCCC6EA3D104 /* Quick-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 885169D56AF63F349D986F6FD6A19304 /* Quick-dummy.m */; }; + B79FC6E46F642C3FC74B3E6D9175B1AB /* SatisfyAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2E47533D52832DD152803938E8A8C59 /* SatisfyAllOf.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + B9397BD911F09C73BC598D60DC04C1A7 /* Behavior.swift in Sources */ = {isa = PBXBuildFile; fileRef = A42F9FD5967F56D0BEC6D01D8036617B /* Behavior.swift */; }; + BD379F95293A811D8E591CAC8E9FF410 /* Quick-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3EFEEEC9948D8453804CF7F9368DEE5E /* Quick-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C051C0411627BD5FCDA031782EB1F716 /* DSL.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B2D0652D8F3AACE18A933AE4B00D6DD /* DSL.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C062817FA97CEBAEB05142F88667525A /* Pods-HealthKitSampleGenerator_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F49FFD2FCA0E26B1565E30CF32FA397F /* Pods-HealthKitSampleGenerator_Tests-dummy.m */; }; + C0C98C8C7D07E1598F20EE2F0539197D /* NMBExpectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E36B3C15E01EE137782FAC1B4FF87475 /* NMBExpectation.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + C43FC4EFD9E762C454E4168953475A55 /* HooksPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84974814F581E3C4109C60E745BC7FA7 /* HooksPhase.swift */; }; + C6A86479B1236153B50C59E9ACB07D0D /* QuickSpecBase.m in Sources */ = {isa = PBXBuildFile; fileRef = 422D1D2C5EAA1517BC9DD050822F4A05 /* QuickSpecBase.m */; }; + C903AEFEEB4E73644A03FB8285543107 /* BeEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ED6EF353CCE6BBF803A1F717FBEC8D1 /* BeEmpty.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + C912897D77798A90873A3DAD8A4BDC50 /* QCKDSL.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4D831C03026C50D9C46AAA6A6A99DC /* QCKDSL.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C979EEB0159A65246F6BD2C906A8ADB7 /* BeVoid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41AEFF6F0F8641915460E14078EAA621 /* BeVoid.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + C99BBC3F70E056CB6A3CC0516318939D /* AssertionDispatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F741A325D114DF7E530BDD203FB56B4 /* AssertionDispatcher.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + CAACEBB97A7D23E6782B47A805DFED81 /* CwlCatchException.swift in Sources */ = {isa = PBXBuildFile; fileRef = 039D8A83F931FBCB15CA68FFEF57A2EE /* CwlCatchException.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + CD6B1F146B0E157FE5B9CAFFAE77A5B5 /* Nimble-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 79E669D410B80DA80A4E1F68BE665EAC /* Nimble-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + CEE8D31A4E76BB7B350BF2A7175D4BC2 /* NMBExceptionCapture.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FAD2462D03C757D0F7C333E9CC3968 /* NMBExceptionCapture.m */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + CF9218FF56D8EE43681150A3E1635C9A /* ToSucceed.swift in Sources */ = {isa = PBXBuildFile; fileRef = C96571B81B1E1F2A7632243AA8B316CE /* ToSucceed.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + D34D0540ADCBF163575B6B5444B1AAF6 /* Contain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13F246159743DE22E6CD521024BC0F8B /* Contain.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + D755642ECA73CFE2E4C31CDD0DFBA42E /* QuickSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 272E81A763DF094D944F3A4E51DEAEA0 /* QuickSpec.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D9CFB8E5E354D7BE61D092259779F437 /* Equal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65854C431528E8C830E8B7C38D0C07FD /* Equal.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + D9D6150D329A87CBB415FD349F0C50FD /* SourceLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B4FE44A565B7D51777C3DCF0536EE10 /* SourceLocation.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + DB54F97DAD1B7C3EA58025C30CD0CD78 /* OuputStreams.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757747E7F4E7FA6DCEE03B4ED599EC49 /* OuputStreams.swift */; }; + DB84342A0C0DEABBF7F729DE55225D82 /* XCTestObservationCenter+Register.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AF3B3EFA75292B9FDDC5E6B447AEEAC /* XCTestObservationCenter+Register.m */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + DCD198D49C0A198A09525B7688EE3BC9 /* Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = 065E13545322CFF21FDD119A616DA78A /* Async.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + DDB4CD8E0284E772EC9991F26F86A97D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 033A36A29482FD32230FE0CA177F9BD3 /* Foundation.framework */; }; + E0EAC85F7ACFAD998B14FCE66144000E /* NMBStringify.h in Headers */ = {isa = PBXBuildFile; fileRef = B6E258AD83036FBA23547DE0C55FBC5A /* NMBStringify.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E458AAE1AE9E2250F29806E5633B1860 /* Expression.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BD31630E5AF5A91E26BE84FFB08A710 /* Expression.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + E6669AA083F6E847AF984CC40329D0FC /* HealthKitDataExporters.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7E199EC034A2CDD766B36ADAB700C77 /* HealthKitDataExporters.swift */; }; + EC7EF3D5778783BD93EBC6F82016ADA9 /* BeNil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D46641E08F746A053C1B8D92B7A34A4 /* BeNil.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + ECCA1FA570A912E8CDB54EB843F1D030 /* NimbleEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2B077F09D6DBE64FF23B4C78D3D7E69 /* NimbleEnvironment.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + EFB9CC9267297D8104141A4046AAD14E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 033A36A29482FD32230FE0CA177F9BD3 /* Foundation.framework */; }; + F310B21703A7BC438A09DDB96670583F /* AssertionRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16602DD9FB05FA5EDA288D40D2BE6F29 /* AssertionRecorder.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + F4877B3857C780DCDB7F413A03F95600 /* BeCloseTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = E06F79CAFC1A7C21CE9CA39591BCAAC4 /* BeCloseTo.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + F78E35D04F09485FA5DFA72FE1AD5AB2 /* NMBStringify.m in Sources */ = {isa = PBXBuildFile; fileRef = 97CC26A7C8608378C3FD9889E4AD23BF /* NMBStringify.m */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + F9E85548BF1EF8C5035BAF92233C34B6 /* RaisesException.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C16292C7017193603A06ACACB75982D /* RaisesException.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; + FA8F6E421E834BD318ECF9405D72FE99 /* HealthKitProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28E0BB69496EDDC416745081F1FA2396 /* HealthKitProfile.swift */; }; + FBBE9D9A2D1C31E86BEABF94B224C4EE /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2C061463250766C9C05995AB8EE63E66 /* XCTest.framework */; }; + FF4C06BD3EF989D203359A47EAA0A287 /* ExampleMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBFD1878741EFB3E1F1940591412D528 /* ExampleMetadata.swift */; }; + FF920E965F1CA016FF302DE8C92C5122 /* CwlBadInstructionException.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75D3859EAFA486485F8FA5D6B49A11D2 /* CwlBadInstructionException.swift */; settings = {COMPILER_FLAGS = "-DPRODUCT_NAME=Nimble/Nimble"; }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1CE9395D94CD6C0449A75CD88233614D /* PBXContainerItemProxy */ = { + 2A0D02A51015F5720F0BCDEEDE4BF4E1 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = CE41A0B9AA44F0C3A741AF9CD922D612; - remoteInfo = "HealthKitSampleGenerator-HealthKitSampleGenerator"; + remoteGlobalIDString = A149403F5B7302441FD39D762F3B67B1; + remoteInfo = "HealthKitSampleGenerator-iOS12.0"; }; - 3090B5B7E4C542701CF75783CACD50CF /* PBXContainerItemProxy */ = { + 3B6F49716AE74C90DB2F8622883238AB /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = 9DB05EFC751028DD93CF970F1102971B; - remoteInfo = HealthKitSampleGenerator; + remoteGlobalIDString = 1F8927426752C08FD6EE9B2E5A88B646; + remoteInfo = "HealthKitSampleGenerator-iOS12.0-HealthKitSampleGenerator"; }; - 789AFF65D6A4444CB61DE97E7F25B004 /* PBXContainerItemProxy */ = { + 4A039B8E893BD585BABE1AE6A15D7686 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = 8849EF21BC824D03AA41F5ED190F3DDE; + remoteGlobalIDString = C82891EAB7293DBEE916B21F57E8474D; remoteInfo = Quick; }; - 81090D23DED576C0E4B60500F79EC5DE /* PBXContainerItemProxy */ = { + 5AD091AE79D9984540072D9C577F8D0D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = 9DB05EFC751028DD93CF970F1102971B; - remoteInfo = HealthKitSampleGenerator; + remoteGlobalIDString = 5C8A8103606742343FAC5419D57F4221; + remoteInfo = "HealthKitSampleGenerator-iOS9.0"; }; - A54786732E4D2B30C96147D4BC64D2FF /* PBXContainerItemProxy */ = { + 666D43BCB6199A09453CA710B0EDB2E8 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; proxyType = 1; - remoteGlobalIDString = AE4F696CC357FA27AC16FF75A72C8C40; + remoteGlobalIDString = 8D49D5BC5615B12C21DEC7C7F839A0E4; + remoteInfo = "HealthKitSampleGenerator-iOS9.0-HealthKitSampleGenerator"; + }; + D0A7BBBD0FDFB2D7E1D307997716616A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6F13695E06195A78EA8A95F8C7ED0D2F; remoteInfo = Nimble; }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 04F89B076472BD1D4EC51E9236DD965A /* Pods-HealthKitSampleGenerator_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-HealthKitSampleGenerator_Example-frameworks.sh"; sourceTree = ""; }; - 05392518CC0907AC7B9939ADBA69A9D2 /* Pods-HealthKitSampleGenerator_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-HealthKitSampleGenerator_Example-umbrella.h"; sourceTree = ""; }; - 0548D863A02D310554351C2B5DE4F4A5 /* ExampleHooks.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExampleHooks.swift; path = Quick/Hooks/ExampleHooks.swift; sourceTree = ""; }; - 06C70772C887953F1F94E04C52352B56 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 06DED06545D9AACEE3872300E5A2B919 /* Nimble.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Nimble.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 09ED86DD95111B4BA74888E09DB678C5 /* Quick-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Quick-umbrella.h"; sourceTree = ""; }; - 0BBA70B64DD0AE4F3F7C98C7D3EDFA24 /* Functional.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Functional.swift; path = Nimble/Utils/Functional.swift; sourceTree = ""; }; - 0F541C535141045C63EB1B5F2EF84BBF /* NSString+QCKSelectorName.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSString+QCKSelectorName.h"; path = "Quick/NSString+QCKSelectorName.h"; sourceTree = ""; }; - 11235C435F86042FE510687D4B645729 /* Pods-HealthKitSampleGenerator_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-HealthKitSampleGenerator_Tests-dummy.m"; sourceTree = ""; }; - 1337F13C6FF1196F39508D0B79ADEFE1 /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = Quick/Configuration/Configuration.swift; sourceTree = ""; }; - 174672AAE6E60F57BC16B7800B414692 /* NSString+QCKSelectorName.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSString+QCKSelectorName.m"; path = "Quick/NSString+QCKSelectorName.m"; sourceTree = ""; }; - 18E03A7CF3BBC2D4D1235C5F8CDACBC5 /* ThrowError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ThrowError.swift; path = Nimble/Matchers/ThrowError.swift; sourceTree = ""; }; - 1A2314F9D831C73EA35E0E19E09E97C2 /* World.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = World.h; path = Quick/World.h; sourceTree = ""; }; - 1B1A32AA2E30641BB916437CED9E453B /* DSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DSL.swift; path = Nimble/DSL.swift; sourceTree = ""; }; - 1F5F6EB9441474C247F801F9A31D56C5 /* MatcherFunc.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MatcherFunc.swift; path = Nimble/Wrappers/MatcherFunc.swift; sourceTree = ""; }; - 1FE9E62B60B72E1688DB605366DA964A /* NMBExceptionCapture.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = NMBExceptionCapture.m; path = Nimble/objc/NMBExceptionCapture.m; sourceTree = ""; }; - 2065F67A980712141655A2AD710F2FB1 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HealthKitSampleGenerator_Tests.release.xcconfig"; sourceTree = ""; }; - 210D48586090E8C608D986707DE18983 /* Callsite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Callsite.swift; path = Quick/Callsite.swift; sourceTree = ""; }; - 22EB29F62F015520EDFE36A7546DC59B /* BeGreaterThan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeGreaterThan.swift; path = Nimble/Matchers/BeGreaterThan.swift; sourceTree = ""; }; - 279AA6492631DEFA8C439A9C088EEB8A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - 2924F25F9C2725ED940553BE00291381 /* Expectation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Expectation.swift; path = Nimble/Expectation.swift; sourceTree = ""; }; - 2A7AB4BFDA57F45CCF189DFA5305EB6D /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 2C29D0140F99F570B9C3CF9B2CAEB2D6 /* DSL.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = DSL.m; path = Nimble/objc/DSL.m; sourceTree = ""; }; - 2D7A20C09F57F76DE513CA0E69DC58CD /* DSL+Wait.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DSL+Wait.swift"; path = "Nimble/DSL+Wait.swift"; sourceTree = ""; }; - 2F044DF11BE298FD00A0B51F /* SampleCreator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SampleCreator.swift; sourceTree = ""; }; - 2F3C4D761BDA7BBF00B91D60 /* HealthKitProfile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitProfile.swift; sourceTree = ""; }; - 2F3C4D781BDAAACA00B91D60 /* JsonReader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JsonReader.swift; sourceTree = ""; }; - 2F3C4D801BDB60BE00B91D60 /* HealthKitProfileReader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitProfileReader.swift; sourceTree = ""; }; - 2F3C4D8B1BDD66D700B91D60 /* HealthKitProfileImporter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitProfileImporter.swift; sourceTree = ""; }; - 2F3C4D8E1BDE81E300B91D60 /* HealthKitConstants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitConstants.swift; sourceTree = ""; }; - 2F3C4D901BDE82ED00B91D60 /* HealthKitStoreCleaner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HealthKitStoreCleaner.swift; sourceTree = ""; }; - 2F66B2F667E5F1FC43A5803846F29CE3 /* Quick.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Quick.xcconfig; sourceTree = ""; }; - 30E4405FB9FCECB537AEC528E63D2686 /* ExportTargets.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ExportTargets.swift; sourceTree = ""; }; - 31971283FA8916C9C34FAFEA055DAA40 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HealthKitSampleGenerator_Example.debug.xcconfig"; sourceTree = ""; }; - 326A8B8239D07F9F25E079DFB644B266 /* BeNil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeNil.swift; path = Nimble/Matchers/BeNil.swift; sourceTree = ""; }; - 335CFF9F10075C8B76653D3514A5E0E9 /* AssertionRecorder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AssertionRecorder.swift; path = Nimble/Adapters/AssertionRecorder.swift; sourceTree = ""; }; - 338A1B5F55067651B908698ACA292FFA /* Nimble-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Nimble-prefix.pch"; sourceTree = ""; }; - 37779ECAE7FF4B738D8C8CB02F6E9C78 /* Pods-HealthKitSampleGenerator_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-HealthKitSampleGenerator_Tests-umbrella.h"; sourceTree = ""; }; - 396609E77E8F1D994629241C6F84CC02 /* Quick-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Quick-prefix.pch"; sourceTree = ""; }; - 3F73B652E33588342E0DA69D1303A62B /* HealthKitSampleGenerator-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "HealthKitSampleGenerator-umbrella.h"; sourceTree = ""; }; - 45BD400FBF5D623D08667E12C2A5949F /* Util.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Util.swift; sourceTree = ""; }; - 45D0453B7BD5D8EFAADCBE834E887A52 /* ExampleMetadata.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExampleMetadata.swift; path = Quick/ExampleMetadata.swift; sourceTree = ""; }; - 49C14BC51A6DA84A37B30353A6D01A6A /* ObjCExpectation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObjCExpectation.swift; path = Nimble/ObjCExpectation.swift; sourceTree = ""; }; - 4C72C225DE1AC5E012728543D62538C0 /* Pods-HealthKitSampleGenerator_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-HealthKitSampleGenerator_Example-acknowledgements.markdown"; sourceTree = ""; }; - 4DFBE0597ED6EFD7CD381DDD40002C82 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HealthKitSampleGenerator_Example.release.xcconfig"; sourceTree = ""; }; - 4FBDA8E18FE726B211EFFD968840822D /* BeLessThanOrEqual.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeLessThanOrEqual.swift; path = Nimble/Matchers/BeLessThanOrEqual.swift; sourceTree = ""; }; - 508FD3CB1567FCC5043EB0299338D4F9 /* QuickConfiguration.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QuickConfiguration.h; path = Quick/Configuration/QuickConfiguration.h; sourceTree = ""; }; - 5268D6308FD81E6D31EB2B5EB9648544 /* MatcherProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MatcherProtocols.swift; path = Nimble/Matchers/MatcherProtocols.swift; sourceTree = ""; }; - 533F352834CED5F5E3DC61AB1C12DAE1 /* JsonWriter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = JsonWriter.swift; sourceTree = ""; }; - 5A5B5E7033C99040FD17D5926F61BB3E /* QCKDSL.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QCKDSL.m; path = Quick/DSL/QCKDSL.m; sourceTree = ""; }; - 5B4EE4B2DE224D286FF6E24BEE413D86 /* RaisesException.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RaisesException.swift; path = Nimble/Matchers/RaisesException.swift; sourceTree = ""; }; - 65657B6DA73C51B28FA14CBA1826FA1B /* BeCloseTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeCloseTo.swift; path = Nimble/Matchers/BeCloseTo.swift; sourceTree = ""; }; - 65EE5D01998D0C315455F137386476DA /* BeAnInstanceOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeAnInstanceOf.swift; path = Nimble/Matchers/BeAnInstanceOf.swift; sourceTree = ""; }; - 6CB72AC4C5B71AF2170C79971985BE2F /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6F1FA46C77C1ABFF98B31C78C3DACDD6 /* QCKDSL.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QCKDSL.h; path = Quick/DSL/QCKDSL.h; sourceTree = ""; }; - 6F746BC3426C524B4B39B5B14C86355A /* Pods-HealthKitSampleGenerator_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-HealthKitSampleGenerator_Example-resources.sh"; sourceTree = ""; }; - 7193986906ED6255C5341D6CDD534513 /* Pods-HealthKitSampleGenerator_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-HealthKitSampleGenerator_Tests.modulemap"; sourceTree = ""; }; - 730236B08FB9EB1D2AEDA42FF40C7EDC /* Nimble.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Nimble.xcconfig; sourceTree = ""; }; - 768B106CF8116EDB0C6830AF7F4EEF1B /* Poll.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Poll.swift; path = Nimble/Utils/Poll.swift; sourceTree = ""; }; - 78026FF7AEA63A5CB93CF14B8F3A4256 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 79D25D06CF4A364C27B940631A4F4101 /* BeAKindOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeAKindOf.swift; path = Nimble/Matchers/BeAKindOf.swift; sourceTree = ""; }; - 7A30E01188DC863EA2CCCCC3AC7BF85C /* DSL.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = DSL.h; path = Nimble/objc/DSL.h; sourceTree = ""; }; - 7A9E1EDB533A0CE303B1043D42B23D8E /* Quick.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Quick.modulemap; sourceTree = ""; }; - 7E5D76E71FC213B2E6761F0723AD0FEF /* Pods-HealthKitSampleGenerator_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-HealthKitSampleGenerator_Example-dummy.m"; sourceTree = ""; }; - 802AAD1D90891718BB823EDA010ECE09 /* QuickSpec.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QuickSpec.h; path = Quick/QuickSpec.h; sourceTree = ""; }; - 8281C58776C609918D11EC8982489EC2 /* Nimble-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Nimble-dummy.m"; sourceTree = ""; }; - 88CC68431B40DD61E43E9A139896FE98 /* Nimble.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Nimble.h; path = Nimble/Nimble.h; sourceTree = ""; }; - 8ACBD62C4BCA19645C0D09AE0643CFA9 /* BeLogical.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeLogical.swift; path = Nimble/Matchers/BeLogical.swift; sourceTree = ""; }; - 8B0B9C732794857EF894135327888153 /* Stringers.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Stringers.swift; path = Nimble/Utils/Stringers.swift; sourceTree = ""; }; - 8C591CE7171AFD686AAC127A8D4F216F /* Pods-HealthKitSampleGenerator_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HealthKitSampleGenerator_Tests-acknowledgements.plist"; sourceTree = ""; }; - 8C747D50EBC2ACF5417760BE6F0E33CB /* Match.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Match.swift; path = Nimble/Matchers/Match.swift; sourceTree = ""; }; - 8D460A77A8D38641C7E3CBF7B83F5D7D /* Example.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Example.swift; path = Quick/Example.swift; sourceTree = ""; }; - 8D52E07D41BF006E3A20713663A1AE5D /* HealthKitDataExporters.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HealthKitDataExporters.swift; sourceTree = ""; }; - 9097DBBE46F35689B923B137D9136541 /* ExampleGroup.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExampleGroup.swift; path = Quick/ExampleGroup.swift; sourceTree = ""; }; - 93B98129D40B8C3F2FDD553D34874099 /* Equal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Equal.swift; path = Nimble/Matchers/Equal.swift; sourceTree = ""; }; - 94E7EA0ED6871CF048541B1B3D55C307 /* Closures.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Closures.swift; path = Quick/Hooks/Closures.swift; sourceTree = ""; }; - 9807B49E75E1BD31C6B1C0B82A605446 /* Expression.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Expression.swift; path = Nimble/Expression.swift; sourceTree = ""; }; - 9CD69DF15FF8FAA02D9EFB321AFC3DB4 /* SuiteHooks.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SuiteHooks.swift; path = Quick/Hooks/SuiteHooks.swift; sourceTree = ""; }; - 9E8D1C01B51D84AF46DFD636322A626F /* AssertionDispatcher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AssertionDispatcher.swift; path = Nimble/Adapters/AssertionDispatcher.swift; sourceTree = ""; }; - A099A919DF437B37F19A37E60313F302 /* Pods_HealthKitSampleGenerator_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HealthKitSampleGenerator_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A2BFC886B396D39FEB44CB6439EBB4C4 /* Pods-HealthKitSampleGenerator_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-HealthKitSampleGenerator_Tests-acknowledgements.markdown"; sourceTree = ""; }; - A39459EC67F3FDC5CB1EED4613237031 /* Nimble.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = Nimble.modulemap; sourceTree = ""; }; - A4407A26444065C3BE7EB897542AD0C9 /* NimbleXCTestHandler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NimbleXCTestHandler.swift; path = Nimble/Adapters/NimbleXCTestHandler.swift; sourceTree = ""; }; - A52991290649BB41FA1E41AD7DE179FB /* Pods_HealthKitSampleGenerator_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HealthKitSampleGenerator_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A67AB7515622C4C1A2D2E316138980F0 /* HealthKitSampleGenerator.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = HealthKitSampleGenerator.xcconfig; sourceTree = ""; }; - A6E19A9388A0C8DA53D6C2937D614BC0 /* AdapterProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AdapterProtocols.swift; path = Nimble/Adapters/AdapterProtocols.swift; sourceTree = ""; }; - A7F4AE7B368BE50E4C84DCBC69A620ED /* World+DSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "World+DSL.swift"; path = "Quick/DSL/World+DSL.swift"; sourceTree = ""; }; - AADE5D2636ED81E33B78C6ED8A9E53CF /* Quick.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Quick.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - AC3374E40824D6C2FC9ED23B9CACBF6D /* Pods-HealthKitSampleGenerator_Tests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-HealthKitSampleGenerator_Tests-resources.sh"; sourceTree = ""; }; - AD1A39B0498F8EBCA690921834EC2544 /* Pods-HealthKitSampleGenerator_Tests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-HealthKitSampleGenerator_Tests-frameworks.sh"; sourceTree = ""; }; - ADB2573055CDD988719A774B9A78C2B2 /* EndWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = EndWith.swift; path = Nimble/Matchers/EndWith.swift; sourceTree = ""; }; - B068DA44A3F9A0CCBE7CCE98CAF09C32 /* NMBExceptionCapture.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = NMBExceptionCapture.h; path = Nimble/objc/NMBExceptionCapture.h; sourceTree = ""; }; - B084C81C036B7746D76266AB1EECFF87 /* BeEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeEmpty.swift; path = Nimble/Matchers/BeEmpty.swift; sourceTree = ""; }; - B16B152669ADACF3254C0F790E2AB6DB /* Quick-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Quick-dummy.m"; sourceTree = ""; }; - B85C08EC5C37C197FE795DE291779115 /* HealthKitSampleGenerator-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "HealthKitSampleGenerator-prefix.pch"; sourceTree = ""; }; - B93004E59D8B110EA031F6792095E6F7 /* BeginWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeginWith.swift; path = Nimble/Matchers/BeginWith.swift; sourceTree = ""; }; - BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - BA8DC4FBCA1F640EA52C0518EA7B6927 /* HealthKitDataExport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HealthKitDataExport.swift; sourceTree = ""; }; - BB0AAC5C2C17AB91FC015B6F025C4236 /* AsyncMatcherWrapper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncMatcherWrapper.swift; path = Nimble/Wrappers/AsyncMatcherWrapper.swift; sourceTree = ""; }; - BBFA48AD4CBF2294E94626E2803758E1 /* BeGreaterThanOrEqualTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeGreaterThanOrEqualTo.swift; path = Nimble/Matchers/BeGreaterThanOrEqualTo.swift; sourceTree = ""; }; - C163EB363ABEA376EA74FBF8C1BCACB9 /* Filter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Filter.swift; path = Quick/Filter.swift; sourceTree = ""; }; - C1BCAA70F3D0609272B4012AA37D0FEF /* OuputStreams.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuputStreams.swift; sourceTree = ""; }; - C1F8B216A9FEF603006ADB7AC3148FD7 /* Quick.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Quick.h; path = Quick/Quick.h; sourceTree = ""; }; - C49618EC5BECDEE62524BB52A46534DA /* QuickSpec.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QuickSpec.m; path = Quick/QuickSpec.m; sourceTree = ""; }; - C7B35D4EA6471948D6C91A7FDE6F47D5 /* QuickConfiguration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QuickConfiguration.m; path = Quick/Configuration/QuickConfiguration.m; sourceTree = ""; }; - CC00BC5138948EA7BF41D86A898DC98D /* HealthKitSampleGenerator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HealthKitSampleGenerator.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - CDAB173328DCC7344CE320F9B0EA96D3 /* ExportConfiguration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ExportConfiguration.swift; sourceTree = ""; }; - D1577FF53CF0CE7F1C287BB55F0DA509 /* ObjCMatcher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObjCMatcher.swift; path = Nimble/Wrappers/ObjCMatcher.swift; sourceTree = ""; }; - D1D6AE8CF6D24D4020AF1545FBF314AC /* Contain.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Contain.swift; path = Nimble/Matchers/Contain.swift; sourceTree = ""; }; - D1DC8F50B9C12FC5068F88985400C2BF /* HealthKitSampleGenerator.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HealthKitSampleGenerator.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; - D2FC6DDA74F238B17F46BC8E4AB02863 /* SourceLocation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SourceLocation.swift; path = Nimble/Utils/SourceLocation.swift; sourceTree = ""; }; - D4CE2926E22543AE2A5A2BD8EBA1444E /* DSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DSL.swift; path = Quick/DSL/DSL.swift; sourceTree = ""; }; - D97656C1C2771474F6A2D4DA5967D6B6 /* BeIdenticalTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeIdenticalTo.swift; path = Nimble/Matchers/BeIdenticalTo.swift; sourceTree = ""; }; - DB988A31017DBFF17C082F6370337655 /* Nimble-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Nimble-umbrella.h"; sourceTree = ""; }; - DCBFDDCFDF4EA1701C922C06B3827998 /* HealthKitSampleGenerator-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "HealthKitSampleGenerator-dummy.m"; sourceTree = ""; }; - DCEADAC4412D7F90B48590D152979DA2 /* Pods-HealthKitSampleGenerator_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-HealthKitSampleGenerator_Example.modulemap"; sourceTree = ""; }; - DE217CBE45F36BFBFB00395B0C116120 /* HealthKitDataImporter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HealthKitDataImporter.swift; sourceTree = ""; }; - E22AC725FB3B945BCE450EB7986BF35C /* World.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = World.swift; path = Quick/World.swift; sourceTree = ""; }; - E351727CD07BB90B2A3CAE2C2433F6C5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; - E37339CB80C2FBEECEBA71D03FD1EFD1 /* World+DSL.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "World+DSL.h"; path = "Quick/DSL/World+DSL.h"; sourceTree = ""; }; - EB5FACF1560864472E1A30E5AB7219FD /* FailureMessage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FailureMessage.swift; path = Nimble/FailureMessage.swift; sourceTree = ""; }; - F067A43C230A29C9C8141B79A1197D8D /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HealthKitSampleGenerator_Tests.debug.xcconfig"; sourceTree = ""; }; - F0CFF613419D3D46E21AF78A2D898D3C /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - F3DC3AB502D15DF6EB3C260E6A3DD5F1 /* BeLessThan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeLessThan.swift; path = Nimble/Matchers/BeLessThan.swift; sourceTree = ""; }; - F4F7CC0FF4FDF241BA9DFC5C81AD4D25 /* Pods-HealthKitSampleGenerator_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HealthKitSampleGenerator_Example-acknowledgements.plist"; sourceTree = ""; }; - F78842A0EDB440C836A713C1EB30BED0 /* AllPass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AllPass.swift; path = Nimble/Matchers/AllPass.swift; sourceTree = ""; }; - FDF69059FDEE5D3E2C829506DB742016 /* HealthKitSampleGenerator.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = HealthKitSampleGenerator.modulemap; sourceTree = ""; }; + 012EE64BD755D0863890CA9320E900A3 /* AllPass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AllPass.swift; path = Sources/Nimble/Matchers/AllPass.swift; sourceTree = ""; }; + 02C2D11765F7EBF07D22F0B2B819E95E /* DSL.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = DSL.m; path = Sources/NimbleObjectiveC/DSL.m; sourceTree = ""; }; + 033A36A29482FD32230FE0CA177F9BD3 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 039D8A83F931FBCB15CA68FFEF57A2EE /* CwlCatchException.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CwlCatchException.swift; path = Carthage/Checkouts/CwlCatchException/Sources/CwlCatchException/CwlCatchException.swift; sourceTree = ""; }; + 05DDA5F5BD67D707AA716145591CA7D6 /* World.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = World.swift; path = Sources/Quick/World.swift; sourceTree = ""; }; + 0638C38EB3A6ABECBBA923D00A334F54 /* HealthKitProfileImporter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HealthKitProfileImporter.swift; path = Pod/Classes/HealthKitProfileImporter.swift; sourceTree = ""; }; + 065E13545322CFF21FDD119A616DA78A /* Async.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Async.swift; path = Sources/Nimble/Matchers/Async.swift; sourceTree = ""; }; + 069C682EEEBCF3EE8665570008C849F1 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HealthKitSampleGenerator_Example.debug.xcconfig"; sourceTree = ""; }; + 071B61EF30BF90EC731B83F28117F075 /* BeLessThan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeLessThan.swift; path = Sources/Nimble/Matchers/BeLessThan.swift; sourceTree = ""; }; + 083FAD88BB13235D753745BB0BD020DC /* MatcherProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MatcherProtocols.swift; path = Sources/Nimble/Matchers/MatcherProtocols.swift; sourceTree = ""; }; + 0B2D0652D8F3AACE18A933AE4B00D6DD /* DSL.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = DSL.h; path = Sources/NimbleObjectiveC/DSL.h; sourceTree = ""; }; + 0B62D0B8E72896934D59D5BEB73E2642 /* HealthKitSampleGenerator-iOS12.0-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "HealthKitSampleGenerator-iOS12.0-Info.plist"; sourceTree = ""; }; + 0D1C348A0AEB51F638DA71120681121C /* EndWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = EndWith.swift; path = Sources/Nimble/Matchers/EndWith.swift; sourceTree = ""; }; + 0D631E9908483F9525A6B3F36F16CC61 /* Quick.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Quick.framework; path = Quick.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 0ED6EF353CCE6BBF803A1F717FBEC8D1 /* BeEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeEmpty.swift; path = Sources/Nimble/Matchers/BeEmpty.swift; sourceTree = ""; }; + 1208008CFB860726BD6C3DD35E138D78 /* CwlCatchException.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = CwlCatchException.h; path = Carthage/Checkouts/CwlCatchException/Sources/CwlCatchExceptionSupport/include/CwlCatchException.h; sourceTree = ""; }; + 124682FCE442389E1D941F359629CEB6 /* Pods-HealthKitSampleGenerator_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-HealthKitSampleGenerator_Tests-acknowledgements.markdown"; sourceTree = ""; }; + 136C47632F7E7F3F6A79AABB1A23ABCC /* QuickSpecBase.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QuickSpecBase.h; path = Sources/QuickSpecBase/include/QuickSpecBase.h; sourceTree = ""; }; + 13F246159743DE22E6CD521024BC0F8B /* Contain.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Contain.swift; path = Sources/Nimble/Matchers/Contain.swift; sourceTree = ""; }; + 16602DD9FB05FA5EDA288D40D2BE6F29 /* AssertionRecorder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AssertionRecorder.swift; path = Sources/Nimble/Adapters/AssertionRecorder.swift; sourceTree = ""; }; + 18973B4A2606EB857D084682494CD62B /* Pods-HealthKitSampleGenerator_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-HealthKitSampleGenerator_Example.modulemap"; sourceTree = ""; }; + 1A076E6CBB7288548DA95CFE05332BDB /* Pods-HealthKitSampleGenerator_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HealthKitSampleGenerator_Example-acknowledgements.plist"; sourceTree = ""; }; + 1C400F272DB7F96D0B9053626461CB8D /* HealthKitProfileReader.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HealthKitProfileReader.swift; path = Pod/Classes/HealthKitProfileReader.swift; sourceTree = ""; }; + 23FAD2462D03C757D0F7C333E9CC3968 /* NMBExceptionCapture.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = NMBExceptionCapture.m; path = Sources/NimbleObjectiveC/NMBExceptionCapture.m; sourceTree = ""; }; + 2450165A9350C8074899189666ECDA5C /* MatcherFunc.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MatcherFunc.swift; path = Sources/Nimble/Matchers/MatcherFunc.swift; sourceTree = ""; }; + 24869D429F09ACFA3227C2E18B5890BD /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = Sources/Quick/Configuration/Configuration.swift; sourceTree = ""; }; + 272E81A763DF094D944F3A4E51DEAEA0 /* QuickSpec.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QuickSpec.h; path = Sources/QuickObjectiveC/QuickSpec.h; sourceTree = ""; }; + 28E0BB69496EDDC416745081F1FA2396 /* HealthKitProfile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HealthKitProfile.swift; path = Pod/Classes/HealthKitProfile.swift; sourceTree = ""; }; + 2934A3B4FE683A7B1077812515D6E5F0 /* XCTestSuite+QuickTestSuiteBuilder.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "XCTestSuite+QuickTestSuiteBuilder.m"; path = "Sources/QuickObjectiveC/XCTestSuite+QuickTestSuiteBuilder.m"; sourceTree = ""; }; + 2B4018DCB940069C7566CC28E0E202C7 /* Pods-HealthKitSampleGenerator_Example-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HealthKitSampleGenerator_Example-Info.plist"; sourceTree = ""; }; + 2C061463250766C9C05995AB8EE63E66 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk/System/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 2D63384B6DC0A389B7C876F33606A758 /* HealthKitSampleGenerator.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = HealthKitSampleGenerator.bundle; path = "HealthKitSampleGenerator-iOS12.0-HealthKitSampleGenerator.bundle"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2E416B96F586F3EB4A1DBACB1614B452 /* FailureMessage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FailureMessage.swift; path = Sources/Nimble/FailureMessage.swift; sourceTree = ""; }; + 2EA80C281F10007B4E1AD8A006D0D564 /* JsonReader.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JsonReader.swift; path = Pod/Classes/JsonReader.swift; sourceTree = ""; }; + 2F7760CD3D7DB18316E3B6A24BDDCE2F /* HealthKitSampleGenerator-iOS12.0-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "HealthKitSampleGenerator-iOS12.0-dummy.m"; sourceTree = ""; }; + 2FAF04F1A2F369A1D6F7791129334D8C /* HealthKitSampleGenerator-iOS12.0-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "HealthKitSampleGenerator-iOS12.0-umbrella.h"; sourceTree = ""; }; + 2FD3C0D4239C9AF15D57728ECFF539CA /* ExampleHooks.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExampleHooks.swift; path = Sources/Quick/Hooks/ExampleHooks.swift; sourceTree = ""; }; + 32A2D42928EB0493598EB339A88244A9 /* Pods-HealthKitSampleGenerator_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HealthKitSampleGenerator_Tests-acknowledgements.plist"; sourceTree = ""; }; + 364E9FAB6806BBBDFD1BD4E5C7A6126F /* World+DSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "World+DSL.swift"; path = "Sources/Quick/DSL/World+DSL.swift"; sourceTree = ""; }; + 368540D083788E46A27376E7CB7215E0 /* Filter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Filter.swift; path = Sources/Quick/Filter.swift; sourceTree = ""; }; + 37B8CD1313C23153F0E3551250256F7F /* HealthKitSampleGenerator-iOS9.0-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "HealthKitSampleGenerator-iOS9.0-prefix.pch"; path = "../HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0-prefix.pch"; sourceTree = ""; }; + 3C03AC305A4266EA32B6580BC96CBB48 /* HealthKitSampleGenerator.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = HealthKitSampleGenerator.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 3C7202A313F66A4249A2C6B146A8FA86 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; + 3D4DE94AC94FFBF28441A0C36561FC78 /* NMBObjCMatcher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NMBObjCMatcher.swift; path = Sources/Nimble/Adapters/NMBObjCMatcher.swift; sourceTree = ""; }; + 3E9F7D22BF5690CB87C3259789439181 /* Closures.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Closures.swift; path = Sources/Quick/Hooks/Closures.swift; sourceTree = ""; }; + 3EFEEEC9948D8453804CF7F9368DEE5E /* Quick-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Quick-umbrella.h"; sourceTree = ""; }; + 406655908ED5468CE961BB85AB39C8A7 /* BeLogical.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeLogical.swift; path = Sources/Nimble/Matchers/BeLogical.swift; sourceTree = ""; }; + 41AEFF6F0F8641915460E14078EAA621 /* BeVoid.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeVoid.swift; path = Sources/Nimble/Matchers/BeVoid.swift; sourceTree = ""; }; + 422D1D2C5EAA1517BC9DD050822F4A05 /* QuickSpecBase.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QuickSpecBase.m; path = Sources/QuickSpecBase/QuickSpecBase.m; sourceTree = ""; }; + 441B1D5DAE79FCCB2C541078158C4BF6 /* BeginWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeginWith.swift; path = Sources/Nimble/Matchers/BeginWith.swift; sourceTree = ""; }; + 465AE41C5EDD179EB8E2E75DDA09D54B /* Quick-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Quick-Info.plist"; sourceTree = ""; }; + 48FEC9D5A615C2DFE3E756E8D25871A8 /* CwlCatchException.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = CwlCatchException.m; path = Carthage/Checkouts/CwlCatchException/Sources/CwlCatchExceptionSupport/CwlCatchException.m; sourceTree = ""; }; + 4C5EF9D98CB8A4E2092B20A2BFAA87E4 /* HealthKitSampleGenerator-iOS12.0.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "HealthKitSampleGenerator-iOS12.0.xcconfig"; sourceTree = ""; }; + 4EFF1F21F44EFE6E2C3C5704991B7AAB /* ExportTargets.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExportTargets.swift; path = Pod/Classes/ExportTargets.swift; sourceTree = ""; }; + 516302BEEE3227BA3C6DAD440E033F8F /* ContainElementSatisfying.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ContainElementSatisfying.swift; path = Sources/Nimble/Matchers/ContainElementSatisfying.swift; sourceTree = ""; }; + 5243E8433E7F4F1E8C496EC66E5F0F55 /* Quick.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = Quick.modulemap; sourceTree = ""; }; + 5249F13837CE6F74AF85BCBBC3D73A2E /* HealthKitStoreCleaner.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HealthKitStoreCleaner.swift; path = Pod/Classes/HealthKitStoreCleaner.swift; sourceTree = ""; }; + 553F1097B3BEC61A6B4B8557BE84845A /* JsonWriter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JsonWriter.swift; path = Pod/Classes/JsonWriter.swift; sourceTree = ""; }; + 557C9B937132638D406A61D547A7C9C5 /* HealthKitSampleGenerator.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; name = HealthKitSampleGenerator.bundle; path = "HealthKitSampleGenerator-iOS9.0-HealthKitSampleGenerator.bundle"; sourceTree = BUILT_PRODUCTS_DIR; }; + 564DD0CA03DCCDA56F5E5784D4FB29F3 /* Pods-HealthKitSampleGenerator_Tests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-HealthKitSampleGenerator_Tests-Info.plist"; sourceTree = ""; }; + 5A6E07526ACC83B911CBCE79E7BACEB5 /* HealthKitSampleGenerator-iOS9.0-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "HealthKitSampleGenerator-iOS9.0-dummy.m"; path = "../HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0-dummy.m"; sourceTree = ""; }; + 5AA48BA1D17B1B83CE23CDC2248A7701 /* Nimble.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Nimble.h; path = Sources/Nimble/Nimble.h; sourceTree = ""; }; + 5CB541A541AF860EEA97FE5501182862 /* SuiteHooks.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SuiteHooks.swift; path = Sources/Quick/Hooks/SuiteHooks.swift; sourceTree = ""; }; + 60909C72945118E784FF4AEF6450E356 /* Nimble.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = Nimble.modulemap; sourceTree = ""; }; + 62E7A4D2583FD85F7DB51543BA1D94E9 /* QuickSelectedTestSuiteBuilder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = QuickSelectedTestSuiteBuilder.swift; path = Sources/Quick/QuickSelectedTestSuiteBuilder.swift; sourceTree = ""; }; + 64AD8B83D74F555E11F65FFF5385A326 /* BeGreaterThanOrEqualTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeGreaterThanOrEqualTo.swift; path = Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift; sourceTree = ""; }; + 64BEE0E525E56294CF2380C6F10E19CD /* HealthKitSampleGenerator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = HealthKitSampleGenerator.framework; path = "HealthKitSampleGenerator-iOS12.0.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 65191C87D7890AEF4187AC979AD0E5E2 /* CwlMachBadInstructionHandler.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = CwlMachBadInstructionHandler.h; path = Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/include/CwlMachBadInstructionHandler.h; sourceTree = ""; }; + 65854C431528E8C830E8B7C38D0C07FD /* Equal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Equal.swift; path = Sources/Nimble/Matchers/Equal.swift; sourceTree = ""; }; + 6816872EC2AC2F42D88D1E7321D4F21C /* ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS9.0-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS9.0-Info.plist"; path = "../HealthKitSampleGenerator-iOS9.0/ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS9.0-Info.plist"; sourceTree = ""; }; + 68938017DBE8BABA6FF05E15B614FA9B /* QuickConfiguration.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QuickConfiguration.h; path = Sources/QuickObjectiveC/Configuration/QuickConfiguration.h; sourceTree = ""; }; + 696B48A141606A71BC0ABD43B9A52D8F /* ThrowError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ThrowError.swift; path = Sources/Nimble/Matchers/ThrowError.swift; sourceTree = ""; }; + 6B4FE44A565B7D51777C3DCF0536EE10 /* SourceLocation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SourceLocation.swift; path = Sources/Nimble/Utils/SourceLocation.swift; sourceTree = ""; }; + 6BBAA1DC1CA8B0EFC72B63DBDF6330FB /* Quick-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Quick-prefix.pch"; sourceTree = ""; }; + 6C16292C7017193603A06ACACB75982D /* RaisesException.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RaisesException.swift; path = Sources/Nimble/Matchers/RaisesException.swift; sourceTree = ""; }; + 6D46641E08F746A053C1B8D92B7A34A4 /* BeNil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeNil.swift; path = Sources/Nimble/Matchers/BeNil.swift; sourceTree = ""; }; + 6ECCAF0CEC47A60AAD80171F12F8CD5C /* Pods-HealthKitSampleGenerator_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-HealthKitSampleGenerator_Example-acknowledgements.markdown"; sourceTree = ""; }; + 6F741A325D114DF7E530BDD203FB56B4 /* AssertionDispatcher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AssertionDispatcher.swift; path = Sources/Nimble/Adapters/AssertionDispatcher.swift; sourceTree = ""; }; + 722949AE9C9F2FA0EF6CFB37D69144B8 /* AdapterProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AdapterProtocols.swift; path = Sources/Nimble/Adapters/AdapterProtocols.swift; sourceTree = ""; }; + 757747E7F4E7FA6DCEE03B4ED599EC49 /* OuputStreams.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = OuputStreams.swift; path = Pod/Classes/OuputStreams.swift; sourceTree = ""; }; + 75D3859EAFA486485F8FA5D6B49A11D2 /* CwlBadInstructionException.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CwlBadInstructionException.swift; path = Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlBadInstructionException.swift; sourceTree = ""; }; + 79E669D410B80DA80A4E1F68BE665EAC /* Nimble-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Nimble-umbrella.h"; sourceTree = ""; }; + 7AF3B3EFA75292B9FDDC5E6B447AEEAC /* XCTestObservationCenter+Register.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "XCTestObservationCenter+Register.m"; path = "Sources/NimbleObjectiveC/XCTestObservationCenter+Register.m"; sourceTree = ""; }; + 7BD691153E3D635D7044FC779C5E82DB /* CwlDarwinDefinitions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CwlDarwinDefinitions.swift; path = Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlDarwinDefinitions.swift; sourceTree = ""; }; + 7C4D831C03026C50D9C46AAA6A6A99DC /* QCKDSL.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = QCKDSL.h; path = Sources/QuickObjectiveC/DSL/QCKDSL.h; sourceTree = ""; }; + 7EA4ACEB8BB07BE97686541FE31664DC /* CwlMachBadInstructionHandler.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = CwlMachBadInstructionHandler.m; path = Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/CwlMachBadInstructionHandler.m; sourceTree = ""; }; + 80EFA2D981F85EAF6601CE6AC577D669 /* DSL+Wait.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DSL+Wait.swift"; path = "Sources/Nimble/DSL+Wait.swift"; sourceTree = ""; }; + 81F935EBD39724CDCD2E42790617701D /* ThrowAssertion.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ThrowAssertion.swift; path = Sources/Nimble/Matchers/ThrowAssertion.swift; sourceTree = ""; }; + 8248FB8AF316C9C78E22B71BC196957D /* BeGreaterThan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeGreaterThan.swift; path = Sources/Nimble/Matchers/BeGreaterThan.swift; sourceTree = ""; }; + 8263FE30A0637516FC0C9EAF7D240603 /* Functional.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Functional.swift; path = Sources/Nimble/Utils/Functional.swift; sourceTree = ""; }; + 84974814F581E3C4109C60E745BC7FA7 /* HooksPhase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HooksPhase.swift; path = Sources/Quick/Hooks/HooksPhase.swift; sourceTree = ""; }; + 86B89A93059F29AC9ACCCAC660F4AFEA /* Stringers.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Stringers.swift; path = Sources/Nimble/Utils/Stringers.swift; sourceTree = ""; }; + 885169D56AF63F349D986F6FD6A19304 /* Quick-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Quick-dummy.m"; sourceTree = ""; }; + 8870A295B06D321277C67CED13393F6F /* QuickTestSuite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = QuickTestSuite.swift; path = Sources/Quick/QuickTestSuite.swift; sourceTree = ""; }; + 88D1EC3746A3C8A778DC03BC2DC62107 /* ExportConfiguration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExportConfiguration.swift; path = Pod/Classes/ExportConfiguration.swift; sourceTree = ""; }; + 89C4E6BA342A6FC91795E2E7D80F58F6 /* NMBExceptionCapture.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = NMBExceptionCapture.h; path = Sources/NimbleObjectiveC/NMBExceptionCapture.h; sourceTree = ""; }; + 8A2FCA7814FB7C6B002B0AC80B728826 /* ExampleGroup.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExampleGroup.swift; path = Sources/Quick/ExampleGroup.swift; sourceTree = ""; }; + 8A457B9BDB6A97F670558A507319208B /* Nimble-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Nimble-Info.plist"; sourceTree = ""; }; + 8AC582B71748EDB1E883421F93EDB0C9 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HealthKitSampleGenerator_Example.release.xcconfig"; sourceTree = ""; }; + 8BD31630E5AF5A91E26BE84FFB08A710 /* Expression.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Expression.swift; path = Sources/Nimble/Expression.swift; sourceTree = ""; }; + 8EEEBEBF7B787898DF09E2EED055400F /* Errors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Errors.swift; path = Sources/Nimble/Utils/Errors.swift; sourceTree = ""; }; + 8F83AA747B59E2383BB6662A3B086129 /* HaveCount.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HaveCount.swift; path = Sources/Nimble/Matchers/HaveCount.swift; sourceTree = ""; }; + 90C5E2161B26FB91DE16BFC45DAEC7BF /* Nimble.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Nimble.xcconfig; sourceTree = ""; }; + 9194C82BBC06F2BF3019F69BBA2CFE6A /* mach_excServer.c */ = {isa = PBXFileReference; includeInIndex = 1; name = mach_excServer.c; path = Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/mach_excServer.c; sourceTree = ""; }; + 94A3A522E1EFCE6A2A59F49005B74E34 /* String+C99ExtendedIdentifier.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "String+C99ExtendedIdentifier.swift"; path = "Sources/Quick/String+C99ExtendedIdentifier.swift"; sourceTree = ""; }; + 94D5F60398D4DBA569DFCDCE27F66E44 /* HealthKitSampleGenerator-iOS12.0.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "HealthKitSampleGenerator-iOS12.0.modulemap"; sourceTree = ""; }; + 97C5071634B4B0117D150ED17B5D4C67 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; + 97CC26A7C8608378C3FD9889E4AD23BF /* NMBStringify.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = NMBStringify.m; path = Sources/NimbleObjectiveC/NMBStringify.m; sourceTree = ""; }; + 9A0D1AFC5AE24413DD273B5725D87879 /* BeIdenticalTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeIdenticalTo.swift; path = Sources/Nimble/Matchers/BeIdenticalTo.swift; sourceTree = ""; }; + 9B39218028E32B6BC9F5A5F5B5CE0C1A /* HealthKitSampleGenerator-iOS12.0-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "HealthKitSampleGenerator-iOS12.0-prefix.pch"; sourceTree = ""; }; + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 9F8358E15CADADA4BE099ED9BCB0183F /* SampleCreator.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SampleCreator.swift; path = Pod/Classes/SampleCreator.swift; sourceTree = ""; }; + A0530A8F7FBFDC9F647711A1B1906204 /* Nimble-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Nimble-dummy.m"; sourceTree = ""; }; + A42F9FD5967F56D0BEC6D01D8036617B /* Behavior.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Behavior.swift; path = Sources/Quick/Behavior.swift; sourceTree = ""; }; + A4BBF0EC502678F53DF8E608F8A6ACAD /* mach_excServer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = mach_excServer.h; path = Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlMachBadInstructionHandler/mach_excServer.h; sourceTree = ""; }; + A4C7D88B76C4738E7B74168479A92315 /* BeAKindOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeAKindOf.swift; path = Sources/Nimble/Matchers/BeAKindOf.swift; sourceTree = ""; }; + A7556D5BE075ED60E0523C1B31DF075A /* HealthKitSampleGenerator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = HealthKitSampleGenerator.framework; path = "HealthKitSampleGenerator-iOS9.0.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + A78650F56FB20B8C081C0B0A1AFEF5BC /* CwlPreconditionTesting.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = CwlPreconditionTesting.h; path = Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/Mach/CwlPreconditionTesting.h; sourceTree = ""; }; + A8313EAA34BE645217DF2852E1522C4B /* QuickSpec.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QuickSpec.m; path = Sources/QuickObjectiveC/QuickSpec.m; sourceTree = ""; }; + A957896A3325D9065B06E8F877B18D37 /* Quick.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Quick.xcconfig; sourceTree = ""; }; + A9ABA4FBAC95D7D2D96F1266B89E51C5 /* ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS12.0-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS12.0-Info.plist"; sourceTree = ""; }; + AB0E6FDFCE4FAD539A912D820E9ABDF5 /* HealthKitSampleGenerator-iOS9.0.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "HealthKitSampleGenerator-iOS9.0.xcconfig"; path = "../HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0.xcconfig"; sourceTree = ""; }; + ACBC5226F7B70DA1DB008F41E4A01382 /* ErrorUtility.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ErrorUtility.swift; path = Sources/Quick/ErrorUtility.swift; sourceTree = ""; }; + ACEB3B980103F727C9A633F3B80B1C75 /* NimbleXCTestHandler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NimbleXCTestHandler.swift; path = Sources/Nimble/Adapters/NimbleXCTestHandler.swift; sourceTree = ""; }; + AE6F209352A13BD917FF5EC0A629FFF2 /* NSBundle+CurrentTestBundle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "NSBundle+CurrentTestBundle.swift"; path = "Sources/Quick/NSBundle+CurrentTestBundle.swift"; sourceTree = ""; }; + B14E94646E4C206F66E9782E6E193B11 /* ElementsEqual.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ElementsEqual.swift; path = Sources/Nimble/Matchers/ElementsEqual.swift; sourceTree = ""; }; + B172BA603CCFC87DAD86FDF4C4E86D05 /* HealthKitSampleGenerator-iOS9.0-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "HealthKitSampleGenerator-iOS9.0-Info.plist"; path = "../HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0-Info.plist"; sourceTree = ""; }; + B2596248E4BEEC94FA5EE72A3042E864 /* Pods-HealthKitSampleGenerator_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-HealthKitSampleGenerator_Tests-umbrella.h"; sourceTree = ""; }; + B5974989CA3FCE9604B9C6182B63FA85 /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HealthKitSampleGenerator_Tests.debug.xcconfig"; sourceTree = ""; }; + B6E258AD83036FBA23547DE0C55FBC5A /* NMBStringify.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = NMBStringify.h; path = Sources/NimbleObjectiveC/NMBStringify.h; sourceTree = ""; }; + BA5D2C36B02E4980D87004A768FD5829 /* HealthKitDataImporter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HealthKitDataImporter.swift; path = Pod/Classes/HealthKitDataImporter.swift; sourceTree = ""; }; + BAE263041362D074978BB3B577DF0A05 /* Nimble.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Nimble.framework; path = Nimble.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BB983C01ACCC87D37C64FEEEBD015E6C /* BeAnInstanceOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeAnInstanceOf.swift; path = Sources/Nimble/Matchers/BeAnInstanceOf.swift; sourceTree = ""; }; + BC25678D1651CEF7F84B7962117899B3 /* Pods-HealthKitSampleGenerator_Tests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-HealthKitSampleGenerator_Tests-frameworks.sh"; sourceTree = ""; }; + BCCE45A1A037826AD9B16B9F96F015B0 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-HealthKitSampleGenerator_Tests.release.xcconfig"; sourceTree = ""; }; + C132106EC2A2B0BF3B777DF7150EC3A1 /* Example.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Example.swift; path = Sources/Quick/Example.swift; sourceTree = ""; }; + C2E47533D52832DD152803938E8A8C59 /* SatisfyAllOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SatisfyAllOf.swift; path = Sources/Nimble/Matchers/SatisfyAllOf.swift; sourceTree = ""; }; + C2EE570836DA0A08CE51B59DB06BADC6 /* QuickConfiguration.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QuickConfiguration.m; path = Sources/QuickObjectiveC/Configuration/QuickConfiguration.m; sourceTree = ""; }; + C583D55E93D2C23506816D0ECC9CB0B0 /* Quick.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Quick.h; path = Sources/QuickObjectiveC/Quick.h; sourceTree = ""; }; + C96571B81B1E1F2A7632243AA8B316CE /* ToSucceed.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ToSucceed.swift; path = Sources/Nimble/Matchers/ToSucceed.swift; sourceTree = ""; }; + CCA5AB714E05DFC6CB1A9055125E47B3 /* DSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DSL.swift; path = Sources/Nimble/DSL.swift; sourceTree = ""; }; + CDEBB03188E78EC76D213ABBD7B5B03E /* Match.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Match.swift; path = Sources/Nimble/Matchers/Match.swift; sourceTree = ""; }; + CE7DF46C311E71797B3145F184AA42BF /* Pods-HealthKitSampleGenerator_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-HealthKitSampleGenerator_Tests.modulemap"; sourceTree = ""; }; + D0F049F75F04FA056779DB22775048E7 /* Predicate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Predicate.swift; path = Sources/Nimble/Matchers/Predicate.swift; sourceTree = ""; }; + D0FCB20926BF616C0519CF8F6AF0431A /* ExpectationMessage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpectationMessage.swift; path = Sources/Nimble/ExpectationMessage.swift; sourceTree = ""; }; + D2B077F09D6DBE64FF23B4C78D3D7E69 /* NimbleEnvironment.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NimbleEnvironment.swift; path = Sources/Nimble/Adapters/NimbleEnvironment.swift; sourceTree = ""; }; + D57876F111F64E5E177F7711475F8402 /* Pods_HealthKitSampleGenerator_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_HealthKitSampleGenerator_Tests.framework; path = "Pods-HealthKitSampleGenerator_Tests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + D7258CB02C6C8EDE71410DB5FF91F35E /* HealthKitSampleGenerator-iOS9.0.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; name = "HealthKitSampleGenerator-iOS9.0.modulemap"; path = "../HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0.modulemap"; sourceTree = ""; }; + D7E199EC034A2CDD766B36ADAB700C77 /* HealthKitDataExporters.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HealthKitDataExporters.swift; path = Pod/Classes/HealthKitDataExporters.swift; sourceTree = ""; }; + DA112225FF526E65896DDDF956F74AF1 /* MatchError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MatchError.swift; path = Sources/Nimble/Matchers/MatchError.swift; sourceTree = ""; }; + DBD1C7AB842EDF1F1B035E15253D4DAB /* Util.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Util.swift; path = Pod/Classes/Util.swift; sourceTree = ""; }; + E06F79CAFC1A7C21CE9CA39591BCAAC4 /* BeCloseTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeCloseTo.swift; path = Sources/Nimble/Matchers/BeCloseTo.swift; sourceTree = ""; }; + E36B3C15E01EE137782FAC1B4FF87475 /* NMBExpectation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NMBExpectation.swift; path = Sources/Nimble/Adapters/NMBExpectation.swift; sourceTree = ""; }; + E4893AA0C4CC52C0B2A7A222C417D540 /* DSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DSL.swift; path = Sources/Quick/DSL/DSL.swift; sourceTree = ""; }; + E5735BFAA5EDB170F09EDDF59663561D /* Pods-HealthKitSampleGenerator_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-HealthKitSampleGenerator_Example-dummy.m"; sourceTree = ""; }; + E5E4175EF98E338D8D5D3702B8E48D7D /* URL+FileName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "URL+FileName.swift"; path = "Sources/Quick/URL+FileName.swift"; sourceTree = ""; }; + EB7332A0B6ABF2ED2D514AA4D9D86E93 /* BeLessThanOrEqual.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeLessThanOrEqual.swift; path = Sources/Nimble/Matchers/BeLessThanOrEqual.swift; sourceTree = ""; }; + EC1D76E5BE2C06FDC8DD47B8BFBAE133 /* Await.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Await.swift; path = Sources/Nimble/Utils/Await.swift; sourceTree = ""; }; + ED9D1F1BB6D5EABA96455E2E064A9699 /* Pods_HealthKitSampleGenerator_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_HealthKitSampleGenerator_Example.framework; path = "Pods-HealthKitSampleGenerator_Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + EE2CBFD5F43ED31F0DDCC57F9EC33207 /* Expectation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Expectation.swift; path = Sources/Nimble/Expectation.swift; sourceTree = ""; }; + EF20CB0D6D12D898151E14B8FCC6A689 /* Nimble-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Nimble-prefix.pch"; sourceTree = ""; }; + EF37E74A9438A098FCB61CE88B18A3DF /* PostNotification.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PostNotification.swift; path = Sources/Nimble/Matchers/PostNotification.swift; sourceTree = ""; }; + F13F7B116AF8EB86D89CA43A8D15C927 /* SatisfyAnyOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SatisfyAnyOf.swift; path = Sources/Nimble/Matchers/SatisfyAnyOf.swift; sourceTree = ""; }; + F3E96393F1B6CCA08BF22BD52182B718 /* Callsite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Callsite.swift; path = Sources/Quick/Callsite.swift; sourceTree = ""; }; + F49FFD2FCA0E26B1565E30CF32FA397F /* Pods-HealthKitSampleGenerator_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-HealthKitSampleGenerator_Tests-dummy.m"; sourceTree = ""; }; + F56902052292F75D6808F9D5A12BFD45 /* Pods-HealthKitSampleGenerator_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-HealthKitSampleGenerator_Example-umbrella.h"; sourceTree = ""; }; + F6B1895FACA2B4330622FD41C6F39486 /* QCKDSL.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = QCKDSL.m; path = Sources/QuickObjectiveC/DSL/QCKDSL.m; sourceTree = ""; }; + F8D8749CFCB600850D2F91C3FF84B598 /* HealthKitConstants.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HealthKitConstants.swift; path = Pod/Classes/HealthKitConstants.swift; sourceTree = ""; }; + FA92F9B0421B9CF3A276D8DCCF5BD001 /* Pods-HealthKitSampleGenerator_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-HealthKitSampleGenerator_Example-frameworks.sh"; sourceTree = ""; }; + FB22F723F4A0AB766E7561491CE9F816 /* HealthKitDataExport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HealthKitDataExport.swift; path = Pod/Classes/HealthKitDataExport.swift; sourceTree = ""; }; + FBFD1878741EFB3E1F1940591412D528 /* ExampleMetadata.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExampleMetadata.swift; path = Sources/Quick/ExampleMetadata.swift; sourceTree = ""; }; + FC0E8FB31B8A59EEDED9EC78DB693257 /* CwlCatchBadInstruction.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CwlCatchBadInstruction.swift; path = Carthage/Checkouts/CwlPreconditionTesting/Sources/CwlPreconditionTesting/CwlCatchBadInstruction.swift; sourceTree = ""; }; + FDBCE1A524206D6099978A443C2027FC /* HealthKitSampleGenerator-iOS9.0-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "HealthKitSampleGenerator-iOS9.0-umbrella.h"; path = "../HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0-umbrella.h"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 17294DB1499163CFDA40EAC1E0FC5F9F /* Frameworks */ = { + 49E824FAE98018288CFFF490C18DDFFA /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 4EF33872216FA19CA4BA75EF38826536 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 2EF91420B3911830636291D6BF17C1F9 /* Frameworks */ = { + 55C81EE76C6A69F1F69792A679310C68 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A0CF2C9AD1DF98FA71C0DC64B9D070FE /* Foundation.framework in Frameworks */, + EFB9CC9267297D8104141A4046AAD14E /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 4AD97663EFDC1832CA39881AC4B08242 /* Frameworks */ = { + A16B6842C245A93C4C8D39969313129E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - F5F04D976C55DBA3A8DD2F1E2EF2B8C1 /* Foundation.framework in Frameworks */, - 3BA9C7629BFEF8254D3BF091D028D464 /* XCTest.framework in Frameworks */, + DDB4CD8E0284E772EC9991F26F86A97D /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 53EC7192AEE59C66BADB1AFF3AB0F7B6 /* Frameworks */ = { + AB369B2B747B5897D26FBF4EE2247648 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 5FB8956C1D914698458B762A33BE8951 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 5507D876FBF49DCD893370E48CEB762B /* Frameworks */ = { + B8DCB29D20115574E76B52CEE1288CE5 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 746BDF7CA2B6615E4F1CD891F553B8BD /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - AEB3789DDABC631658180BF3D5AA98A5 /* Frameworks */ = { + CDAB8B9827E1DBAC04CC57CD315BCC85 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CAD2553823C6A36247B855A27A9D1A86 /* Foundation.framework in Frameworks */, - B9027ED6825D12E70D463ABE6B6DC03F /* XCTest.framework in Frameworks */, + 7B355C7DF254F7BD61D2A0C07224F5DC /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 00A20E6A871A38C64CF268D27DA934D4 /* Quick */ = { - isa = PBXGroup; - children = ( - 210D48586090E8C608D986707DE18983 /* Callsite.swift */, - 94E7EA0ED6871CF048541B1B3D55C307 /* Closures.swift */, - 1337F13C6FF1196F39508D0B79ADEFE1 /* Configuration.swift */, - D4CE2926E22543AE2A5A2BD8EBA1444E /* DSL.swift */, - 8D460A77A8D38641C7E3CBF7B83F5D7D /* Example.swift */, - 9097DBBE46F35689B923B137D9136541 /* ExampleGroup.swift */, - 0548D863A02D310554351C2B5DE4F4A5 /* ExampleHooks.swift */, - 45D0453B7BD5D8EFAADCBE834E887A52 /* ExampleMetadata.swift */, - C163EB363ABEA376EA74FBF8C1BCACB9 /* Filter.swift */, - 0F541C535141045C63EB1B5F2EF84BBF /* NSString+QCKSelectorName.h */, - 174672AAE6E60F57BC16B7800B414692 /* NSString+QCKSelectorName.m */, - 6F1FA46C77C1ABFF98B31C78C3DACDD6 /* QCKDSL.h */, - 5A5B5E7033C99040FD17D5926F61BB3E /* QCKDSL.m */, - C1F8B216A9FEF603006ADB7AC3148FD7 /* Quick.h */, - 508FD3CB1567FCC5043EB0299338D4F9 /* QuickConfiguration.h */, - C7B35D4EA6471948D6C91A7FDE6F47D5 /* QuickConfiguration.m */, - 802AAD1D90891718BB823EDA010ECE09 /* QuickSpec.h */, - C49618EC5BECDEE62524BB52A46534DA /* QuickSpec.m */, - 9CD69DF15FF8FAA02D9EFB321AFC3DB4 /* SuiteHooks.swift */, - 1A2314F9D831C73EA35E0E19E09E97C2 /* World.h */, - E22AC725FB3B945BCE450EB7986BF35C /* World.swift */, - E37339CB80C2FBEECEBA71D03FD1EFD1 /* World+DSL.h */, - A7F4AE7B368BE50E4C84DCBC69A620ED /* World+DSL.swift */, - CE170A8221839C5ABA1F5BA4293D0117 /* Support Files */, + D9523B817C92EFD8BCE3CDE77F54908E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 7BCC1E21AD0581F508C189CA6CDBF923 /* Foundation.framework in Frameworks */, + FBBE9D9A2D1C31E86BEABF94B224C4EE /* XCTest.framework in Frameworks */, ); - path = Quick; - sourceTree = ""; + runOnlyForDeploymentPostprocessing = 0; }; - 0C6B012983F9FEF8CC65C1318F5F090C /* iOS */ = { - isa = PBXGroup; - children = ( - E351727CD07BB90B2A3CAE2C2433F6C5 /* Foundation.framework */, - 279AA6492631DEFA8C439A9C088EEB8A /* XCTest.framework */, + FEFD90CCBFD8ED874465080EBC009E86 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B327AE02407D753A4D7609262611F6E0 /* Foundation.framework in Frameworks */, ); - name = iOS; - sourceTree = ""; + runOnlyForDeploymentPostprocessing = 0; }; - 19DF80A5D891EAB3ED7E0AA2B96ADC69 /* Support Files */ = { +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 11778F3B2FFA9C970C03D6E9FA7B5E88 /* Pod */ = { isa = PBXGroup; children = ( - 78026FF7AEA63A5CB93CF14B8F3A4256 /* Info.plist */, - A39459EC67F3FDC5CB1EED4613237031 /* Nimble.modulemap */, - 730236B08FB9EB1D2AEDA42FF40C7EDC /* Nimble.xcconfig */, - 8281C58776C609918D11EC8982489EC2 /* Nimble-dummy.m */, - 338A1B5F55067651B908698ACA292FFA /* Nimble-prefix.pch */, - DB988A31017DBFF17C082F6370337655 /* Nimble-umbrella.h */, + 3C03AC305A4266EA32B6580BC96CBB48 /* HealthKitSampleGenerator.podspec */, + 97C5071634B4B0117D150ED17B5D4C67 /* LICENSE */, + 3C7202A313F66A4249A2C6B146A8FA86 /* README.md */, ); - name = "Support Files"; - path = "../Target Support Files/Nimble"; + name = Pod; sourceTree = ""; }; - 29432D6C01F4BDA44490922607386604 /* Pods-HealthKitSampleGenerator_Tests */ = { + 1628BF05B4CAFDCC3549A101F5A10A17 /* Frameworks */ = { isa = PBXGroup; children = ( - 6CB72AC4C5B71AF2170C79971985BE2F /* Info.plist */, - 7193986906ED6255C5341D6CDD534513 /* Pods-HealthKitSampleGenerator_Tests.modulemap */, - A2BFC886B396D39FEB44CB6439EBB4C4 /* Pods-HealthKitSampleGenerator_Tests-acknowledgements.markdown */, - 8C591CE7171AFD686AAC127A8D4F216F /* Pods-HealthKitSampleGenerator_Tests-acknowledgements.plist */, - 11235C435F86042FE510687D4B645729 /* Pods-HealthKitSampleGenerator_Tests-dummy.m */, - AD1A39B0498F8EBCA690921834EC2544 /* Pods-HealthKitSampleGenerator_Tests-frameworks.sh */, - AC3374E40824D6C2FC9ED23B9CACBF6D /* Pods-HealthKitSampleGenerator_Tests-resources.sh */, - 37779ECAE7FF4B738D8C8CB02F6E9C78 /* Pods-HealthKitSampleGenerator_Tests-umbrella.h */, - F067A43C230A29C9C8141B79A1197D8D /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */, - 2065F67A980712141655A2AD710F2FB1 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */, + 3E285571EF144F8DACCF451128B351DD /* iOS */, ); - name = "Pods-HealthKitSampleGenerator_Tests"; - path = "Target Support Files/Pods-HealthKitSampleGenerator_Tests"; + name = Frameworks; sourceTree = ""; }; - 2F3C4D7A1BDAAB1400B91D60 /* Export */ = { + 2728BD49D3A3222B00AE72A0BB9D2C43 /* Targets Support Files */ = { isa = PBXGroup; children = ( - 8D52E07D41BF006E3A20713663A1AE5D /* HealthKitDataExporters.swift */, - BA8DC4FBCA1F640EA52C0518EA7B6927 /* HealthKitDataExport.swift */, - CDAB173328DCC7344CE320F9B0EA96D3 /* ExportConfiguration.swift */, - 30E4405FB9FCECB537AEC528E63D2686 /* ExportTargets.swift */, + 4D7CC28874F5694F241B87BF7B90AE7C /* Pods-HealthKitSampleGenerator_Example */, + B7A0C6A077EF23C8555A09ABAD9F39DE /* Pods-HealthKitSampleGenerator_Tests */, ); - name = Export; + name = "Targets Support Files"; sourceTree = ""; }; - 2F3C4D7B1BDAAB2400B91D60 /* Import */ = { + 30D851D92ACA9453AF85250F8D177FD0 /* Products */ = { isa = PBXGroup; children = ( - 2F3C4D8B1BDD66D700B91D60 /* HealthKitProfileImporter.swift */, - 2F3C4D801BDB60BE00B91D60 /* HealthKitProfileReader.swift */, - DE217CBE45F36BFBFB00395B0C116120 /* HealthKitDataImporter.swift */, - 2F3C4D761BDA7BBF00B91D60 /* HealthKitProfile.swift */, - 2F044DF11BE298FD00A0B51F /* SampleCreator.swift */, + 2D63384B6DC0A389B7C876F33606A758 /* HealthKitSampleGenerator.bundle */, + 557C9B937132638D406A61D547A7C9C5 /* HealthKitSampleGenerator.bundle */, + 64BEE0E525E56294CF2380C6F10E19CD /* HealthKitSampleGenerator.framework */, + A7556D5BE075ED60E0523C1B31DF075A /* HealthKitSampleGenerator.framework */, + BAE263041362D074978BB3B577DF0A05 /* Nimble.framework */, + ED9D1F1BB6D5EABA96455E2E064A9699 /* Pods_HealthKitSampleGenerator_Example.framework */, + D57876F111F64E5E177F7711475F8402 /* Pods_HealthKitSampleGenerator_Tests.framework */, + 0D631E9908483F9525A6B3F36F16CC61 /* Quick.framework */, ); - name = Import; + name = Products; sourceTree = ""; }; - 2F3C4D7C1BDAAB4300B91D60 /* Util */ = { + 31B710C67D1F29146C73124F3FC8BBCF /* Support Files */ = { isa = PBXGroup; children = ( - 533F352834CED5F5E3DC61AB1C12DAE1 /* JsonWriter.swift */, - 2F3C4D781BDAAACA00B91D60 /* JsonReader.swift */, - C1BCAA70F3D0609272B4012AA37D0FEF /* OuputStreams.swift */, - 45BD400FBF5D623D08667E12C2A5949F /* Util.swift */, + 94D5F60398D4DBA569DFCDCE27F66E44 /* HealthKitSampleGenerator-iOS12.0.modulemap */, + 4C5EF9D98CB8A4E2092B20A2BFAA87E4 /* HealthKitSampleGenerator-iOS12.0.xcconfig */, + 2F7760CD3D7DB18316E3B6A24BDDCE2F /* HealthKitSampleGenerator-iOS12.0-dummy.m */, + 0B62D0B8E72896934D59D5BEB73E2642 /* HealthKitSampleGenerator-iOS12.0-Info.plist */, + 9B39218028E32B6BC9F5A5F5B5CE0C1A /* HealthKitSampleGenerator-iOS12.0-prefix.pch */, + 2FAF04F1A2F369A1D6F7791129334D8C /* HealthKitSampleGenerator-iOS12.0-umbrella.h */, + D7258CB02C6C8EDE71410DB5FF91F35E /* HealthKitSampleGenerator-iOS9.0.modulemap */, + AB0E6FDFCE4FAD539A912D820E9ABDF5 /* HealthKitSampleGenerator-iOS9.0.xcconfig */, + 5A6E07526ACC83B911CBCE79E7BACEB5 /* HealthKitSampleGenerator-iOS9.0-dummy.m */, + B172BA603CCFC87DAD86FDF4C4E86D05 /* HealthKitSampleGenerator-iOS9.0-Info.plist */, + 37B8CD1313C23153F0E3551250256F7F /* HealthKitSampleGenerator-iOS9.0-prefix.pch */, + FDBCE1A524206D6099978A443C2027FC /* HealthKitSampleGenerator-iOS9.0-umbrella.h */, + A9ABA4FBAC95D7D2D96F1266B89E51C5 /* ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS12.0-Info.plist */, + 6816872EC2AC2F42D88D1E7321D4F21C /* ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS9.0-Info.plist */, ); - name = Util; + name = "Support Files"; + path = "Example/Pods/Target Support Files/HealthKitSampleGenerator-iOS12.0"; sourceTree = ""; }; - 2F3C4D8D1BDE81BE00B91D60 /* HealthKit */ = { + 3E285571EF144F8DACCF451128B351DD /* iOS */ = { isa = PBXGroup; children = ( - 2F3C4D8E1BDE81E300B91D60 /* HealthKitConstants.swift */, - 2F3C4D901BDE82ED00B91D60 /* HealthKitStoreCleaner.swift */, + 033A36A29482FD32230FE0CA177F9BD3 /* Foundation.framework */, + 2C061463250766C9C05995AB8EE63E66 /* XCTest.framework */, ); - name = HealthKit; + name = iOS; sourceTree = ""; }; - 433CD3331B6C3787F473C941B61FC68F /* Frameworks */ = { + 4834F4751D2881783C5B5493BD5A931B /* Quick */ = { isa = PBXGroup; children = ( - 0C6B012983F9FEF8CC65C1318F5F090C /* iOS */, + A42F9FD5967F56D0BEC6D01D8036617B /* Behavior.swift */, + F3E96393F1B6CCA08BF22BD52182B718 /* Callsite.swift */, + 3E9F7D22BF5690CB87C3259789439181 /* Closures.swift */, + 24869D429F09ACFA3227C2E18B5890BD /* Configuration.swift */, + E4893AA0C4CC52C0B2A7A222C417D540 /* DSL.swift */, + ACBC5226F7B70DA1DB008F41E4A01382 /* ErrorUtility.swift */, + C132106EC2A2B0BF3B777DF7150EC3A1 /* Example.swift */, + 8A2FCA7814FB7C6B002B0AC80B728826 /* ExampleGroup.swift */, + 2FD3C0D4239C9AF15D57728ECFF539CA /* ExampleHooks.swift */, + FBFD1878741EFB3E1F1940591412D528 /* ExampleMetadata.swift */, + 368540D083788E46A27376E7CB7215E0 /* Filter.swift */, + 84974814F581E3C4109C60E745BC7FA7 /* HooksPhase.swift */, + AE6F209352A13BD917FF5EC0A629FFF2 /* NSBundle+CurrentTestBundle.swift */, + 7C4D831C03026C50D9C46AAA6A6A99DC /* QCKDSL.h */, + F6B1895FACA2B4330622FD41C6F39486 /* QCKDSL.m */, + C583D55E93D2C23506816D0ECC9CB0B0 /* Quick.h */, + 68938017DBE8BABA6FF05E15B614FA9B /* QuickConfiguration.h */, + C2EE570836DA0A08CE51B59DB06BADC6 /* QuickConfiguration.m */, + 62E7A4D2583FD85F7DB51543BA1D94E9 /* QuickSelectedTestSuiteBuilder.swift */, + 272E81A763DF094D944F3A4E51DEAEA0 /* QuickSpec.h */, + A8313EAA34BE645217DF2852E1522C4B /* QuickSpec.m */, + 136C47632F7E7F3F6A79AABB1A23ABCC /* QuickSpecBase.h */, + 422D1D2C5EAA1517BC9DD050822F4A05 /* QuickSpecBase.m */, + 8870A295B06D321277C67CED13393F6F /* QuickTestSuite.swift */, + 94A3A522E1EFCE6A2A59F49005B74E34 /* String+C99ExtendedIdentifier.swift */, + 5CB541A541AF860EEA97FE5501182862 /* SuiteHooks.swift */, + E5E4175EF98E338D8D5D3702B8E48D7D /* URL+FileName.swift */, + 05DDA5F5BD67D707AA716145591CA7D6 /* World.swift */, + 364E9FAB6806BBBDFD1BD4E5C7A6126F /* World+DSL.swift */, + 2934A3B4FE683A7B1077812515D6E5F0 /* XCTestSuite+QuickTestSuiteBuilder.m */, + EDF1A86CF327EB110CDB275D6940B008 /* Support Files */, ); - name = Frameworks; + name = Quick; + path = Quick; sourceTree = ""; }; - 68DCFB6BE33A94D7D178B8A8BB1F9AE1 /* Pods-HealthKitSampleGenerator_Example */ = { + 4D7CC28874F5694F241B87BF7B90AE7C /* Pods-HealthKitSampleGenerator_Example */ = { isa = PBXGroup; children = ( - 06C70772C887953F1F94E04C52352B56 /* Info.plist */, - DCEADAC4412D7F90B48590D152979DA2 /* Pods-HealthKitSampleGenerator_Example.modulemap */, - 4C72C225DE1AC5E012728543D62538C0 /* Pods-HealthKitSampleGenerator_Example-acknowledgements.markdown */, - F4F7CC0FF4FDF241BA9DFC5C81AD4D25 /* Pods-HealthKitSampleGenerator_Example-acknowledgements.plist */, - 7E5D76E71FC213B2E6761F0723AD0FEF /* Pods-HealthKitSampleGenerator_Example-dummy.m */, - 04F89B076472BD1D4EC51E9236DD965A /* Pods-HealthKitSampleGenerator_Example-frameworks.sh */, - 6F746BC3426C524B4B39B5B14C86355A /* Pods-HealthKitSampleGenerator_Example-resources.sh */, - 05392518CC0907AC7B9939ADBA69A9D2 /* Pods-HealthKitSampleGenerator_Example-umbrella.h */, - 31971283FA8916C9C34FAFEA055DAA40 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */, - 4DFBE0597ED6EFD7CD381DDD40002C82 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */, + 18973B4A2606EB857D084682494CD62B /* Pods-HealthKitSampleGenerator_Example.modulemap */, + 6ECCAF0CEC47A60AAD80171F12F8CD5C /* Pods-HealthKitSampleGenerator_Example-acknowledgements.markdown */, + 1A076E6CBB7288548DA95CFE05332BDB /* Pods-HealthKitSampleGenerator_Example-acknowledgements.plist */, + E5735BFAA5EDB170F09EDDF59663561D /* Pods-HealthKitSampleGenerator_Example-dummy.m */, + FA92F9B0421B9CF3A276D8DCCF5BD001 /* Pods-HealthKitSampleGenerator_Example-frameworks.sh */, + 2B4018DCB940069C7566CC28E0E202C7 /* Pods-HealthKitSampleGenerator_Example-Info.plist */, + F56902052292F75D6808F9D5A12BFD45 /* Pods-HealthKitSampleGenerator_Example-umbrella.h */, + 069C682EEEBCF3EE8665570008C849F1 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */, + 8AC582B71748EDB1E883421F93EDB0C9 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */, ); name = "Pods-HealthKitSampleGenerator_Example"; path = "Target Support Files/Pods-HealthKitSampleGenerator_Example"; sourceTree = ""; }; - 6CF1E8688E333FFE0BDC81C0128826E0 /* Support Files */ = { - isa = PBXGroup; - children = ( - FDF69059FDEE5D3E2C829506DB742016 /* HealthKitSampleGenerator.modulemap */, - A67AB7515622C4C1A2D2E316138980F0 /* HealthKitSampleGenerator.xcconfig */, - DCBFDDCFDF4EA1701C922C06B3827998 /* HealthKitSampleGenerator-dummy.m */, - B85C08EC5C37C197FE795DE291779115 /* HealthKitSampleGenerator-prefix.pch */, - 3F73B652E33588342E0DA69D1303A62B /* HealthKitSampleGenerator-umbrella.h */, - F0CFF613419D3D46E21AF78A2D898D3C /* Info.plist */, - ); - name = "Support Files"; - path = "Example/Pods/Target Support Files/HealthKitSampleGenerator"; - sourceTree = ""; - }; - 70D49817437CAB93F432318ECF028F3B /* Pod */ = { + 5A4B7D396178EF46153B9BA5073BD893 /* Development Pods */ = { isa = PBXGroup; children = ( - D16DD427BCCBF3F8643B7B6A1BDA51E0 /* Classes */, - ); - path = Pod; - sourceTree = ""; - }; - 747F6E5B8533BA52FCAE462F044D4CF0 /* Development Pods */ = { - isa = PBXGroup; - children = ( - 85B278174A84BBFA7BAEE3277BE3DC0D /* HealthKitSampleGenerator */, + AFBDA0A003FDCE0765B5AA78699FB7B3 /* HealthKitSampleGenerator */, ); name = "Development Pods"; sourceTree = ""; }; - 7DB346D0F39D3F0E887471402A8071AB = { - isa = PBXGroup; - children = ( - BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, - 747F6E5B8533BA52FCAE462F044D4CF0 /* Development Pods */, - 433CD3331B6C3787F473C941B61FC68F /* Frameworks */, - DE74E51B0D4E9479AF0AF5CF4147F11F /* Pods */, - E9BFE82E77C37F01B66702BCDF3E6C6F /* Products */, - 8A69C263118CBF28F16E21DE06657E61 /* Targets Support Files */, - ); - sourceTree = ""; - }; - 85B278174A84BBFA7BAEE3277BE3DC0D /* HealthKitSampleGenerator */ = { + AFBDA0A003FDCE0765B5AA78699FB7B3 /* HealthKitSampleGenerator */ = { isa = PBXGroup; children = ( - 70D49817437CAB93F432318ECF028F3B /* Pod */, - 6CF1E8688E333FFE0BDC81C0128826E0 /* Support Files */, + 88D1EC3746A3C8A778DC03BC2DC62107 /* ExportConfiguration.swift */, + 4EFF1F21F44EFE6E2C3C5704991B7AAB /* ExportTargets.swift */, + F8D8749CFCB600850D2F91C3FF84B598 /* HealthKitConstants.swift */, + FB22F723F4A0AB766E7561491CE9F816 /* HealthKitDataExport.swift */, + D7E199EC034A2CDD766B36ADAB700C77 /* HealthKitDataExporters.swift */, + BA5D2C36B02E4980D87004A768FD5829 /* HealthKitDataImporter.swift */, + 28E0BB69496EDDC416745081F1FA2396 /* HealthKitProfile.swift */, + 0638C38EB3A6ABECBBA923D00A334F54 /* HealthKitProfileImporter.swift */, + 1C400F272DB7F96D0B9053626461CB8D /* HealthKitProfileReader.swift */, + 5249F13837CE6F74AF85BCBBC3D73A2E /* HealthKitStoreCleaner.swift */, + 2EA80C281F10007B4E1AD8A006D0D564 /* JsonReader.swift */, + 553F1097B3BEC61A6B4B8557BE84845A /* JsonWriter.swift */, + 757747E7F4E7FA6DCEE03B4ED599EC49 /* OuputStreams.swift */, + 9F8358E15CADADA4BE099ED9BCB0183F /* SampleCreator.swift */, + DBD1C7AB842EDF1F1B035E15253D4DAB /* Util.swift */, + 11778F3B2FFA9C970C03D6E9FA7B5E88 /* Pod */, + 31B710C67D1F29146C73124F3FC8BBCF /* Support Files */, ); name = HealthKitSampleGenerator; path = ../..; sourceTree = ""; }; - 8A69C263118CBF28F16E21DE06657E61 /* Targets Support Files */ = { + B7A0C6A077EF23C8555A09ABAD9F39DE /* Pods-HealthKitSampleGenerator_Tests */ = { isa = PBXGroup; children = ( - 68DCFB6BE33A94D7D178B8A8BB1F9AE1 /* Pods-HealthKitSampleGenerator_Example */, - 29432D6C01F4BDA44490922607386604 /* Pods-HealthKitSampleGenerator_Tests */, + CE7DF46C311E71797B3145F184AA42BF /* Pods-HealthKitSampleGenerator_Tests.modulemap */, + 124682FCE442389E1D941F359629CEB6 /* Pods-HealthKitSampleGenerator_Tests-acknowledgements.markdown */, + 32A2D42928EB0493598EB339A88244A9 /* Pods-HealthKitSampleGenerator_Tests-acknowledgements.plist */, + F49FFD2FCA0E26B1565E30CF32FA397F /* Pods-HealthKitSampleGenerator_Tests-dummy.m */, + BC25678D1651CEF7F84B7962117899B3 /* Pods-HealthKitSampleGenerator_Tests-frameworks.sh */, + 564DD0CA03DCCDA56F5E5784D4FB29F3 /* Pods-HealthKitSampleGenerator_Tests-Info.plist */, + B2596248E4BEEC94FA5EE72A3042E864 /* Pods-HealthKitSampleGenerator_Tests-umbrella.h */, + B5974989CA3FCE9604B9C6182B63FA85 /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */, + BCCE45A1A037826AD9B16B9F96F015B0 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */, ); - name = "Targets Support Files"; + name = "Pods-HealthKitSampleGenerator_Tests"; + path = "Target Support Files/Pods-HealthKitSampleGenerator_Tests"; sourceTree = ""; }; - A695A9A8FC40B5B4FFCE5E2B8F3619A5 /* Nimble */ = { + BD2F1A6FE68DC5AF3C94418A88BB7E29 /* Pods */ = { isa = PBXGroup; children = ( - A6E19A9388A0C8DA53D6C2937D614BC0 /* AdapterProtocols.swift */, - F78842A0EDB440C836A713C1EB30BED0 /* AllPass.swift */, - 9E8D1C01B51D84AF46DFD636322A626F /* AssertionDispatcher.swift */, - 335CFF9F10075C8B76653D3514A5E0E9 /* AssertionRecorder.swift */, - BB0AAC5C2C17AB91FC015B6F025C4236 /* AsyncMatcherWrapper.swift */, - 79D25D06CF4A364C27B940631A4F4101 /* BeAKindOf.swift */, - 65EE5D01998D0C315455F137386476DA /* BeAnInstanceOf.swift */, - 65657B6DA73C51B28FA14CBA1826FA1B /* BeCloseTo.swift */, - B084C81C036B7746D76266AB1EECFF87 /* BeEmpty.swift */, - B93004E59D8B110EA031F6792095E6F7 /* BeginWith.swift */, - 22EB29F62F015520EDFE36A7546DC59B /* BeGreaterThan.swift */, - BBFA48AD4CBF2294E94626E2803758E1 /* BeGreaterThanOrEqualTo.swift */, - D97656C1C2771474F6A2D4DA5967D6B6 /* BeIdenticalTo.swift */, - F3DC3AB502D15DF6EB3C260E6A3DD5F1 /* BeLessThan.swift */, - 4FBDA8E18FE726B211EFFD968840822D /* BeLessThanOrEqual.swift */, - 8ACBD62C4BCA19645C0D09AE0643CFA9 /* BeLogical.swift */, - 326A8B8239D07F9F25E079DFB644B266 /* BeNil.swift */, - D1D6AE8CF6D24D4020AF1545FBF314AC /* Contain.swift */, - 7A30E01188DC863EA2CCCCC3AC7BF85C /* DSL.h */, - 2C29D0140F99F570B9C3CF9B2CAEB2D6 /* DSL.m */, - 1B1A32AA2E30641BB916437CED9E453B /* DSL.swift */, - 2D7A20C09F57F76DE513CA0E69DC58CD /* DSL+Wait.swift */, - ADB2573055CDD988719A774B9A78C2B2 /* EndWith.swift */, - 93B98129D40B8C3F2FDD553D34874099 /* Equal.swift */, - 2924F25F9C2725ED940553BE00291381 /* Expectation.swift */, - 9807B49E75E1BD31C6B1C0B82A605446 /* Expression.swift */, - EB5FACF1560864472E1A30E5AB7219FD /* FailureMessage.swift */, - 0BBA70B64DD0AE4F3F7C98C7D3EDFA24 /* Functional.swift */, - 8C747D50EBC2ACF5417760BE6F0E33CB /* Match.swift */, - 1F5F6EB9441474C247F801F9A31D56C5 /* MatcherFunc.swift */, - 5268D6308FD81E6D31EB2B5EB9648544 /* MatcherProtocols.swift */, - 88CC68431B40DD61E43E9A139896FE98 /* Nimble.h */, - A4407A26444065C3BE7EB897542AD0C9 /* NimbleXCTestHandler.swift */, - B068DA44A3F9A0CCBE7CCE98CAF09C32 /* NMBExceptionCapture.h */, - 1FE9E62B60B72E1688DB605366DA964A /* NMBExceptionCapture.m */, - 49C14BC51A6DA84A37B30353A6D01A6A /* ObjCExpectation.swift */, - D1577FF53CF0CE7F1C287BB55F0DA509 /* ObjCMatcher.swift */, - 768B106CF8116EDB0C6830AF7F4EEF1B /* Poll.swift */, - 5B4EE4B2DE224D286FF6E24BEE413D86 /* RaisesException.swift */, - D2FC6DDA74F238B17F46BC8E4AB02863 /* SourceLocation.swift */, - 8B0B9C732794857EF894135327888153 /* Stringers.swift */, - 18E03A7CF3BBC2D4D1235C5F8CDACBC5 /* ThrowError.swift */, - 19DF80A5D891EAB3ED7E0AA2B96ADC69 /* Support Files */, + E2697886F3CD10A152F47D611F1B1A3B /* Nimble */, + 4834F4751D2881783C5B5493BD5A931B /* Quick */, ); - path = Nimble; + name = Pods; sourceTree = ""; }; - CE170A8221839C5ABA1F5BA4293D0117 /* Support Files */ = { + CF1408CF629C7361332E53B88F7BD30C = { isa = PBXGroup; children = ( - 2A7AB4BFDA57F45CCF189DFA5305EB6D /* Info.plist */, - 7A9E1EDB533A0CE303B1043D42B23D8E /* Quick.modulemap */, - 2F66B2F667E5F1FC43A5803846F29CE3 /* Quick.xcconfig */, - B16B152669ADACF3254C0F790E2AB6DB /* Quick-dummy.m */, - 396609E77E8F1D994629241C6F84CC02 /* Quick-prefix.pch */, - 09ED86DD95111B4BA74888E09DB678C5 /* Quick-umbrella.h */, + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, + 5A4B7D396178EF46153B9BA5073BD893 /* Development Pods */, + 1628BF05B4CAFDCC3549A101F5A10A17 /* Frameworks */, + BD2F1A6FE68DC5AF3C94418A88BB7E29 /* Pods */, + 30D851D92ACA9453AF85250F8D177FD0 /* Products */, + 2728BD49D3A3222B00AE72A0BB9D2C43 /* Targets Support Files */, ); - name = "Support Files"; - path = "../Target Support Files/Quick"; sourceTree = ""; }; - D16DD427BCCBF3F8643B7B6A1BDA51E0 /* Classes */ = { + E2697886F3CD10A152F47D611F1B1A3B /* Nimble */ = { isa = PBXGroup; children = ( - 2F3C4D8D1BDE81BE00B91D60 /* HealthKit */, - 2F3C4D7C1BDAAB4300B91D60 /* Util */, - 2F3C4D7B1BDAAB2400B91D60 /* Import */, - 2F3C4D7A1BDAAB1400B91D60 /* Export */, + 722949AE9C9F2FA0EF6CFB37D69144B8 /* AdapterProtocols.swift */, + 012EE64BD755D0863890CA9320E900A3 /* AllPass.swift */, + 6F741A325D114DF7E530BDD203FB56B4 /* AssertionDispatcher.swift */, + 16602DD9FB05FA5EDA288D40D2BE6F29 /* AssertionRecorder.swift */, + 065E13545322CFF21FDD119A616DA78A /* Async.swift */, + EC1D76E5BE2C06FDC8DD47B8BFBAE133 /* Await.swift */, + A4C7D88B76C4738E7B74168479A92315 /* BeAKindOf.swift */, + BB983C01ACCC87D37C64FEEEBD015E6C /* BeAnInstanceOf.swift */, + E06F79CAFC1A7C21CE9CA39591BCAAC4 /* BeCloseTo.swift */, + 0ED6EF353CCE6BBF803A1F717FBEC8D1 /* BeEmpty.swift */, + 441B1D5DAE79FCCB2C541078158C4BF6 /* BeginWith.swift */, + 8248FB8AF316C9C78E22B71BC196957D /* BeGreaterThan.swift */, + 64AD8B83D74F555E11F65FFF5385A326 /* BeGreaterThanOrEqualTo.swift */, + 9A0D1AFC5AE24413DD273B5725D87879 /* BeIdenticalTo.swift */, + 071B61EF30BF90EC731B83F28117F075 /* BeLessThan.swift */, + EB7332A0B6ABF2ED2D514AA4D9D86E93 /* BeLessThanOrEqual.swift */, + 406655908ED5468CE961BB85AB39C8A7 /* BeLogical.swift */, + 6D46641E08F746A053C1B8D92B7A34A4 /* BeNil.swift */, + 41AEFF6F0F8641915460E14078EAA621 /* BeVoid.swift */, + 13F246159743DE22E6CD521024BC0F8B /* Contain.swift */, + 516302BEEE3227BA3C6DAD440E033F8F /* ContainElementSatisfying.swift */, + 75D3859EAFA486485F8FA5D6B49A11D2 /* CwlBadInstructionException.swift */, + FC0E8FB31B8A59EEDED9EC78DB693257 /* CwlCatchBadInstruction.swift */, + 1208008CFB860726BD6C3DD35E138D78 /* CwlCatchException.h */, + 48FEC9D5A615C2DFE3E756E8D25871A8 /* CwlCatchException.m */, + 039D8A83F931FBCB15CA68FFEF57A2EE /* CwlCatchException.swift */, + 7BD691153E3D635D7044FC779C5E82DB /* CwlDarwinDefinitions.swift */, + 65191C87D7890AEF4187AC979AD0E5E2 /* CwlMachBadInstructionHandler.h */, + 7EA4ACEB8BB07BE97686541FE31664DC /* CwlMachBadInstructionHandler.m */, + A78650F56FB20B8C081C0B0A1AFEF5BC /* CwlPreconditionTesting.h */, + 0B2D0652D8F3AACE18A933AE4B00D6DD /* DSL.h */, + 02C2D11765F7EBF07D22F0B2B819E95E /* DSL.m */, + CCA5AB714E05DFC6CB1A9055125E47B3 /* DSL.swift */, + 80EFA2D981F85EAF6601CE6AC577D669 /* DSL+Wait.swift */, + B14E94646E4C206F66E9782E6E193B11 /* ElementsEqual.swift */, + 0D1C348A0AEB51F638DA71120681121C /* EndWith.swift */, + 65854C431528E8C830E8B7C38D0C07FD /* Equal.swift */, + 8EEEBEBF7B787898DF09E2EED055400F /* Errors.swift */, + EE2CBFD5F43ED31F0DDCC57F9EC33207 /* Expectation.swift */, + D0FCB20926BF616C0519CF8F6AF0431A /* ExpectationMessage.swift */, + 8BD31630E5AF5A91E26BE84FFB08A710 /* Expression.swift */, + 2E416B96F586F3EB4A1DBACB1614B452 /* FailureMessage.swift */, + 8263FE30A0637516FC0C9EAF7D240603 /* Functional.swift */, + 8F83AA747B59E2383BB6662A3B086129 /* HaveCount.swift */, + 9194C82BBC06F2BF3019F69BBA2CFE6A /* mach_excServer.c */, + A4BBF0EC502678F53DF8E608F8A6ACAD /* mach_excServer.h */, + CDEBB03188E78EC76D213ABBD7B5B03E /* Match.swift */, + 2450165A9350C8074899189666ECDA5C /* MatcherFunc.swift */, + 083FAD88BB13235D753745BB0BD020DC /* MatcherProtocols.swift */, + DA112225FF526E65896DDDF956F74AF1 /* MatchError.swift */, + 5AA48BA1D17B1B83CE23CDC2248A7701 /* Nimble.h */, + D2B077F09D6DBE64FF23B4C78D3D7E69 /* NimbleEnvironment.swift */, + ACEB3B980103F727C9A633F3B80B1C75 /* NimbleXCTestHandler.swift */, + 89C4E6BA342A6FC91795E2E7D80F58F6 /* NMBExceptionCapture.h */, + 23FAD2462D03C757D0F7C333E9CC3968 /* NMBExceptionCapture.m */, + E36B3C15E01EE137782FAC1B4FF87475 /* NMBExpectation.swift */, + 3D4DE94AC94FFBF28441A0C36561FC78 /* NMBObjCMatcher.swift */, + B6E258AD83036FBA23547DE0C55FBC5A /* NMBStringify.h */, + 97CC26A7C8608378C3FD9889E4AD23BF /* NMBStringify.m */, + EF37E74A9438A098FCB61CE88B18A3DF /* PostNotification.swift */, + D0F049F75F04FA056779DB22775048E7 /* Predicate.swift */, + 6C16292C7017193603A06ACACB75982D /* RaisesException.swift */, + C2E47533D52832DD152803938E8A8C59 /* SatisfyAllOf.swift */, + F13F7B116AF8EB86D89CA43A8D15C927 /* SatisfyAnyOf.swift */, + 6B4FE44A565B7D51777C3DCF0536EE10 /* SourceLocation.swift */, + 86B89A93059F29AC9ACCCAC660F4AFEA /* Stringers.swift */, + 81F935EBD39724CDCD2E42790617701D /* ThrowAssertion.swift */, + 696B48A141606A71BC0ABD43B9A52D8F /* ThrowError.swift */, + C96571B81B1E1F2A7632243AA8B316CE /* ToSucceed.swift */, + 7AF3B3EFA75292B9FDDC5E6B447AEEAC /* XCTestObservationCenter+Register.m */, + FF18E9D757C04B2D9DD64D169490B0B4 /* Support Files */, ); - path = Classes; + name = Nimble; + path = Nimble; sourceTree = ""; }; - DE74E51B0D4E9479AF0AF5CF4147F11F /* Pods */ = { + EDF1A86CF327EB110CDB275D6940B008 /* Support Files */ = { isa = PBXGroup; children = ( - A695A9A8FC40B5B4FFCE5E2B8F3619A5 /* Nimble */, - 00A20E6A871A38C64CF268D27DA934D4 /* Quick */, + 5243E8433E7F4F1E8C496EC66E5F0F55 /* Quick.modulemap */, + A957896A3325D9065B06E8F877B18D37 /* Quick.xcconfig */, + 885169D56AF63F349D986F6FD6A19304 /* Quick-dummy.m */, + 465AE41C5EDD179EB8E2E75DDA09D54B /* Quick-Info.plist */, + 6BBAA1DC1CA8B0EFC72B63DBDF6330FB /* Quick-prefix.pch */, + 3EFEEEC9948D8453804CF7F9368DEE5E /* Quick-umbrella.h */, ); - name = Pods; + name = "Support Files"; + path = "../Target Support Files/Quick"; sourceTree = ""; }; - E9BFE82E77C37F01B66702BCDF3E6C6F /* Products */ = { + FF18E9D757C04B2D9DD64D169490B0B4 /* Support Files */ = { isa = PBXGroup; children = ( - D1DC8F50B9C12FC5068F88985400C2BF /* HealthKitSampleGenerator.bundle */, - CC00BC5138948EA7BF41D86A898DC98D /* HealthKitSampleGenerator.framework */, - 06DED06545D9AACEE3872300E5A2B919 /* Nimble.framework */, - A52991290649BB41FA1E41AD7DE179FB /* Pods_HealthKitSampleGenerator_Example.framework */, - A099A919DF437B37F19A37E60313F302 /* Pods_HealthKitSampleGenerator_Tests.framework */, - AADE5D2636ED81E33B78C6ED8A9E53CF /* Quick.framework */, + 60909C72945118E784FF4AEF6450E356 /* Nimble.modulemap */, + 90C5E2161B26FB91DE16BFC45DAEC7BF /* Nimble.xcconfig */, + A0530A8F7FBFDC9F647711A1B1906204 /* Nimble-dummy.m */, + 8A457B9BDB6A97F670558A507319208B /* Nimble-Info.plist */, + EF20CB0D6D12D898151E14B8FCC6A689 /* Nimble-prefix.pch */, + 79E669D410B80DA80A4E1F68BE665EAC /* Nimble-umbrella.h */, ); - name = Products; + name = "Support Files"; + path = "../Target Support Files/Nimble"; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 0AD3BD7979980E26E0EE3B390309B918 /* Headers */ = { + 017A9AA7A2C3FDE658339525CBC5AD81 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E011C2C205009C5BA7BF20FB18F4B52 /* HealthKitSampleGenerator-iOS12.0-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 51A00ABBA2BEF3913A4628399CEBD45B /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - A4DD4686A303B828782BD3A0D3B6D804 /* Pods-HealthKitSampleGenerator_Example-umbrella.h in Headers */, + 221ED892E5138A00F3CDF540E914519D /* CwlCatchException.h in Headers */, + 9F70369EF71BD9ABAFF687AF532CC20D /* CwlMachBadInstructionHandler.h in Headers */, + 19BA8AF46D9CC49E3E2CEDCAF6354442 /* CwlPreconditionTesting.h in Headers */, + C051C0411627BD5FCDA031782EB1F716 /* DSL.h in Headers */, + 3BD0C370BBCEBDEA68B8EDBD969370EB /* mach_excServer.h in Headers */, + CD6B1F146B0E157FE5B9CAFFAE77A5B5 /* Nimble-umbrella.h in Headers */, + 9BB5E9B6487FE95C710687B484C17161 /* Nimble.h in Headers */, + 8D17749611AB0C8BD51C068749D8DF68 /* NMBExceptionCapture.h in Headers */, + E0EAC85F7ACFAD998B14FCE66144000E /* NMBStringify.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - 39B5E9ED355C0A41F0B21337EBEDAAFF /* Headers */ = { + 5E3C46E8EEA7723EAB385CB1BA4A1DA4 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - D4A7396949AA6A12CB7DE5CC3751E0C8 /* NSString+QCKSelectorName.h in Headers */, - BEBF004140316D42358B18B02B18553F /* QCKDSL.h in Headers */, - 3689360651A699DC84CD3A88F843A2EF /* Quick-umbrella.h in Headers */, - 8B77C531EB3F66A07096DB3C2B1CBEA4 /* Quick.h in Headers */, - F803A8468D5798FC74444D71CD157EF5 /* QuickConfiguration.h in Headers */, - 08C51942CC4D09E0656E126FC5941299 /* QuickSpec.h in Headers */, - 6265B55A93A55A970B458AB2DEAC0F41 /* World+DSL.h in Headers */, - 1FE799F6E3BF45982DEB8D03BD84D125 /* World.h in Headers */, + 36673119E34B37811B4673AC17D3AD67 /* Pods-HealthKitSampleGenerator_Tests-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - 68AAAD37D79B3F58D12CE2B1E26F9746 /* Headers */ = { + 99F556BB5F0BF7FAFB1681C1603B5441 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - F85AC28B749BDC3C651D58A8BEF7CF68 /* Pods-HealthKitSampleGenerator_Tests-umbrella.h in Headers */, + 58C9067713CFD8FBC5A97DA18C362AAE /* Pods-HealthKitSampleGenerator_Example-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - ABD870A9E03CA8F1CE7A766C92EA70FA /* Headers */ = { + EC3EC9092F61BD757267FD6009C275C5 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - AFD4473019156F312855F23BECCD0208 /* DSL.h in Headers */, - 3D903B746E80BF5C7DEB126F0E1BA1A7 /* Nimble-umbrella.h in Headers */, - B8075EFE15EFA986DDC045A83BE77F04 /* Nimble.h in Headers */, - 066563795376AFDFB39F4EC98CB4B129 /* NMBExceptionCapture.h in Headers */, + C912897D77798A90873A3DAD8A4BDC50 /* QCKDSL.h in Headers */, + BD379F95293A811D8E591CAC8E9FF410 /* Quick-umbrella.h in Headers */, + A9BF211D24462D531E278F2AE317AEA4 /* Quick.h in Headers */, + 34EA8D74C57BC1A6AC8C0A5B5267E56C /* QuickConfiguration.h in Headers */, + D755642ECA73CFE2E4C31CDD0DFBA42E /* QuickSpec.h in Headers */, + 403F837F9B4AC86C901D238D847A767A /* QuickSpecBase.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; - F9AF1F82F029F577096145AC24508D52 /* Headers */ = { + FA0D969149B9D851FCCF926104E8572F /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 6B844E97A77B46EFEDB9AF7C0215799D /* HealthKitSampleGenerator-umbrella.h in Headers */, + B4D4F58639206237B353808D9E70B30E /* HealthKitSampleGenerator-iOS9.0-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 68536CFD0F3A9676D8F9016A4D3AF16C /* Pods-HealthKitSampleGenerator_Tests */ = { + 1F8927426752C08FD6EE9B2E5A88B646 /* HealthKitSampleGenerator-iOS12.0-HealthKitSampleGenerator */ = { isa = PBXNativeTarget; - buildConfigurationList = FA3881EF0DE8DD5565C0462ABDD806B2 /* Build configuration list for PBXNativeTarget "Pods-HealthKitSampleGenerator_Tests" */; + buildConfigurationList = E06B5C97A014AEFA4FF3C7412C2DEF12 /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator-iOS12.0-HealthKitSampleGenerator" */; buildPhases = ( - AF70BE4247096082FCC712E989618E88 /* Sources */, - 5507D876FBF49DCD893370E48CEB762B /* Frameworks */, - 68AAAD37D79B3F58D12CE2B1E26F9746 /* Headers */, + A4D6981478BE8F836C68D5E5655B305C /* Sources */, + 49E824FAE98018288CFFF490C18DDFFA /* Frameworks */, + C9FD37FFC2DAEC84D7EEF205C1408AE0 /* Resources */, ); buildRules = ( ); dependencies = ( - A63BBA2CF57084A674D1E88F573BA649 /* PBXTargetDependency */, - F22FEBD4BD792DF7FC8F27E2BEB049AF /* PBXTargetDependency */, - 2495D2C44595DAE50BEB27247A3871A1 /* PBXTargetDependency */, ); - name = "Pods-HealthKitSampleGenerator_Tests"; - productName = "Pods-HealthKitSampleGenerator_Tests"; - productReference = A099A919DF437B37F19A37E60313F302 /* Pods_HealthKitSampleGenerator_Tests.framework */; - productType = "com.apple.product-type.framework"; + name = "HealthKitSampleGenerator-iOS12.0-HealthKitSampleGenerator"; + productName = "HealthKitSampleGenerator-iOS12.0-HealthKitSampleGenerator"; + productReference = 2D63384B6DC0A389B7C876F33606A758 /* HealthKitSampleGenerator.bundle */; + productType = "com.apple.product-type.bundle"; }; - 8849EF21BC824D03AA41F5ED190F3DDE /* Quick */ = { + 5C8A8103606742343FAC5419D57F4221 /* HealthKitSampleGenerator-iOS9.0 */ = { isa = PBXNativeTarget; - buildConfigurationList = EE90A734DDA0232A0F20312F2497DEEC /* Build configuration list for PBXNativeTarget "Quick" */; + buildConfigurationList = 3184C0FCD72202A7421F3E302E805590 /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator-iOS9.0" */; buildPhases = ( - A8DE65A235D3FC5323D49E5933E9EFE5 /* Sources */, - 4AD97663EFDC1832CA39881AC4B08242 /* Frameworks */, - 39B5E9ED355C0A41F0B21337EBEDAAFF /* Headers */, + FA0D969149B9D851FCCF926104E8572F /* Headers */, + AA45B3C88102A3BCB40703997CAC98B7 /* Sources */, + AB369B2B747B5897D26FBF4EE2247648 /* Frameworks */, + E31A7ADB641CF33F87C7B8CDF9C1DCC2 /* Resources */, ); buildRules = ( ); dependencies = ( + 82CD1FDA351C7438E12F46F53CFDB421 /* PBXTargetDependency */, ); - name = Quick; - productName = Quick; - productReference = AADE5D2636ED81E33B78C6ED8A9E53CF /* Quick.framework */; + name = "HealthKitSampleGenerator-iOS9.0"; + productName = "HealthKitSampleGenerator-iOS9.0"; + productReference = A7556D5BE075ED60E0523C1B31DF075A /* HealthKitSampleGenerator.framework */; productType = "com.apple.product-type.framework"; }; - 9DB05EFC751028DD93CF970F1102971B /* HealthKitSampleGenerator */ = { + 6F13695E06195A78EA8A95F8C7ED0D2F /* Nimble */ = { isa = PBXNativeTarget; - buildConfigurationList = 03431A35E9399C76DAB85AE79BEA3E5E /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator" */; + buildConfigurationList = 9AC65E53333ACA93EEB1D8EBAB58CBB6 /* Build configuration list for PBXNativeTarget "Nimble" */; buildPhases = ( - 284D41A1AD7973A4E093A95363F63743 /* Sources */, - 2EF91420B3911830636291D6BF17C1F9 /* Frameworks */, - A7B2CFF177F60651F072E761E7A31202 /* Resources */, - F9AF1F82F029F577096145AC24508D52 /* Headers */, + 51A00ABBA2BEF3913A4628399CEBD45B /* Headers */, + D399136A0E6FE19CACE7F05143312FB1 /* Sources */, + 55C81EE76C6A69F1F69792A679310C68 /* Frameworks */, + D7EBE1F47ACC336A60ED6056AF3261E1 /* Resources */, ); buildRules = ( ); dependencies = ( - 5393EBB40BD201D15B524337F93408BD /* PBXTargetDependency */, ); - name = HealthKitSampleGenerator; - productName = HealthKitSampleGenerator; - productReference = CC00BC5138948EA7BF41D86A898DC98D /* HealthKitSampleGenerator.framework */; + name = Nimble; + productName = Nimble; + productReference = BAE263041362D074978BB3B577DF0A05 /* Nimble.framework */; productType = "com.apple.product-type.framework"; }; - AA9FEF2B832A46B4168C3A5DF734EA03 /* Pods-HealthKitSampleGenerator_Example */ = { + 878423F5EEE267A73519A25BFBCC8D8C /* Pods-HealthKitSampleGenerator_Example */ = { isa = PBXNativeTarget; - buildConfigurationList = 910B7F2C2A2D95F3879296183B77675A /* Build configuration list for PBXNativeTarget "Pods-HealthKitSampleGenerator_Example" */; + buildConfigurationList = 31C6C6CB9804CB952E15F8E945EA2795 /* Build configuration list for PBXNativeTarget "Pods-HealthKitSampleGenerator_Example" */; buildPhases = ( - 3EEE5FB7F1F5D2BF9AC174DF58E55B84 /* Sources */, - 17294DB1499163CFDA40EAC1E0FC5F9F /* Frameworks */, - 0AD3BD7979980E26E0EE3B390309B918 /* Headers */, + 99F556BB5F0BF7FAFB1681C1603B5441 /* Headers */, + 6CA9B0F7B6AC04D0A7366E7F6D0E83C6 /* Sources */, + A16B6842C245A93C4C8D39969313129E /* Frameworks */, + 547B9F3FCFB573B42450009A94CF46B2 /* Resources */, ); buildRules = ( ); dependencies = ( - 8A46DCDD4BE9084A7284196585B8D168 /* PBXTargetDependency */, + F737A3868C865325C42A1D091C586585 /* PBXTargetDependency */, ); name = "Pods-HealthKitSampleGenerator_Example"; productName = "Pods-HealthKitSampleGenerator_Example"; - productReference = A52991290649BB41FA1E41AD7DE179FB /* Pods_HealthKitSampleGenerator_Example.framework */; + productReference = ED9D1F1BB6D5EABA96455E2E064A9699 /* Pods_HealthKitSampleGenerator_Example.framework */; productType = "com.apple.product-type.framework"; }; - AE4F696CC357FA27AC16FF75A72C8C40 /* Nimble */ = { + 8D49D5BC5615B12C21DEC7C7F839A0E4 /* HealthKitSampleGenerator-iOS9.0-HealthKitSampleGenerator */ = { isa = PBXNativeTarget; - buildConfigurationList = 05F0D4745510A049E7DC8D6BA65F20ED /* Build configuration list for PBXNativeTarget "Nimble" */; + buildConfigurationList = 0879F70A5548A8B44BEEDEE13211C5A3 /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator-iOS9.0-HealthKitSampleGenerator" */; buildPhases = ( - 2F81F85FF70B094B119BB42268C8C106 /* Sources */, - AEB3789DDABC631658180BF3D5AA98A5 /* Frameworks */, - ABD870A9E03CA8F1CE7A766C92EA70FA /* Headers */, + E6DA69FD14CBAD6A63F22D938E9390D7 /* Sources */, + B8DCB29D20115574E76B52CEE1288CE5 /* Frameworks */, + 25514F2DD129927EF43086DB50AA85AD /* Resources */, ); buildRules = ( ); dependencies = ( ); - name = Nimble; - productName = Nimble; - productReference = 06DED06545D9AACEE3872300E5A2B919 /* Nimble.framework */; + name = "HealthKitSampleGenerator-iOS9.0-HealthKitSampleGenerator"; + productName = "HealthKitSampleGenerator-iOS9.0-HealthKitSampleGenerator"; + productReference = 557C9B937132638D406A61D547A7C9C5 /* HealthKitSampleGenerator.bundle */; + productType = "com.apple.product-type.bundle"; + }; + A149403F5B7302441FD39D762F3B67B1 /* HealthKitSampleGenerator-iOS12.0 */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4C35AF5826D695FF62603732E90BB92E /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator-iOS12.0" */; + buildPhases = ( + 017A9AA7A2C3FDE658339525CBC5AD81 /* Headers */, + E559EEC86B939C9B304BAFDD56907A25 /* Sources */, + FEFD90CCBFD8ED874465080EBC009E86 /* Frameworks */, + 6FB802F3182F3A7A4A9095A3FAEAC288 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 8D7913CFDF6BD78E2C6D08FFDEC93807 /* PBXTargetDependency */, + ); + name = "HealthKitSampleGenerator-iOS12.0"; + productName = "HealthKitSampleGenerator-iOS12.0"; + productReference = 64BEE0E525E56294CF2380C6F10E19CD /* HealthKitSampleGenerator.framework */; productType = "com.apple.product-type.framework"; }; - CE41A0B9AA44F0C3A741AF9CD922D612 /* HealthKitSampleGenerator-HealthKitSampleGenerator */ = { + C82891EAB7293DBEE916B21F57E8474D /* Quick */ = { isa = PBXNativeTarget; - buildConfigurationList = D80E049CC3F173CE476968CF5511B01F /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator-HealthKitSampleGenerator" */; + buildConfigurationList = A482E8F0F5BEDCE177543007D23A5736 /* Build configuration list for PBXNativeTarget "Quick" */; buildPhases = ( - AF01559EE7C2D98327A9A92B48C70D16 /* Sources */, - 53EC7192AEE59C66BADB1AFF3AB0F7B6 /* Frameworks */, - 2530B7D677E9CF89C50026A77B9D8DD9 /* Resources */, + EC3EC9092F61BD757267FD6009C275C5 /* Headers */, + 507CFA4217F0978AF450319CC96D5C36 /* Sources */, + D9523B817C92EFD8BCE3CDE77F54908E /* Frameworks */, + 42E082BE7328DA6969AECE264ACD14E0 /* Resources */, ); buildRules = ( ); dependencies = ( ); - name = "HealthKitSampleGenerator-HealthKitSampleGenerator"; - productName = "HealthKitSampleGenerator-HealthKitSampleGenerator"; - productReference = D1DC8F50B9C12FC5068F88985400C2BF /* HealthKitSampleGenerator.bundle */; - productType = "com.apple.product-type.bundle"; + name = Quick; + productName = Quick; + productReference = 0D631E9908483F9525A6B3F36F16CC61 /* Quick.framework */; + productType = "com.apple.product-type.framework"; + }; + D2EC0A9630F053BD2965CC5F1A8674AE /* Pods-HealthKitSampleGenerator_Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 00A9EAE33D54714E54DA33A9D0305F71 /* Build configuration list for PBXNativeTarget "Pods-HealthKitSampleGenerator_Tests" */; + buildPhases = ( + 5E3C46E8EEA7723EAB385CB1BA4A1DA4 /* Headers */, + FED8A8DB4588755A04083CECFE578296 /* Sources */, + CDAB8B9827E1DBAC04CC57CD315BCC85 /* Frameworks */, + 39C21B20947C7B5835A03CA9C4E016C2 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 771C49BA3B6D59B75ECCCB74E00FEB16 /* PBXTargetDependency */, + 55F06CABC7DCB8B850ACD1D74C2CA15E /* PBXTargetDependency */, + 8BBFBF27BE394320BF5C4D286064764E /* PBXTargetDependency */, + ); + name = "Pods-HealthKitSampleGenerator_Tests"; + productName = "Pods-HealthKitSampleGenerator_Tests"; + productReference = D57876F111F64E5E177F7711475F8402 /* Pods_HealthKitSampleGenerator_Tests.framework */; + productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + BFDFE7DC352907FC980B868725387E98 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0710; + LastSwiftUpdateCheck = 1100; + LastUpgradeCheck = 1100; }; - buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); - mainGroup = 7DB346D0F39D3F0E887471402A8071AB; - productRefGroup = E9BFE82E77C37F01B66702BCDF3E6C6F /* Products */; + mainGroup = CF1408CF629C7361332E53B88F7BD30C; + productRefGroup = 30D851D92ACA9453AF85250F8D177FD0 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 9DB05EFC751028DD93CF970F1102971B /* HealthKitSampleGenerator */, - CE41A0B9AA44F0C3A741AF9CD922D612 /* HealthKitSampleGenerator-HealthKitSampleGenerator */, - AE4F696CC357FA27AC16FF75A72C8C40 /* Nimble */, - AA9FEF2B832A46B4168C3A5DF734EA03 /* Pods-HealthKitSampleGenerator_Example */, - 68536CFD0F3A9676D8F9016A4D3AF16C /* Pods-HealthKitSampleGenerator_Tests */, - 8849EF21BC824D03AA41F5ED190F3DDE /* Quick */, + A149403F5B7302441FD39D762F3B67B1 /* HealthKitSampleGenerator-iOS12.0 */, + 1F8927426752C08FD6EE9B2E5A88B646 /* HealthKitSampleGenerator-iOS12.0-HealthKitSampleGenerator */, + 5C8A8103606742343FAC5419D57F4221 /* HealthKitSampleGenerator-iOS9.0 */, + 8D49D5BC5615B12C21DEC7C7F839A0E4 /* HealthKitSampleGenerator-iOS9.0-HealthKitSampleGenerator */, + 6F13695E06195A78EA8A95F8C7ED0D2F /* Nimble */, + 878423F5EEE267A73519A25BFBCC8D8C /* Pods-HealthKitSampleGenerator_Example */, + D2EC0A9630F053BD2965CC5F1A8674AE /* Pods-HealthKitSampleGenerator_Tests */, + C82891EAB7293DBEE916B21F57E8474D /* Quick */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 2530B7D677E9CF89C50026A77B9D8DD9 /* Resources */ = { + 25514F2DD129927EF43086DB50AA85AD /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; - A7B2CFF177F60651F072E761E7A31202 /* Resources */ = { + 39C21B20947C7B5835A03CA9C4E016C2 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1D0E73C4F4BDE8D75036C2FFF989C3A3 /* HealthKitSampleGenerator.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 42E082BE7328DA6969AECE264ACD14E0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 547B9F3FCFB573B42450009A94CF46B2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6FB802F3182F3A7A4A9095A3FAEAC288 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 22E080DCBB61D5412380BE0AD0584455 /* HealthKitSampleGenerator.bundle in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C9FD37FFC2DAEC84D7EEF205C1408AE0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D7EBE1F47ACC336A60ED6056AF3261E1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E31A7ADB641CF33F87C7B8CDF9C1DCC2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0A0527D317A7EBC701746C94E20D3FFB /* HealthKitSampleGenerator.bundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 284D41A1AD7973A4E093A95363F63743 /* Sources */ = { + 507CFA4217F0978AF450319CC96D5C36 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B9397BD911F09C73BC598D60DC04C1A7 /* Behavior.swift in Sources */, + 603A2FC60B90F1279D399DAF8104201F /* Callsite.swift in Sources */, + 7034D0B6AE91D924AB27F6B828C79EB8 /* Closures.swift in Sources */, + AE191084C68BDF1A2878978CCFBF29E2 /* Configuration.swift in Sources */, + 63B7ECA666221B5EE437EFE136434959 /* DSL.swift in Sources */, + 1E5C4F9EB261B75BECC921A303CA3AA6 /* ErrorUtility.swift in Sources */, + 81FED3E061FA39538B0AA3092F6F380B /* Example.swift in Sources */, + 208F9DADCC8F01AAC14247BF0E54C863 /* ExampleGroup.swift in Sources */, + 1B4D25D41B2CE138D184DD18A534ADB2 /* ExampleHooks.swift in Sources */, + FF4C06BD3EF989D203359A47EAA0A287 /* ExampleMetadata.swift in Sources */, + 05376A2B4A599FB919C25922E08EF492 /* Filter.swift in Sources */, + C43FC4EFD9E762C454E4168953475A55 /* HooksPhase.swift in Sources */, + 88F403109D33F993ACD635A3D01134BC /* NSBundle+CurrentTestBundle.swift in Sources */, + 5FFC8254039A54540761DC5656615630 /* QCKDSL.m in Sources */, + B7977833FE910D5DB829DCCC6EA3D104 /* Quick-dummy.m in Sources */, + 26BFBD738BB96C6C730D4DC96D47A107 /* QuickConfiguration.m in Sources */, + A173703877A14EBF47A8A4FF41F7DBE6 /* QuickSelectedTestSuiteBuilder.swift in Sources */, + 712E987D79829DC53E38FC6DA1B17CFB /* QuickSpec.m in Sources */, + C6A86479B1236153B50C59E9ACB07D0D /* QuickSpecBase.m in Sources */, + 011CAC6A74AAEEAF9F54E817D1A9FD33 /* QuickTestSuite.swift in Sources */, + 01692FC85BC6ECB122F1380ECBBA6EF5 /* String+C99ExtendedIdentifier.swift in Sources */, + 01A100AE3D2AF7A7D6A6BF1A91A4EDF3 /* SuiteHooks.swift in Sources */, + 9BB2E6C13B25C0157C4BECFC9F8DF489 /* URL+FileName.swift in Sources */, + 4E737D040955550EACFE774A383EB4A2 /* World+DSL.swift in Sources */, + B5AEEFF5F31AC069BD96E8104301AD4D /* World.swift in Sources */, + 2BE5D1B1D8986048A3B0E3D73B9EE158 /* XCTestSuite+QuickTestSuiteBuilder.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6CA9B0F7B6AC04D0A7366E7F6D0E83C6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0BB767541C54223C6F9FC358D46FF8C0 /* Pods-HealthKitSampleGenerator_Example-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A4D6981478BE8F836C68D5E5655B305C /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2F044DF21BE298FD00A0B51F /* SampleCreator.swift in Sources */, - FA49C3CE336F2534DD1C6D9330D5C1CD /* HealthKitDataExporters.swift in Sources */, - EF14B2C9A1EA5F4C1F10C144B1D069A6 /* HealthKitDataExport.swift in Sources */, - 9A62DA8294BEE7AC988BD386E8272BEE /* ExportConfiguration.swift in Sources */, - 43FE57E9EADCA1F6FFC44CC4DCE18A18 /* ExportTargets.swift in Sources */, - 2F3C4D791BDAAACA00B91D60 /* JsonReader.swift in Sources */, - 2F3C4D911BDE82ED00B91D60 /* HealthKitStoreCleaner.swift in Sources */, - 2F3C4D771BDA7BBF00B91D60 /* HealthKitProfile.swift in Sources */, - 2F3C4D8F1BDE81E300B91D60 /* HealthKitConstants.swift in Sources */, - 29E8C8A05F9FCFC71F7B2253D61D4FF8 /* HealthKitSampleGenerator-dummy.m in Sources */, - 1B39E248E790BCED2E47B22A615333FF /* HealthKitDataImporter.swift in Sources */, - CD674C29C71E334A5597136C585E0633 /* JsonWriter.swift in Sources */, - 2F3C4D811BDB60BE00B91D60 /* HealthKitProfileReader.swift in Sources */, - 14D83FFF42F4DB5F5BD0EEFA3317E467 /* OuputStreams.swift in Sources */, - 1B97CD23B61DEA10E88769F3B1EE578D /* Util.swift in Sources */, - 2F3C4D8C1BDD66D700B91D60 /* HealthKitProfileImporter.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 2F81F85FF70B094B119BB42268C8C106 /* Sources */ = { + AA45B3C88102A3BCB40703997CAC98B7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DCF7896185304D0E923FB726A4E1F905 /* AdapterProtocols.swift in Sources */, - 59DAB6ECC3246840EE664EDA0EE97BAA /* AllPass.swift in Sources */, - 920A2E35EBBC1C19A7E3681631CACAEC /* AssertionDispatcher.swift in Sources */, - 815A52BF0FEDAB1BDC52BD4598BA974A /* AssertionRecorder.swift in Sources */, - 45730181FDB3CB399510A26E3CBB33EE /* AsyncMatcherWrapper.swift in Sources */, - 16E3695680CE40DED7AACD165F417758 /* BeAKindOf.swift in Sources */, - 11F86D4E8971E192FAD1F2A6F5AB3249 /* BeAnInstanceOf.swift in Sources */, - E3224745755D55F6A3736B0F89498E06 /* BeCloseTo.swift in Sources */, - 6B0C0269F98E13DEA720BF4BEB0B4561 /* BeEmpty.swift in Sources */, - DC68BFA158770805C8752CBC4EFB89DC /* BeginWith.swift in Sources */, - 928340C2AB8F2A25E61F0F9CE8F2B7F9 /* BeGreaterThan.swift in Sources */, - 35046BFF06F9602D2A04AE23115E7952 /* BeGreaterThanOrEqualTo.swift in Sources */, - 93857B1E4D50E1A05D5E807B4BE23D8E /* BeIdenticalTo.swift in Sources */, - F4FCB84B09C0FCEE15E16C5FA269A870 /* BeLessThan.swift in Sources */, - 896C41CF61875F4FC83E605B4C6735A5 /* BeLessThanOrEqual.swift in Sources */, - 1A53D3AAD5D6B836FDD26C7FE89C0C33 /* BeLogical.swift in Sources */, - D65E3990C2D02BD772977584D7271FAD /* BeNil.swift in Sources */, - B3D7CBC03B017A275428FC0051B2850F /* Contain.swift in Sources */, - 7B1C8150C1475A6B1CD548FAE2BA3CA3 /* DSL+Wait.swift in Sources */, - A213A3F4F933863588DE9E717C1ECD14 /* DSL.m in Sources */, - BA34E8BF868D0C9E18665C26840481F5 /* DSL.swift in Sources */, - 1EB0395E90DC786D257E35F4BB737D6B /* EndWith.swift in Sources */, - 5433EA2F1D2B468A2514CF3E3FA829F6 /* Equal.swift in Sources */, - CEE17B288AEA3D692DB64F3CC8E077CC /* Expectation.swift in Sources */, - 9D57D991598DD9E5C3D4F6344D19750C /* Expression.swift in Sources */, - EBCFC6244C5C5FE8B10113A1F3BE6E58 /* FailureMessage.swift in Sources */, - BC0CF55A707E45FA6237F81B2C67AB88 /* Functional.swift in Sources */, - 58B7EBEA00D03BA8AE7C63D6F868E671 /* Match.swift in Sources */, - 3A3A941BD21684A8A71F6CF0E22F1051 /* MatcherFunc.swift in Sources */, - 2241BD9DF0F7D0711B0E7225D4974BBD /* MatcherProtocols.swift in Sources */, - 8742D2CD66D2340C5A5980CCF4C4950F /* Nimble-dummy.m in Sources */, - E33E1FBEF7E59B906931AD0366141609 /* NimbleXCTestHandler.swift in Sources */, - 1E608EAF8009FC82D841B180F7C6793A /* NMBExceptionCapture.m in Sources */, - AEB148F5A0D8CA4CA7AFD3450C0A904F /* ObjCExpectation.swift in Sources */, - 4235336690B33526741E90D25B8C1E29 /* ObjCMatcher.swift in Sources */, - 032E47F62AE062F29029512E8E534717 /* Poll.swift in Sources */, - 9386CCFB04A315BFA4A5D1031EB6B9A7 /* RaisesException.swift in Sources */, - B8D76AA6614D554BDF4B77B2C1E7F50A /* SourceLocation.swift in Sources */, - F4ED851C84866AC96B995896531583DC /* Stringers.swift in Sources */, - D43C26DFAD751BAC93BE26B55FDC4F11 /* ThrowError.swift in Sources */, + 4B13991A8177E64E788FC6FAE93B7A3C /* ExportConfiguration.swift in Sources */, + 3B25B738AEB65B8E3740B0C1258C6341 /* ExportTargets.swift in Sources */, + 6E4E4B9859D643DB058D7AAC230279DD /* HealthKitConstants.swift in Sources */, + 86C69D07E4AE84026867343DC185D977 /* HealthKitDataExport.swift in Sources */, + 25564FB1E03E7F0482FC43D17D00A066 /* HealthKitDataExporters.swift in Sources */, + 82EF4959DF018B637E2AC680D720F22C /* HealthKitDataImporter.swift in Sources */, + 4BFC00DB8D9C674920D4CC05A6E29DB2 /* HealthKitProfile.swift in Sources */, + A9BB549C0CC1CD0E9BECD284BAD75CDB /* HealthKitProfileImporter.swift in Sources */, + 0BC004D67283D18826764E424B036D96 /* HealthKitProfileReader.swift in Sources */, + B14047FBA5A5FE9360991CC72B593765 /* HealthKitSampleGenerator-iOS9.0-dummy.m in Sources */, + 5472B9C8CD82E0C5DE1B69FF135806C4 /* HealthKitStoreCleaner.swift in Sources */, + 7DA04CD00F265069A1E858E2DF0D082A /* JsonReader.swift in Sources */, + 8F34FF8D86952A401AD077A8084EAD20 /* JsonWriter.swift in Sources */, + 4F84D700CB67C629F06824BD973B84D2 /* OuputStreams.swift in Sources */, + B44FBE4084A04C067CE860BA6F415F11 /* SampleCreator.swift in Sources */, + AC2BA0586A98401B16320B70EB591E6B /* Util.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - 3EEE5FB7F1F5D2BF9AC174DF58E55B84 /* Sources */ = { + D399136A0E6FE19CACE7F05143312FB1 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9F4B4F498A623D63B64CD747A5F2CBFD /* Pods-HealthKitSampleGenerator_Example-dummy.m in Sources */, + B4058A2AA8486E9879F113E6F67B9679 /* AdapterProtocols.swift in Sources */, + 4203EF96811AE514D64AE069311B1575 /* AllPass.swift in Sources */, + C99BBC3F70E056CB6A3CC0516318939D /* AssertionDispatcher.swift in Sources */, + F310B21703A7BC438A09DDB96670583F /* AssertionRecorder.swift in Sources */, + DCD198D49C0A198A09525B7688EE3BC9 /* Async.swift in Sources */, + 330E8E4A6596ED625E9B34C94CC4136E /* Await.swift in Sources */, + 94DA3131D64B3D904BE28E72F1871065 /* BeAKindOf.swift in Sources */, + 9C460BA614D4B1D314A252C4C5CE1D87 /* BeAnInstanceOf.swift in Sources */, + F4877B3857C780DCDB7F413A03F95600 /* BeCloseTo.swift in Sources */, + C903AEFEEB4E73644A03FB8285543107 /* BeEmpty.swift in Sources */, + 78A51B7FCC1DFB888AAA254529013C12 /* BeginWith.swift in Sources */, + 42F76698690916E0407F51610D829412 /* BeGreaterThan.swift in Sources */, + 2391FFD3230B40E2348B5257D6296BBB /* BeGreaterThanOrEqualTo.swift in Sources */, + 52AB6461CAA9481D24835F3E48301FC6 /* BeIdenticalTo.swift in Sources */, + 9B9714C476F416AD7FD803EA1184D113 /* BeLessThan.swift in Sources */, + 46BDEBF35D99D2CC53EF72DFC5BDCDCC /* BeLessThanOrEqual.swift in Sources */, + 8D75EC8969EA46FBD6E1BED7791A3C37 /* BeLogical.swift in Sources */, + EC7EF3D5778783BD93EBC6F82016ADA9 /* BeNil.swift in Sources */, + C979EEB0159A65246F6BD2C906A8ADB7 /* BeVoid.swift in Sources */, + D34D0540ADCBF163575B6B5444B1AAF6 /* Contain.swift in Sources */, + 5B6F70DDD4C63CF6ED95291BCB633494 /* ContainElementSatisfying.swift in Sources */, + FF920E965F1CA016FF302DE8C92C5122 /* CwlBadInstructionException.swift in Sources */, + 89EE4D6DBDB79963D65AA1E67B543B6D /* CwlCatchBadInstruction.swift in Sources */, + 02A1AAA49758A955770775CD409D8635 /* CwlCatchException.m in Sources */, + CAACEBB97A7D23E6782B47A805DFED81 /* CwlCatchException.swift in Sources */, + 39133A7716CEDEB690A7DA9D12C45C4D /* CwlDarwinDefinitions.swift in Sources */, + 8A0EF19254BAC5DF0885D1FBA345E016 /* CwlMachBadInstructionHandler.m in Sources */, + 234849AD309265FD107C74357FC8C0CF /* DSL+Wait.swift in Sources */, + 7AC93EB6DCDA9226165D5BC354FE7BC6 /* DSL.m in Sources */, + A9996A6303084D17B9C439CB132A1F69 /* DSL.swift in Sources */, + 3460FEA0CEADB05D3B56C2E1CAF9590C /* ElementsEqual.swift in Sources */, + 3262B230B938C8D6522790093FEAF69D /* EndWith.swift in Sources */, + D9CFB8E5E354D7BE61D092259779F437 /* Equal.swift in Sources */, + B7662703AF8D3FFFCB0070C50FEDCC58 /* Errors.swift in Sources */, + 602E3758C0EF64AF6B7FCEA05BF5B9B9 /* Expectation.swift in Sources */, + AD69407E2FA1D39A9E09248052F2D81B /* ExpectationMessage.swift in Sources */, + E458AAE1AE9E2250F29806E5633B1860 /* Expression.swift in Sources */, + 192A3F8BEC1A99FD8712D3E09724D72C /* FailureMessage.swift in Sources */, + 7DAC86DCBC36C10F43FA5FEB819B7BF1 /* Functional.swift in Sources */, + 64E26D7D025AC4462DFA8BA66B38C9D8 /* HaveCount.swift in Sources */, + 13D2A4D59DD9612E1AA7F3182A342162 /* mach_excServer.c in Sources */, + 5578F928AEFA8B2B7CC542033590DFD6 /* Match.swift in Sources */, + 26B9FEAB3DE0C8B91709D53571752A3B /* MatcherFunc.swift in Sources */, + 44C9470137EF941955A1FDCE71D68C26 /* MatcherProtocols.swift in Sources */, + 0892D14FE7A3452423E9129D7917664B /* MatchError.swift in Sources */, + B71070160CF07EFA99ED0445B0D191E7 /* Nimble-dummy.m in Sources */, + ECCA1FA570A912E8CDB54EB843F1D030 /* NimbleEnvironment.swift in Sources */, + 2B350015B9F7546D0769649EE12D7D1A /* NimbleXCTestHandler.swift in Sources */, + CEE8D31A4E76BB7B350BF2A7175D4BC2 /* NMBExceptionCapture.m in Sources */, + C0C98C8C7D07E1598F20EE2F0539197D /* NMBExpectation.swift in Sources */, + 99E8019F4689A514DAC6AA40AFF7352E /* NMBObjCMatcher.swift in Sources */, + F78E35D04F09485FA5DFA72FE1AD5AB2 /* NMBStringify.m in Sources */, + 46B90B2CF2EB97B38C43A31E9A5478C2 /* PostNotification.swift in Sources */, + B6CC23C6C288F4EB9EDD3A06F1F5F094 /* Predicate.swift in Sources */, + F9E85548BF1EF8C5035BAF92233C34B6 /* RaisesException.swift in Sources */, + B79FC6E46F642C3FC74B3E6D9175B1AB /* SatisfyAllOf.swift in Sources */, + 8D543DAD9A6C0B8BF8A5DB38AD876677 /* SatisfyAnyOf.swift in Sources */, + D9D6150D329A87CBB415FD349F0C50FD /* SourceLocation.swift in Sources */, + 806B9040D79A3DC58FB56EAC16FE19BF /* Stringers.swift in Sources */, + 72FB8CEABF346A37D54CC08647489A98 /* ThrowAssertion.swift in Sources */, + B2A65EEDB5D5EC246EA68E10964FF7B3 /* ThrowError.swift in Sources */, + CF9218FF56D8EE43681150A3E1635C9A /* ToSucceed.swift in Sources */, + DB84342A0C0DEABBF7F729DE55225D82 /* XCTestObservationCenter+Register.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - A8DE65A235D3FC5323D49E5933E9EFE5 /* Sources */ = { + E559EEC86B939C9B304BAFDD56907A25 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - CF88FA0268B2B1FFD6D91A0B91D2CD66 /* Callsite.swift in Sources */, - CA7BCD73C987FA45C676A620A67A3F01 /* Closures.swift in Sources */, - BD9EC9FA64B3ADD302D49721154701CC /* Configuration.swift in Sources */, - 95A56C9C61C1DF44928CFC7153F0972B /* DSL.swift in Sources */, - FF3D928D3C3E7463500A56935EE45EF9 /* Example.swift in Sources */, - 61EB2E179E270A4616645474C35D4CEE /* ExampleGroup.swift in Sources */, - EF4B06672AD631288265FB7A483823F8 /* ExampleHooks.swift in Sources */, - 880EBB50B0FC86451EBD490C24A39E45 /* ExampleMetadata.swift in Sources */, - 34DCFCCAA82FE906F481ACD5A6797422 /* Filter.swift in Sources */, - CC6B6C3AC36B3526454C3104D93B2DBD /* NSString+QCKSelectorName.m in Sources */, - CCF69B213A6AA7F3091BE83E59D5378F /* QCKDSL.m in Sources */, - C38239AAB51ACB98ADB91690F4B73340 /* Quick-dummy.m in Sources */, - 1B7D8B785FC5302FA552C87E439A8D25 /* QuickConfiguration.m in Sources */, - 57E8B56ABCF519D03835D18D7AAB56A2 /* QuickSpec.m in Sources */, - 7B20BAEC2471554CC4E969671EFA497E /* SuiteHooks.swift in Sources */, - D484442CEC37939F5E7FA1FC8E73B412 /* World+DSL.swift in Sources */, - 652BA4C1DF3ABDA2120CF89B42FD7F2E /* World.swift in Sources */, + 17928A0BA262E3DF1F0D75DD05C9EDF7 /* ExportConfiguration.swift in Sources */, + 46CA7B981A87071E1C6E02086F9051FC /* ExportTargets.swift in Sources */, + 90818DF5D680C3C2812BA98A09DE61CB /* HealthKitConstants.swift in Sources */, + 12FEE7CACE56248EBCD65119D78F3B0E /* HealthKitDataExport.swift in Sources */, + E6669AA083F6E847AF984CC40329D0FC /* HealthKitDataExporters.swift in Sources */, + A4DB0E237BA83CE78680F923849FDB95 /* HealthKitDataImporter.swift in Sources */, + FA8F6E421E834BD318ECF9405D72FE99 /* HealthKitProfile.swift in Sources */, + 5058FE06C715CB9D3F83AD72D0A24ACA /* HealthKitProfileImporter.swift in Sources */, + 1BC91F1B56B3B926D762B134DAD4F362 /* HealthKitProfileReader.swift in Sources */, + 8DC01D68E99B6ECE23F6B3F50479D95F /* HealthKitSampleGenerator-iOS12.0-dummy.m in Sources */, + 73F5EFC14ABF011EF02044CDD11BB5D1 /* HealthKitStoreCleaner.swift in Sources */, + 027B82CB1EFE52DB0FD5F00B9405640F /* JsonReader.swift in Sources */, + 9F9FFAE55C45DB46968944E5EA772436 /* JsonWriter.swift in Sources */, + DB54F97DAD1B7C3EA58025C30CD0CD78 /* OuputStreams.swift in Sources */, + B3CF42B77340FBA4F3E0993BD5C164DE /* SampleCreator.swift in Sources */, + 4965EB19EC4E40D4CD45391FEB924593 /* Util.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; - AF01559EE7C2D98327A9A92B48C70D16 /* Sources */ = { + E6DA69FD14CBAD6A63F22D938E9390D7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; - AF70BE4247096082FCC712E989618E88 /* Sources */ = { + FED8A8DB4588755A04083CECFE578296 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 54E4B6051D80C89296290E0182EA926F /* Pods-HealthKitSampleGenerator_Tests-dummy.m in Sources */, + C062817FA97CEBAEB05142F88667525A /* Pods-HealthKitSampleGenerator_Tests-dummy.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 2495D2C44595DAE50BEB27247A3871A1 /* PBXTargetDependency */ = { + 55F06CABC7DCB8B850ACD1D74C2CA15E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = Quick; - target = 8849EF21BC824D03AA41F5ED190F3DDE /* Quick */; - targetProxy = 789AFF65D6A4444CB61DE97E7F25B004 /* PBXContainerItemProxy */; + name = Nimble; + target = 6F13695E06195A78EA8A95F8C7ED0D2F /* Nimble */; + targetProxy = D0A7BBBD0FDFB2D7E1D307997716616A /* PBXContainerItemProxy */; }; - 5393EBB40BD201D15B524337F93408BD /* PBXTargetDependency */ = { + 771C49BA3B6D59B75ECCCB74E00FEB16 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = "HealthKitSampleGenerator-HealthKitSampleGenerator"; - target = CE41A0B9AA44F0C3A741AF9CD922D612 /* HealthKitSampleGenerator-HealthKitSampleGenerator */; - targetProxy = 1CE9395D94CD6C0449A75CD88233614D /* PBXContainerItemProxy */; + name = "HealthKitSampleGenerator-iOS9.0"; + target = 5C8A8103606742343FAC5419D57F4221 /* HealthKitSampleGenerator-iOS9.0 */; + targetProxy = 5AD091AE79D9984540072D9C577F8D0D /* PBXContainerItemProxy */; }; - 8A46DCDD4BE9084A7284196585B8D168 /* PBXTargetDependency */ = { + 82CD1FDA351C7438E12F46F53CFDB421 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = HealthKitSampleGenerator; - target = 9DB05EFC751028DD93CF970F1102971B /* HealthKitSampleGenerator */; - targetProxy = 81090D23DED576C0E4B60500F79EC5DE /* PBXContainerItemProxy */; + name = "HealthKitSampleGenerator-iOS9.0-HealthKitSampleGenerator"; + target = 8D49D5BC5615B12C21DEC7C7F839A0E4 /* HealthKitSampleGenerator-iOS9.0-HealthKitSampleGenerator */; + targetProxy = 666D43BCB6199A09453CA710B0EDB2E8 /* PBXContainerItemProxy */; }; - A63BBA2CF57084A674D1E88F573BA649 /* PBXTargetDependency */ = { + 8BBFBF27BE394320BF5C4D286064764E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = HealthKitSampleGenerator; - target = 9DB05EFC751028DD93CF970F1102971B /* HealthKitSampleGenerator */; - targetProxy = 3090B5B7E4C542701CF75783CACD50CF /* PBXContainerItemProxy */; + name = Quick; + target = C82891EAB7293DBEE916B21F57E8474D /* Quick */; + targetProxy = 4A039B8E893BD585BABE1AE6A15D7686 /* PBXContainerItemProxy */; }; - F22FEBD4BD792DF7FC8F27E2BEB049AF /* PBXTargetDependency */ = { + 8D7913CFDF6BD78E2C6D08FFDEC93807 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - name = Nimble; - target = AE4F696CC357FA27AC16FF75A72C8C40 /* Nimble */; - targetProxy = A54786732E4D2B30C96147D4BC64D2FF /* PBXContainerItemProxy */; + name = "HealthKitSampleGenerator-iOS12.0-HealthKitSampleGenerator"; + target = 1F8927426752C08FD6EE9B2E5A88B646 /* HealthKitSampleGenerator-iOS12.0-HealthKitSampleGenerator */; + targetProxy = 3B6F49716AE74C90DB2F8622883238AB /* PBXContainerItemProxy */; + }; + F737A3868C865325C42A1D091C586585 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "HealthKitSampleGenerator-iOS12.0"; + target = A149403F5B7302441FD39D762F3B67B1 /* HealthKitSampleGenerator-iOS12.0 */; + targetProxy = 2A0D02A51015F5720F0BCDEEDE4BF4E1 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 1113E9EAEEB4075F948C76153B1BA222 /* Release */ = { + 064A9D182CF3F52D368E4BED93245D81 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 8AC582B71748EDB1E883421F93EDB0C9 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 1B9F081F009760216AA36D809D257FA7 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4DFBE0597ED6EFD7CD381DDD40002C82 /* Pods-HealthKitSampleGenerator_Example.release.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - INFOPLIST_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Example/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MODULEMAP_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_HealthKitSampleGenerator_Example; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; - 4716F76EF0F341E866B5EC5EB9642CD5 /* Release */ = { + 0D7BE5B430CB5EB63CB8D41B9A174BD2 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A67AB7515622C4C1A2D2E316138980F0 /* HealthKitSampleGenerator.xcconfig */; + baseConfigurationReference = 4C5EF9D98CB8A4E2092B20A2BFAA87E4 /* HealthKitSampleGenerator-iOS12.0.xcconfig */; buildSettings = { - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/HealthKitSampleGenerator-iOS12.0"; + IBSC_MODULE = HealthKitSampleGenerator; + INFOPLIST_FILE = "Target Support Files/HealthKitSampleGenerator-iOS12.0/ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS12.0-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; PRODUCT_NAME = HealthKitSampleGenerator; SDKROOT = iphoneos; SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = bundle; }; name = Release; }; - 4AD889D62EF56E26F2E7A77A9F04B1AC /* Debug */ = { + 301FE9FE0194BECAB407F02A00B1D130 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 31971283FA8916C9C34FAFEA055DAA40 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */; + baseConfigurationReference = A957896A3325D9065B06E8F877B18D37 /* Quick.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - INFOPLIST_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Example/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Quick/Quick-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Quick/Quick-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_HealthKitSampleGenerator_Example; + MODULEMAP_FILE = "Target Support Files/Quick/Quick.modulemap"; + PRODUCT_MODULE_NAME = Quick; + PRODUCT_NAME = Quick; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; + name = Release; + }; + 315176383200DA56D7BC03B9A3FB2C8F /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AB0E6FDFCE4FAD539A912D820E9ABDF5 /* HealthKitSampleGenerator-iOS9.0.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/HealthKitSampleGenerator-iOS9.0"; + IBSC_MODULE = HealthKitSampleGenerator; + INFOPLIST_FILE = "Target Support Files/HealthKitSampleGenerator-iOS9.0/ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS9.0-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + PRODUCT_NAME = HealthKitSampleGenerator; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = bundle; + }; + name = Debug; + }; + 36F0B4AD6FA165170BA8D700386FECE7 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4C5EF9D98CB8A4E2092B20A2BFAA87E4 /* HealthKitSampleGenerator-iOS12.0.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/HealthKitSampleGenerator-iOS12.0"; + IBSC_MODULE = HealthKitSampleGenerator; + INFOPLIST_FILE = "Target Support Files/HealthKitSampleGenerator-iOS12.0/ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS12.0-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + PRODUCT_NAME = HealthKitSampleGenerator; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = bundle; + }; name = Debug; }; - 55F5B33D958A94C1C0E62F06B64AB883 /* Release */ = { + 435FEBAA4BD58A4EEF37A88786225C01 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A67AB7515622C4C1A2D2E316138980F0 /* HealthKitSampleGenerator.xcconfig */; + baseConfigurationReference = 90C5E2161B26FB91DE16BFC45DAEC7BF /* Nimble.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/HealthKitSampleGenerator/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Nimble/Nimble-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Nimble/Nimble-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = HealthKitSampleGenerator; + MODULEMAP_FILE = "Target Support Files/Nimble/Nimble.modulemap"; + PRODUCT_MODULE_NAME = Nimble; + PRODUCT_NAME = Nimble; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; - 620F9DF826AD73B59409F5BAD081366B /* Debug */ = { + 45604F3ECA9F54AB264CC547DD39AFBE /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F067A43C230A29C9C8141B79A1197D8D /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */; + baseConfigurationReference = BCCE45A1A037826AD9B16B9F96F015B0 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - INFOPLIST_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Tests/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MACH_O_TYPE = staticlib; MODULEMAP_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; OTHER_LDFLAGS = ""; OTHER_LIBTOOLFLAGS = ""; PODS_ROOT = "$(SRCROOT)"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_HealthKitSampleGenerator_Tests; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; - 885DF2792944FE8938ED7C28FD9283D5 /* Debug */ = { + 4659F568F76126E029B88DE3175D43CB /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 4C5EF9D98CB8A4E2092B20A2BFAA87E4 /* HealthKitSampleGenerator-iOS12.0.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; - ONLY_ACTIVE_ARCH = YES; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/HealthKitSampleGenerator-iOS12.0/HealthKitSampleGenerator-iOS12.0-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/HealthKitSampleGenerator-iOS12.0/HealthKitSampleGenerator-iOS12.0-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/HealthKitSampleGenerator-iOS12.0/HealthKitSampleGenerator-iOS12.0.modulemap"; + PRODUCT_MODULE_NAME = HealthKitSampleGenerator; + PRODUCT_NAME = HealthKitSampleGenerator; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; }; name = Debug; }; - 8DFFC462861BB7E1A1E153AF5D99CDC9 /* Release */ = { + 4EB601588BFA76D9561DB47C876D40CB /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2F66B2F667E5F1FC43A5803846F29CE3 /* Quick.xcconfig */; + baseConfigurationReference = B5974989CA3FCE9604B9C6182B63FA85 /* Pods-HealthKitSampleGenerator_Tests.debug.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/Quick/Quick-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Quick/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Quick/Quick.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Quick; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - 98D10C1400C027AD4FAACBF9A7B04CE2 /* Debug */ = { + 607A05EBE892363BBAE081C405B6F09B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A67AB7515622C4C1A2D2E316138980F0 /* HealthKitSampleGenerator.xcconfig */; + baseConfigurationReference = 069C682EEEBCF3EE8665570008C849F1 /* Pods-HealthKitSampleGenerator_Example.debug.xcconfig */; buildSettings = { - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - PRODUCT_NAME = HealthKitSampleGenerator; + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = iphoneos; SKIP_INSTALL = YES; - WRAPPER_EXTENSION = bundle; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; }; name = Debug; }; - AC917B38D2CAADFF4A543A8D3E12A520 /* Release */ = { + 79250BA165394D8BB97D00EB8FA399F4 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 730236B08FB9EB1D2AEDA42FF40C7EDC /* Nimble.xcconfig */; + baseConfigurationReference = A957896A3325D9065B06E8F877B18D37 /* Quick.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/Nimble/Nimble-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Nimble/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/Quick/Quick-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Quick/Quick-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Nimble/Nimble.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Nimble; + MODULEMAP_FILE = "Target Support Files/Quick/Quick.modulemap"; + PRODUCT_MODULE_NAME = Quick; + PRODUCT_NAME = Quick; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; + name = Debug; + }; + 7E5DC3A1827B578D1617F66D99831289 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = AB0E6FDFCE4FAD539A912D820E9ABDF5 /* HealthKitSampleGenerator-iOS9.0.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = "iPhone Developer"; + CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/HealthKitSampleGenerator-iOS9.0"; + IBSC_MODULE = HealthKitSampleGenerator; + INFOPLIST_FILE = "Target Support Files/HealthKitSampleGenerator-iOS9.0/ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-iOS9.0-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + PRODUCT_NAME = HealthKitSampleGenerator; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + WRAPPER_EXTENSION = bundle; + }; name = Release; }; - B587DCEB083DB8B0E871BD555720AFD2 /* Debug */ = { + 85C3F0C4084B24040EB990675CF2B761 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A67AB7515622C4C1A2D2E316138980F0 /* HealthKitSampleGenerator.xcconfig */; + baseConfigurationReference = 4C5EF9D98CB8A4E2092B20A2BFAA87E4 /* HealthKitSampleGenerator-iOS12.0.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/HealthKitSampleGenerator/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/HealthKitSampleGenerator-iOS12.0/HealthKitSampleGenerator-iOS12.0-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/HealthKitSampleGenerator-iOS12.0/HealthKitSampleGenerator-iOS12.0-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + MODULEMAP_FILE = "Target Support Files/HealthKitSampleGenerator-iOS12.0/HealthKitSampleGenerator-iOS12.0.modulemap"; + PRODUCT_MODULE_NAME = HealthKitSampleGenerator; PRODUCT_NAME = HealthKitSampleGenerator; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; + name = Release; + }; + 8F17DC3A99F99FBAD606CE6963886315 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + 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_IMPLICIT_RETAIN_SELF = 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Release; + }; + 916E0404255105F480DC4950B7625F7A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + 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_IMPLICIT_RETAIN_SELF = 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + SYMROOT = "${SRCROOT}/../build"; + }; name = Debug; }; - C5E3531F400270524A346FFB40049CBE /* Debug */ = { + AB47C2AF5950D1E2F39CDBF789BD400B /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 730236B08FB9EB1D2AEDA42FF40C7EDC /* Nimble.xcconfig */; + baseConfigurationReference = 90C5E2161B26FB91DE16BFC45DAEC7BF /* Nimble.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_PREFIX_HEADER = "Target Support Files/Nimble/Nimble-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Nimble/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Nimble/Nimble-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULEMAP_FILE = "Target Support Files/Nimble/Nimble.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_MODULE_NAME = Nimble; PRODUCT_NAME = Nimble; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; - CF179385D801785FE5D6979031E55EB3 /* Release */ = { + ADC1B8897A327A70188DCE6E59474D4A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2065F67A980712141655A2AD710F2FB1 /* Pods-HealthKitSampleGenerator_Tests.release.xcconfig */; + baseConfigurationReference = AB0E6FDFCE4FAD539A912D820E9ABDF5 /* HealthKitSampleGenerator-iOS9.0.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - INFOPLIST_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Tests/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_HealthKitSampleGenerator_Tests; + MODULEMAP_FILE = "Target Support Files/HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0.modulemap"; + PRODUCT_MODULE_NAME = HealthKitSampleGenerator; + PRODUCT_NAME = HealthKitSampleGenerator; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - FD651FE915A8965612DB9BEE0AC9F931 /* Debug */ = { + CC7BE1FEEFDE415EBE5D55E6B9EC94FE /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2F66B2F667E5F1FC43A5803846F29CE3 /* Quick.xcconfig */; + baseConfigurationReference = AB0E6FDFCE4FAD539A912D820E9ABDF5 /* HealthKitSampleGenerator-iOS9.0.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_BITCODE = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_PREFIX_HEADER = "Target Support Files/Quick/Quick-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Quick/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/Quick/Quick.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Quick; + MODULEMAP_FILE = "Target Support Files/HealthKitSampleGenerator-iOS9.0/HealthKitSampleGenerator-iOS9.0.modulemap"; + PRODUCT_MODULE_NAME = HealthKitSampleGenerator; + PRODUCT_NAME = HealthKitSampleGenerator; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 03431A35E9399C76DAB85AE79BEA3E5E /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator" */ = { + 00A9EAE33D54714E54DA33A9D0305F71 /* Build configuration list for PBXNativeTarget "Pods-HealthKitSampleGenerator_Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4EB601588BFA76D9561DB47C876D40CB /* Debug */, + 45604F3ECA9F54AB264CC547DD39AFBE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0879F70A5548A8B44BEEDEE13211C5A3 /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator-iOS9.0-HealthKitSampleGenerator" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 315176383200DA56D7BC03B9A3FB2C8F /* Debug */, + 7E5DC3A1827B578D1617F66D99831289 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3184C0FCD72202A7421F3E302E805590 /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator-iOS9.0" */ = { isa = XCConfigurationList; buildConfigurations = ( - B587DCEB083DB8B0E871BD555720AFD2 /* Debug */, - 55F5B33D958A94C1C0E62F06B64AB883 /* Release */, + ADC1B8897A327A70188DCE6E59474D4A /* Debug */, + CC7BE1FEEFDE415EBE5D55E6B9EC94FE /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 05F0D4745510A049E7DC8D6BA65F20ED /* Build configuration list for PBXNativeTarget "Nimble" */ = { + 31C6C6CB9804CB952E15F8E945EA2795 /* Build configuration list for PBXNativeTarget "Pods-HealthKitSampleGenerator_Example" */ = { isa = XCConfigurationList; buildConfigurations = ( - C5E3531F400270524A346FFB40049CBE /* Debug */, - AC917B38D2CAADFF4A543A8D3E12A520 /* Release */, + 607A05EBE892363BBAE081C405B6F09B /* Debug */, + 064A9D182CF3F52D368E4BED93245D81 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 885DF2792944FE8938ED7C28FD9283D5 /* Debug */, - 1113E9EAEEB4075F948C76153B1BA222 /* Release */, + 916E0404255105F480DC4950B7625F7A /* Debug */, + 8F17DC3A99F99FBAD606CE6963886315 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 910B7F2C2A2D95F3879296183B77675A /* Build configuration list for PBXNativeTarget "Pods-HealthKitSampleGenerator_Example" */ = { + 4C35AF5826D695FF62603732E90BB92E /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator-iOS12.0" */ = { isa = XCConfigurationList; buildConfigurations = ( - 4AD889D62EF56E26F2E7A77A9F04B1AC /* Debug */, - 1B9F081F009760216AA36D809D257FA7 /* Release */, + 4659F568F76126E029B88DE3175D43CB /* Debug */, + 85C3F0C4084B24040EB990675CF2B761 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - D80E049CC3F173CE476968CF5511B01F /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator-HealthKitSampleGenerator" */ = { + 9AC65E53333ACA93EEB1D8EBAB58CBB6 /* Build configuration list for PBXNativeTarget "Nimble" */ = { isa = XCConfigurationList; buildConfigurations = ( - 98D10C1400C027AD4FAACBF9A7B04CE2 /* Debug */, - 4716F76EF0F341E866B5EC5EB9642CD5 /* Release */, + AB47C2AF5950D1E2F39CDBF789BD400B /* Debug */, + 435FEBAA4BD58A4EEF37A88786225C01 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - EE90A734DDA0232A0F20312F2497DEEC /* Build configuration list for PBXNativeTarget "Quick" */ = { + A482E8F0F5BEDCE177543007D23A5736 /* Build configuration list for PBXNativeTarget "Quick" */ = { isa = XCConfigurationList; buildConfigurations = ( - FD651FE915A8965612DB9BEE0AC9F931 /* Debug */, - 8DFFC462861BB7E1A1E153AF5D99CDC9 /* Release */, + 79250BA165394D8BB97D00EB8FA399F4 /* Debug */, + 301FE9FE0194BECAB407F02A00B1D130 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - FA3881EF0DE8DD5565C0462ABDD806B2 /* Build configuration list for PBXNativeTarget "Pods-HealthKitSampleGenerator_Tests" */ = { + E06B5C97A014AEFA4FF3C7412C2DEF12 /* Build configuration list for PBXNativeTarget "HealthKitSampleGenerator-iOS12.0-HealthKitSampleGenerator" */ = { isa = XCConfigurationList; buildConfigurations = ( - 620F9DF826AD73B59409F5BAD081366B /* Debug */, - CF179385D801785FE5D6979031E55EB3 /* Release */, + 36F0B4AD6FA165170BA8D700386FECE7 /* Debug */, + 0D7BE5B430CB5EB63CB8D41B9A174BD2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; } diff --git a/Example/Pods/Quick/README.md b/Example/Pods/Quick/README.md index 5117772..2cb397f 100644 --- a/Example/Pods/Quick/README.md +++ b/Example/Pods/Quick/README.md @@ -1,5 +1,11 @@ ![](http://f.cl.ly/items/0r1E192C1R0b2g2Q3h2w/QuickLogo_Color.png) +[![Build Status](https://travis-ci.org/Quick/Quick.svg?branch=master)](https://travis-ci.org/Quick/Quick) +[![CocoaPods](https://img.shields.io/cocoapods/v/Quick.svg)](https://cocoapods.org/pods/Quick) +[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Platforms](https://img.shields.io/cocoapods/p/Quick.svg)](https://cocoapods.org/pods/Quick) +[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com) + Quick is a behavior-driven development framework for Swift and Objective-C. Inspired by [RSpec](https://github.com/rspec/rspec), [Specta](https://github.com/specta/specta), and [Ginkgo](https://github.com/onsi/ginkgo). @@ -31,36 +37,54 @@ class TableOfContentsSpec: QuickSpec { } ``` #### Nimble -Quick comes together with [Nimble](https://github.com/Quick/Nimble) — a matcher framework for your tests. You can learn why `XCTAssert()` statements make your expectations unclear and how to fix that using Nimble assertions [here](./Documentation/NimbleAssertions.md). +Quick comes together with [Nimble](https://github.com/Quick/Nimble) — a matcher framework for your tests. You can learn why `XCTAssert()` statements make your expectations unclear and how to fix that using Nimble assertions [here](./Documentation/en-us/NimbleAssertions.md). + +## Swift Version + +Certain versions of Quick and Nimble only support certain versions of Swift. Depending on which version of Swift your project uses, you should use specific versions of Quick and Nimble. Use the table below to determine which versions of Quick and Nimble are compatible with your project. + +|Swift version |Quick version |Nimble version | +|:--------------------|:---------------|:--------------| +|Swift 4.2 |v1.3.2 or later |v7.3.2 or later| +|Swift 3 / Swift 4 |v1.0.0 or later |v5.0.0 or later| +|Swift 2.2 / Swift 2.3|v0.9.3 |v4.1.0 | ## Documentation -All documentation can be found in the [Documentation folder](./Documentation), including [detailed installation instructions](./Documentation/InstallingQuick.md) for CocoaPods, Carthage, Git submodules, and more. For example, you can install Quick and [Nimble](https://github.com/Quick/Nimble) using CocoaPods by adding the following to your Podfile: +All documentation can be found in the [Documentation folder](./Documentation), including [detailed installation instructions](./Documentation/en-us/InstallingQuick.md) for CocoaPods, Carthage, Git submodules, and more. For example, you can install Quick and [Nimble](https://github.com/Quick/Nimble) using CocoaPods by adding the following to your Podfile: ```rb # Podfile use_frameworks! -def testing_pods - # If you're using Xcode 7 / Swift 2 - pod 'Quick', '~> 0.5.0' - pod 'Nimble', '2.0.0-rc.2' +target "MyApp" do + # Normal libraries - # If you're using Xcode 6 / Swift 1.2 - pod 'Quick', '~> 0.3.0' - pod 'Nimble', '~> 1.0.0' -end - -target 'MyTests' do - testing_pods -end + abstract_target 'Tests' do + inherit! :search_paths + target "MyAppTests" + target "MyAppUITests" -target 'MyUITests' do - testing_pods + pod 'Quick' + pod 'Nimble' + end end ``` +## Projects using Quick + +Over ten-thousand apps use either Quick and Nimble however, as they are not included in the app binary, neither appear in “Top Used Libraries” blog posts. Therefore, it would be greatly appreciated to remind contributors that their efforts are valued by compiling a list of organizations and projects that use them. + +Does your organization or project use Quick and Nimble? If yes, [please add your project to the list](https://github.com/Quick/Quick/wiki/Projects-using-Quick). + +## Who uses Quick + +Similar to projects using Quick, it would be nice to hear why people use Quick and Nimble. Are there features you love? Are there features that are just okay? Are there some features we have that no one uses? + +Have something positive to say about Quick (or Nimble)? If yes, [provide a testimonial here](https://github.com/Quick/Quick/wiki/Who-uses-Quick). + + ## License -Apache 2.0 license. See the `LICENSE` file for details. +Apache 2.0 license. See the [`LICENSE`](LICENSE) file for details. diff --git a/Example/Pods/Quick/Sources/Quick/Behavior.swift b/Example/Pods/Quick/Sources/Quick/Behavior.swift new file mode 100644 index 0000000..7dfefac --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/Behavior.swift @@ -0,0 +1,17 @@ +/** + A `Behavior` encapsulates a set of examples that can be re-used in several locations using the `itBehavesLike` function with a context instance of the generic type. + */ + +open class Behavior { + + public static var name: String { return String(describing: self) } + /** + override this method in your behavior to define a set of reusable examples. + + This behaves just like an example group defines using `describe` or `context`--it may contain any number of `beforeEach` + and `afterEach` closures, as well as any number of examples (defined using `it`). + + - parameter aContext: A closure that, when evaluated, returns a `Context` instance that provide the information on the subject. + */ + open class func spec(_ aContext: @escaping () -> Context) {} +} diff --git a/Example/Pods/Quick/Sources/Quick/Callsite.swift b/Example/Pods/Quick/Sources/Quick/Callsite.swift new file mode 100644 index 0000000..47b3442 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/Callsite.swift @@ -0,0 +1,50 @@ +import Foundation + +#if canImport(Darwin) && !SWIFT_PACKAGE +@objcMembers +public class _CallsiteBase: NSObject {} +#else +public class _CallsiteBase: NSObject {} +#endif + +// Ideally we would always use `StaticString` as the type for tracking the file name +// in which an example is defined, for consistency with `assert` etc. from the +// stdlib, and because recent versions of the XCTest overlay require `StaticString` +// when calling `XCTFail`. Under the Objective-C runtime (i.e. building on macOS), we +// have to use `String` instead because StaticString can't be generated from Objective-C +#if SWIFT_PACKAGE +public typealias FileString = StaticString +#else +public typealias FileString = String +#endif + +/** + An object encapsulating the file and line number at which + a particular example is defined. +*/ +final public class Callsite: _CallsiteBase { + /** + The absolute path of the file in which an example is defined. + */ + public let file: FileString + + /** + The line number on which an example is defined. + */ + public let line: UInt + + internal init(file: FileString, line: UInt) { + self.file = file + self.line = line + } +} + +extension Callsite { + /** + Returns a boolean indicating whether two Callsite objects are equal. + If two callsites are in the same file and on the same line, they must be equal. + */ + @nonobjc public static func == (lhs: Callsite, rhs: Callsite) -> Bool { + return String(describing: lhs.file) == String(describing: rhs.file) && lhs.line == rhs.line + } +} diff --git a/Example/Pods/Quick/Sources/Quick/Configuration/Configuration.swift b/Example/Pods/Quick/Sources/Quick/Configuration/Configuration.swift new file mode 100644 index 0000000..fe33997 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/Configuration/Configuration.swift @@ -0,0 +1,161 @@ +import Foundation + +/** + A closure that temporarily exposes a Configuration object within + the scope of the closure. +*/ +public typealias QuickConfigurer = (_ configuration: Configuration) -> Void + +/** + A closure that, given metadata about an example, returns a boolean value + indicating whether that example should be run. +*/ +public typealias ExampleFilter = (_ example: Example) -> Bool + +/** + A configuration encapsulates various options you can use + to configure Quick's behavior. +*/ +final public class Configuration: NSObject { + internal let exampleHooks = ExampleHooks() + internal let suiteHooks = SuiteHooks() + internal var exclusionFilters: [ExampleFilter] = [ { example in + if let pending = example.filterFlags[Filter.pending] { + return pending + } else { + return false + } + }] + internal var inclusionFilters: [ExampleFilter] = [ { example in + if let focused = example.filterFlags[Filter.focused] { + return focused + } else { + return false + } + }] + + /** + Run all examples if none match the configured filters. True by default. + */ + public var runAllWhenEverythingFiltered = true + + /** + Registers an inclusion filter. + + All examples are filtered using all inclusion filters. + The remaining examples are run. If no examples remain, all examples are run. + + - parameter filter: A filter that, given an example, returns a value indicating + whether that example should be included in the examples + that are run. + */ + public func include(_ filter: @escaping ExampleFilter) { + inclusionFilters.append(filter) + } + + /** + Registers an exclusion filter. + + All examples that remain after being filtered by the inclusion filters are + then filtered via all exclusion filters. + + - parameter filter: A filter that, given an example, returns a value indicating + whether that example should be excluded from the examples + that are run. + */ + public func exclude(_ filter: @escaping ExampleFilter) { + exclusionFilters.append(filter) + } + + /** + Identical to Quick.Configuration.beforeEach, except the closure is + provided with metadata on the example that the closure is being run + prior to. + */ +#if canImport(Darwin) + @objc(beforeEachWithMetadata:) + public func beforeEach(_ closure: @escaping BeforeExampleWithMetadataClosure) { + exampleHooks.appendBefore(closure) + } +#else + public func beforeEach(_ closure: @escaping BeforeExampleWithMetadataClosure) { + exampleHooks.appendBefore(closure) + } +#endif + + /** + Like Quick.DSL.beforeEach, this configures Quick to execute the + given closure before each example that is run. The closure + passed to this method is executed before each example Quick runs, + globally across the test suite. You may call this method multiple + times across mulitple +[QuickConfigure configure:] methods in order + to define several closures to run before each example. + + Note that, since Quick makes no guarantee as to the order in which + +[QuickConfiguration configure:] methods are evaluated, there is no + guarantee as to the order in which beforeEach closures are evaluated + either. Mulitple beforeEach defined on a single configuration, however, + will be executed in the order they're defined. + + - parameter closure: The closure to be executed before each example + in the test suite. + */ + public func beforeEach(_ closure: @escaping BeforeExampleClosure) { + exampleHooks.appendBefore(closure) + } + + /** + Identical to Quick.Configuration.afterEach, except the closure + is provided with metadata on the example that the closure is being + run after. + */ +#if canImport(Darwin) + @objc(afterEachWithMetadata:) + public func afterEach(_ closure: @escaping AfterExampleWithMetadataClosure) { + exampleHooks.appendAfter(closure) + } +#else + public func afterEach(_ closure: @escaping AfterExampleWithMetadataClosure) { + exampleHooks.appendAfter(closure) + } +#endif + + /** + Like Quick.DSL.afterEach, this configures Quick to execute the + given closure after each example that is run. The closure + passed to this method is executed after each example Quick runs, + globally across the test suite. You may call this method multiple + times across mulitple +[QuickConfigure configure:] methods in order + to define several closures to run after each example. + + Note that, since Quick makes no guarantee as to the order in which + +[QuickConfiguration configure:] methods are evaluated, there is no + guarantee as to the order in which afterEach closures are evaluated + either. Mulitple afterEach defined on a single configuration, however, + will be executed in the order they're defined. + + - parameter closure: The closure to be executed before each example + in the test suite. + */ + public func afterEach(_ closure: @escaping AfterExampleClosure) { + exampleHooks.appendAfter(closure) + } + + /** + Like Quick.DSL.beforeSuite, this configures Quick to execute + the given closure prior to any and all examples that are run. + The two methods are functionally equivalent. + */ + public func beforeSuite(_ closure: @escaping BeforeSuiteClosure) { + suiteHooks.appendBefore(closure) + } + + /** + Like Quick.DSL.afterSuite, this configures Quick to execute + the given closure after all examples have been run. + The two methods are functionally equivalent. + */ + public func afterSuite(_ closure: @escaping AfterSuiteClosure) { + suiteHooks.appendAfter(closure) + } +} diff --git a/Example/Pods/Quick/Sources/Quick/DSL/DSL.swift b/Example/Pods/Quick/Sources/Quick/DSL/DSL.swift new file mode 100644 index 0000000..284ffe1 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/DSL/DSL.swift @@ -0,0 +1,271 @@ +/** + Defines a closure to be run prior to any examples in the test suite. + You may define an unlimited number of these closures, but there is no + guarantee as to the order in which they're run. + + If the test suite crashes before the first example is run, this closure + will not be executed. + + - parameter closure: The closure to be run prior to any examples in the test suite. +*/ +public func beforeSuite(_ closure: @escaping BeforeSuiteClosure) { + World.sharedWorld.beforeSuite(closure) +} + +/** + Defines a closure to be run after all of the examples in the test suite. + You may define an unlimited number of these closures, but there is no + guarantee as to the order in which they're run. + + If the test suite crashes before all examples are run, this closure + will not be executed. + + - parameter closure: The closure to be run after all of the examples in the test suite. +*/ +public func afterSuite(_ closure: @escaping AfterSuiteClosure) { + World.sharedWorld.afterSuite(closure) +} + +/** + Defines a group of shared examples. These examples can be re-used in several locations + by using the `itBehavesLike` function. + + - parameter name: The name of the shared example group. This must be unique across all shared example + groups defined in a test suite. + - parameter closure: A closure containing the examples. This behaves just like an example group defined + using `describe` or `context`--the closure may contain any number of `beforeEach` + and `afterEach` closures, as well as any number of examples (defined using `it`). +*/ +public func sharedExamples(_ name: String, closure: @escaping () -> Void) { + World.sharedWorld.sharedExamples(name) { _ in closure() } +} + +/** + Defines a group of shared examples. These examples can be re-used in several locations + by using the `itBehavesLike` function. + + - parameter name: The name of the shared example group. This must be unique across all shared example + groups defined in a test suite. + - parameter closure: A closure containing the examples. This behaves just like an example group defined + using `describe` or `context`--the closure may contain any number of `beforeEach` + and `afterEach` closures, as well as any number of examples (defined using `it`). + + The closure takes a SharedExampleContext as an argument. This context is a function + that can be executed to retrieve parameters passed in via an `itBehavesLike` function. +*/ +public func sharedExamples(_ name: String, closure: @escaping SharedExampleClosure) { + World.sharedWorld.sharedExamples(name, closure: closure) +} + +/** + Defines an example group. Example groups are logical groupings of examples. + Example groups can share setup and teardown code. + + - parameter description: An arbitrary string describing the example group. + - parameter closure: A closure that can contain other examples. + - parameter flags: A mapping of string keys to booleans that can be used to filter examples or example groups. +*/ +public func describe(_ description: String, flags: FilterFlags = [:], closure: () -> Void) { + World.sharedWorld.describe(description, flags: flags, closure: closure) +} + +/** + Defines an example group. Equivalent to `describe`. +*/ +public func context(_ description: String, flags: FilterFlags = [:], closure: () -> Void) { + World.sharedWorld.context(description, flags: flags, closure: closure) +} + +/** + Defines a closure to be run prior to each example in the current example + group. This closure is not run for pending or otherwise disabled examples. + An example group may contain an unlimited number of beforeEach. They'll be + run in the order they're defined, but you shouldn't rely on that behavior. + + - parameter closure: The closure to be run prior to each example. +*/ +public func beforeEach(_ closure: @escaping BeforeExampleClosure) { + World.sharedWorld.beforeEach(closure) +} + +/** + Identical to Quick.DSL.beforeEach, except the closure is provided with + metadata on the example that the closure is being run prior to. +*/ +public func beforeEach(_ closure: @escaping BeforeExampleWithMetadataClosure) { + World.sharedWorld.beforeEach(closure: closure) +} + +/** + Defines a closure to be run after each example in the current example + group. This closure is not run for pending or otherwise disabled examples. + An example group may contain an unlimited number of afterEach. They'll be + run in the order they're defined, but you shouldn't rely on that behavior. + + - parameter closure: The closure to be run after each example. +*/ +public func afterEach(_ closure: @escaping AfterExampleClosure) { + World.sharedWorld.afterEach(closure) +} + +/** + Identical to Quick.DSL.afterEach, except the closure is provided with + metadata on the example that the closure is being run after. +*/ +public func afterEach(_ closure: @escaping AfterExampleWithMetadataClosure) { + World.sharedWorld.afterEach(closure: closure) +} + +/** + Defines an example. Examples use assertions to demonstrate how code should + behave. These are like "tests" in XCTest. + + - parameter description: An arbitrary string describing what the example is meant to specify. + - parameter closure: A closure that can contain assertions. + - parameter flags: A mapping of string keys to booleans that can be used to filter examples or example groups. + Empty by default. + - parameter file: The absolute path to the file containing the example. A sensible default is provided. + - parameter line: The line containing the example. A sensible default is provided. +*/ +public func it(_ description: String, flags: FilterFlags = [:], file: FileString = #file, line: UInt = #line, closure: @escaping () -> Void) { + World.sharedWorld.it(description, flags: flags, file: file, line: line, closure: closure) +} + +/** + Inserts the examples defined using a `sharedExamples` function into the current example group. + The shared examples are executed at this location, as if they were written out manually. + + - parameter name: The name of the shared examples group to be executed. This must be identical to the + name of a shared examples group defined using `sharedExamples`. If there are no shared + examples that match the name given, an exception is thrown and the test suite will crash. + - parameter flags: A mapping of string keys to booleans that can be used to filter examples or example groups. + Empty by default. + - parameter file: The absolute path to the file containing the current example group. A sensible default is provided. + - parameter line: The line containing the current example group. A sensible default is provided. +*/ +public func itBehavesLike(_ name: String, flags: FilterFlags = [:], file: FileString = #file, line: UInt = #line) { + itBehavesLike(name, flags: flags, file: file, line: line, sharedExampleContext: { return [:] }) +} + +/** + Inserts the examples defined using a `sharedExamples` function into the current example group. + The shared examples are executed at this location, as if they were written out manually. + This function also passes those shared examples a context that can be evaluated to give the shared + examples extra information on the subject of the example. + + - parameter name: The name of the shared examples group to be executed. This must be identical to the + name of a shared examples group defined using `sharedExamples`. If there are no shared + examples that match the name given, an exception is thrown and the test suite will crash. + - parameter sharedExampleContext: A closure that, when evaluated, returns key-value pairs that provide the + shared examples with extra information on the subject of the example. + - parameter flags: A mapping of string keys to booleans that can be used to filter examples or example groups. + Empty by default. + - parameter file: The absolute path to the file containing the current example group. A sensible default is provided. + - parameter line: The line containing the current example group. A sensible default is provided. +*/ +public func itBehavesLike(_ name: String, flags: FilterFlags = [:], file: FileString = #file, line: UInt = #line, sharedExampleContext: @escaping SharedExampleContext) { + World.sharedWorld.itBehavesLike(name, sharedExampleContext: sharedExampleContext, flags: flags, file: file, line: line) +} + +/** + Inserts the examples defined using a `Behavior` into the current example group. + The shared examples are executed at this location, as if they were written out manually. + This function also passes a strongly-typed context that can be evaluated to give the shared examples extra information on the subject of the example. + + - parameter behavior: The type of `Behavior` class defining the example group to be executed. + - parameter context: A closure that, when evaluated, returns an instance of `Behavior`'s context type to provide its example group with extra information on the subject of the example. + - parameter flags: A mapping of string keys to booleans that can be used to filter examples or example groups. + Empty by default. + - parameter file: The absolute path to the file containing the current example group. A sensible default is provided. + - parameter line: The line containing the current example group. A sensible default is provided. + */ +public func itBehavesLike(_ behavior: Behavior.Type, flags: FilterFlags = [:], file: FileString = #file, line: UInt = #line, context: @escaping () -> C) { + World.sharedWorld.itBehavesLike(behavior, context: context, flags: flags, file: file, line: line) +} + +/** + Defines an example or example group that should not be executed. Use `pending` to temporarily disable + examples or groups that should not be run yet. + + - parameter description: An arbitrary string describing the example or example group. + - parameter closure: A closure that will not be evaluated. +*/ +public func pending(_ description: String, closure: () -> Void) { + World.sharedWorld.pending(description, closure: closure) +} + +/** + Use this to quickly mark a `describe` closure as pending. + This disables all examples within the closure. +*/ +public func xdescribe(_ description: String, flags: FilterFlags, closure: () -> Void) { + World.sharedWorld.xdescribe(description, flags: flags, closure: closure) +} + +/** + Use this to quickly mark a `context` closure as pending. + This disables all examples within the closure. +*/ +public func xcontext(_ description: String, flags: FilterFlags, closure: () -> Void) { + xdescribe(description, flags: flags, closure: closure) +} + +/** + Use this to quickly mark an `it` closure as pending. + This disables the example and ensures the code within the closure is never run. +*/ +public func xit(_ description: String, flags: FilterFlags = [:], file: FileString = #file, line: UInt = #line, closure: @escaping () -> Void) { + World.sharedWorld.xit(description, flags: flags, file: file, line: line, closure: closure) +} + +/** + Use this to quicklu mark an `itBehavesLike` closure as pending. + This disables the example group defined by this behavior and ensures the code within is never run. +*/ +public func xitBehavesLike(_ behavior: Behavior.Type, flags: FilterFlags = [:], file: FileString = #file, line: UInt = #line, context: @escaping () -> C) { + World.sharedWorld.xitBehavesLike(behavior, context: context, flags: flags, file: file, line: line) +} +/** + Use this to quickly focus a `describe` closure, focusing the examples in the closure. + If any examples in the test suite are focused, only those examples are executed. + This trumps any explicitly focused or unfocused examples within the closure--they are all treated as focused. +*/ +public func fdescribe(_ description: String, flags: FilterFlags = [:], closure: () -> Void) { + World.sharedWorld.fdescribe(description, flags: flags, closure: closure) +} + +/** + Use this to quickly focus a `context` closure. Equivalent to `fdescribe`. +*/ +public func fcontext(_ description: String, flags: FilterFlags = [:], closure: () -> Void) { + fdescribe(description, flags: flags, closure: closure) +} + +/** + Use this to quickly focus an `it` closure, focusing the example. + If any examples in the test suite are focused, only those examples are executed. +*/ +public func fit(_ description: String, flags: FilterFlags = [:], file: FileString = #file, line: UInt = #line, closure: @escaping () -> Void) { + World.sharedWorld.fit(description, flags: flags, file: file, line: line, closure: closure) +} + +/** + Use this to quickly focus an `itBehavesLike` closure. +*/ +public func fitBehavesLike(_ name: String, flags: FilterFlags = [:], file: FileString = #file, line: UInt = #line) { + fitBehavesLike(name, flags: flags, file: file, line: line, sharedExampleContext: { return [:] }) +} + +/** + Use this to quickly focus an `itBehavesLike` closure. +*/ +public func fitBehavesLike(_ name: String, flags: FilterFlags = [:], file: FileString = #file, line: UInt = #line, sharedExampleContext: @escaping SharedExampleContext) { + World.sharedWorld.fitBehavesLike(name, sharedExampleContext: sharedExampleContext, flags: flags, file: file, line: line) +} + +/** + Use this to quickly focus on `itBehavesLike` closure. + */ +public func fitBehavesLike(_ behavior: Behavior.Type, flags: FilterFlags = [:], file: FileString = #file, line: UInt = #line, context: @escaping () -> C) { + World.sharedWorld.fitBehavesLike(behavior, context: context, flags: flags, file: file, line: line) +} diff --git a/Example/Pods/Quick/Sources/Quick/DSL/World+DSL.swift b/Example/Pods/Quick/Sources/Quick/DSL/World+DSL.swift new file mode 100644 index 0000000..d331d69 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/DSL/World+DSL.swift @@ -0,0 +1,210 @@ +import Foundation + +/** + Adds methods to World to support top-level DSL functions (Swift) and + macros (Objective-C). These functions map directly to the DSL that test + writers use in their specs. +*/ +extension World { + internal func beforeSuite(_ closure: @escaping BeforeSuiteClosure) { + suiteHooks.appendBefore(closure) + } + + internal func afterSuite(_ closure: @escaping AfterSuiteClosure) { + suiteHooks.appendAfter(closure) + } + + internal func sharedExamples(_ name: String, closure: @escaping SharedExampleClosure) { + registerSharedExample(name, closure: closure) + } + + internal func describe(_ description: String, flags: FilterFlags, closure: () -> Void) { + guard currentExampleMetadata == nil else { + raiseError("'describe' cannot be used inside '\(currentPhase)', 'describe' may only be used inside 'context' or 'describe'. ") + } + guard currentExampleGroup != nil else { + raiseError("Error: example group was not created by its parent QuickSpec spec. Check that describe() or context() was used in QuickSpec.spec() and not a more general context (i.e. an XCTestCase test)") + } + let group = ExampleGroup(description: description, flags: flags) + currentExampleGroup.appendExampleGroup(group) + performWithCurrentExampleGroup(group, closure: closure) + } + + internal func context(_ description: String, flags: FilterFlags, closure: () -> Void) { + guard currentExampleMetadata == nil else { + raiseError("'context' cannot be used inside '\(currentPhase)', 'context' may only be used inside 'context' or 'describe'. ") + } + self.describe(description, flags: flags, closure: closure) + } + + internal func fdescribe(_ description: String, flags: FilterFlags, closure: () -> Void) { + var focusedFlags = flags + focusedFlags[Filter.focused] = true + self.describe(description, flags: focusedFlags, closure: closure) + } + + internal func xdescribe(_ description: String, flags: FilterFlags, closure: () -> Void) { + var pendingFlags = flags + pendingFlags[Filter.pending] = true + self.describe(description, flags: pendingFlags, closure: closure) + } + + internal func beforeEach(_ closure: @escaping BeforeExampleClosure) { + guard currentExampleMetadata == nil else { + raiseError("'beforeEach' cannot be used inside '\(currentPhase)', 'beforeEach' may only be used inside 'context' or 'describe'. ") + } + currentExampleGroup.hooks.appendBefore(closure) + } + +#if canImport(Darwin) && !SWIFT_PACKAGE + @objc(beforeEachWithMetadata:) + internal func beforeEach(closure: @escaping BeforeExampleWithMetadataClosure) { + currentExampleGroup.hooks.appendBefore(closure) + } +#else + internal func beforeEach(closure: @escaping BeforeExampleWithMetadataClosure) { + currentExampleGroup.hooks.appendBefore(closure) + } +#endif + + internal func afterEach(_ closure: @escaping AfterExampleClosure) { + guard currentExampleMetadata == nil else { + raiseError("'afterEach' cannot be used inside '\(currentPhase)', 'afterEach' may only be used inside 'context' or 'describe'. ") + } + currentExampleGroup.hooks.appendAfter(closure) + } + +#if canImport(Darwin) && !SWIFT_PACKAGE + @objc(afterEachWithMetadata:) + internal func afterEach(closure: @escaping AfterExampleWithMetadataClosure) { + currentExampleGroup.hooks.appendAfter(closure) + } +#else + internal func afterEach(closure: @escaping AfterExampleWithMetadataClosure) { + currentExampleGroup.hooks.appendAfter(closure) + } +#endif + + @nonobjc + internal func it(_ description: String, flags: FilterFlags, file: FileString, line: UInt, closure: @escaping () -> Void) { + if beforesCurrentlyExecuting { + raiseError("'it' cannot be used inside 'beforeEach', 'it' may only be used inside 'context' or 'describe'. ") + } + if aftersCurrentlyExecuting { + raiseError("'it' cannot be used inside 'afterEach', 'it' may only be used inside 'context' or 'describe'. ") + } + guard currentExampleMetadata == nil else { + raiseError("'it' cannot be used inside 'it', 'it' may only be used inside 'context' or 'describe'. ") + } + let callsite = Callsite(file: file, line: line) + let example = Example(description: description, callsite: callsite, flags: flags, closure: closure) + currentExampleGroup.appendExample(example) + } + + @nonobjc + internal func fit(_ description: String, flags: FilterFlags, file: FileString, line: UInt, closure: @escaping () -> Void) { + var focusedFlags = flags + focusedFlags[Filter.focused] = true + self.it(description, flags: focusedFlags, file: file, line: line, closure: closure) + } + + @nonobjc + internal func xit(_ description: String, flags: FilterFlags, file: FileString, line: UInt, closure: @escaping () -> Void) { + var pendingFlags = flags + pendingFlags[Filter.pending] = true + self.it(description, flags: pendingFlags, file: file, line: line, closure: closure) + } + + @nonobjc + internal func itBehavesLike(_ name: String, sharedExampleContext: @escaping SharedExampleContext, flags: FilterFlags, file: FileString, line: UInt) { + guard currentExampleMetadata == nil else { + raiseError("'itBehavesLike' cannot be used inside '\(currentPhase)', 'itBehavesLike' may only be used inside 'context' or 'describe'. ") + } + let callsite = Callsite(file: file, line: line) + let closure = World.sharedWorld.sharedExample(name) + + let group = ExampleGroup(description: name, flags: flags) + currentExampleGroup.appendExampleGroup(group) + performWithCurrentExampleGroup(group) { + closure(sharedExampleContext) + } + + group.walkDownExamples { (example: Example) in + example.isSharedExample = true + example.callsite = callsite + } + } + + @nonobjc + internal func fitBehavesLike(_ name: String, sharedExampleContext: @escaping SharedExampleContext, flags: FilterFlags, file: FileString, line: UInt) { + var focusedFlags = flags + focusedFlags[Filter.focused] = true + self.itBehavesLike(name, sharedExampleContext: sharedExampleContext, flags: focusedFlags, file: file, line: line) + } + + internal func itBehavesLike(_ behavior: Behavior.Type, context: @escaping () -> C, flags: FilterFlags, file: FileString, line: UInt) { + guard currentExampleMetadata == nil else { + raiseError("'itBehavesLike' cannot be used inside '\(currentPhase)', 'itBehavesLike' may only be used inside 'context' or 'describe'. ") + } + let callsite = Callsite(file: file, line: line) + let closure = behavior.spec + let group = ExampleGroup(description: behavior.name, flags: flags) + currentExampleGroup.appendExampleGroup(group) + performWithCurrentExampleGroup(group) { + closure(context) + } + + group.walkDownExamples { (example: Example) in + example.isSharedExample = true + example.callsite = callsite + } + } + + internal func fitBehavesLike(_ behavior: Behavior.Type, context: @escaping () -> C, flags: FilterFlags, file: FileString, line: UInt) { + var focusedFlags = flags + focusedFlags[Filter.focused] = true + self.itBehavesLike(behavior, context: context, flags: focusedFlags, file: file, line: line) + } + + internal func xitBehavesLike(_ behavior: Behavior.Type, context: @escaping () -> C, flags: FilterFlags, file: FileString, line: UInt) { + var pendingFlags = flags + pendingFlags[Filter.pending] = true + self.itBehavesLike(behavior, context: context, flags: pendingFlags, file: file, line: line) + } + +#if canImport(Darwin) && !SWIFT_PACKAGE + @objc(itWithDescription:flags:file:line:closure:) + internal func objc_it(_ description: String, flags: FilterFlags, file: FileString, line: UInt, closure: @escaping () -> Void) { + it(description, flags: flags, file: file, line: line, closure: closure) + } + + @objc(fitWithDescription:flags:file:line:closure:) + internal func objc_fit(_ description: String, flags: FilterFlags, file: FileString, line: UInt, closure: @escaping () -> Void) { + fit(description, flags: flags, file: file, line: line, closure: closure) + } + + @objc(xitWithDescription:flags:file:line:closure:) + internal func objc_xit(_ description: String, flags: FilterFlags, file: FileString, line: UInt, closure: @escaping () -> Void) { + xit(description, flags: flags, file: file, line: line, closure: closure) + } + + @objc(itBehavesLikeSharedExampleNamed:sharedExampleContext:flags:file:line:) + internal func objc_itBehavesLike(_ name: String, sharedExampleContext: @escaping SharedExampleContext, flags: FilterFlags, file: FileString, line: UInt) { + itBehavesLike(name, sharedExampleContext: sharedExampleContext, flags: flags, file: file, line: line) + } +#endif + + internal func pending(_ description: String, closure: () -> Void) { + print("Pending: \(description)") + } + + private var currentPhase: String { + if beforesCurrentlyExecuting { + return "beforeEach" + } else if aftersCurrentlyExecuting { + return "afterEach" + } + + return "it" + } +} diff --git a/Example/Pods/Quick/Sources/Quick/ErrorUtility.swift b/Example/Pods/Quick/Sources/Quick/ErrorUtility.swift new file mode 100644 index 0000000..f13f43a --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/ErrorUtility.swift @@ -0,0 +1,10 @@ +import Foundation + +internal func raiseError(_ message: String) -> Never { +#if canImport(Darwin) + NSException(name: .internalInconsistencyException, reason: message, userInfo: nil).raise() +#endif + + // This won't be reached when ObjC is available and the exception above is raisd + fatalError(message) +} diff --git a/Example/Pods/Quick/Sources/Quick/Example.swift b/Example/Pods/Quick/Sources/Quick/Example.swift new file mode 100644 index 0000000..594efa0 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/Example.swift @@ -0,0 +1,128 @@ +import Foundation + +private var numberOfExamplesRun = 0 +private var numberOfIncludedExamples = 0 + +#if canImport(Darwin) && !SWIFT_PACKAGE +@objcMembers +public class _ExampleBase: NSObject {} +#else +public class _ExampleBase: NSObject {} +#endif + +/** + Examples, defined with the `it` function, use assertions to + demonstrate how code should behave. These are like "tests" in XCTest. +*/ +final public class Example: _ExampleBase { + /** + A boolean indicating whether the example is a shared example; + i.e.: whether it is an example defined with `itBehavesLike`. + */ + public var isSharedExample = false + + /** + The site at which the example is defined. + This must be set correctly in order for Xcode to highlight + the correct line in red when reporting a failure. + */ + public var callsite: Callsite + + weak internal var group: ExampleGroup? + + private let internalDescription: String + private let closure: () -> Void + private let flags: FilterFlags + + internal init(description: String, callsite: Callsite, flags: FilterFlags, closure: @escaping () -> Void) { + self.internalDescription = description + self.closure = closure + self.callsite = callsite + self.flags = flags + } + + public override var description: String { + return internalDescription + } + + /** + The example name. A name is a concatenation of the name of + the example group the example belongs to, followed by the + description of the example itself. + + The example name is used to generate a test method selector + to be displayed in Xcode's test navigator. + */ + public var name: String { + guard let groupName = group?.name else { return description } + return "\(groupName), \(description)" + } + + /** + Executes the example closure, as well as all before and after + closures defined in the its surrounding example groups. + */ + public func run() { + let world = World.sharedWorld + + if numberOfIncludedExamples == 0 { + numberOfIncludedExamples = world.includedExampleCount + } + + if numberOfExamplesRun == 0 { + world.suiteHooks.executeBefores() + } + + let exampleMetadata = ExampleMetadata(example: self, exampleIndex: numberOfExamplesRun) + world.currentExampleMetadata = exampleMetadata + defer { + world.currentExampleMetadata = nil + } + + world.exampleHooks.executeBefores(exampleMetadata) + group!.phase = .beforesExecuting + for before in group!.befores { + before(exampleMetadata) + } + group!.phase = .beforesFinished + + closure() + + group!.phase = .aftersExecuting + for after in group!.afters { + after(exampleMetadata) + } + group!.phase = .aftersFinished + world.exampleHooks.executeAfters(exampleMetadata) + + numberOfExamplesRun += 1 + + if !world.isRunningAdditionalSuites && numberOfExamplesRun >= numberOfIncludedExamples { + world.suiteHooks.executeAfters() + } + } + + /** + Evaluates the filter flags set on this example and on the example groups + this example belongs to. Flags set on the example are trumped by flags on + the example group it belongs to. Flags on inner example groups are trumped + by flags on outer example groups. + */ + internal var filterFlags: FilterFlags { + var aggregateFlags = flags + for (key, value) in group!.filterFlags { + aggregateFlags[key] = value + } + return aggregateFlags + } +} + +extension Example { + /** + Returns a boolean indicating whether two Example objects are equal. + If two examples are defined at the exact same callsite, they must be equal. + */ + @nonobjc public static func == (lhs: Example, rhs: Example) -> Bool { + return lhs.callsite == rhs.callsite + } +} diff --git a/Example/Pods/Quick/Sources/Quick/ExampleGroup.swift b/Example/Pods/Quick/Sources/Quick/ExampleGroup.swift new file mode 100644 index 0000000..129bed0 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/ExampleGroup.swift @@ -0,0 +1,99 @@ +import Foundation + +/** + Example groups are logical groupings of examples, defined with + the `describe` and `context` functions. Example groups can share + setup and teardown code. +*/ +final public class ExampleGroup: NSObject { + weak internal var parent: ExampleGroup? + internal let hooks = ExampleHooks() + + internal var phase: HooksPhase = .nothingExecuted + + private let internalDescription: String + private let flags: FilterFlags + private let isInternalRootExampleGroup: Bool + private var childGroups = [ExampleGroup]() + private var childExamples = [Example]() + + internal init(description: String, flags: FilterFlags, isInternalRootExampleGroup: Bool = false) { + self.internalDescription = description + self.flags = flags + self.isInternalRootExampleGroup = isInternalRootExampleGroup + } + + public override var description: String { + return internalDescription + } + + /** + Returns a list of examples that belong to this example group, + or to any of its descendant example groups. + */ + public var examples: [Example] { + return childExamples + childGroups.flatMap { $0.examples } + } + + internal var name: String? { + guard let parent = parent else { + return isInternalRootExampleGroup ? nil : description + } + + guard let name = parent.name else { return description } + return "\(name), \(description)" + } + + internal var filterFlags: FilterFlags { + var aggregateFlags = flags + walkUp { group in + for (key, value) in group.flags { + aggregateFlags[key] = value + } + } + return aggregateFlags + } + + internal var befores: [BeforeExampleWithMetadataClosure] { + var closures = Array(hooks.befores.reversed()) + walkUp { group in + closures.append(contentsOf: Array(group.hooks.befores.reversed())) + } + return Array(closures.reversed()) + } + + internal var afters: [AfterExampleWithMetadataClosure] { + var closures = hooks.afters + walkUp { group in + closures.append(contentsOf: group.hooks.afters) + } + return closures + } + + internal func walkDownExamples(_ callback: (_ example: Example) -> Void) { + for example in childExamples { + callback(example) + } + for group in childGroups { + group.walkDownExamples(callback) + } + } + + internal func appendExampleGroup(_ group: ExampleGroup) { + group.parent = self + childGroups.append(group) + } + + internal func appendExample(_ example: Example) { + example.group = self + childExamples.append(example) + } + + private func walkUp(_ callback: (_ group: ExampleGroup) -> Void) { + var group = self + while let parent = group.parent { + callback(parent) + group = parent + } + } +} diff --git a/Example/Pods/Quick/Sources/Quick/ExampleMetadata.swift b/Example/Pods/Quick/Sources/Quick/ExampleMetadata.swift new file mode 100644 index 0000000..b07b3bd --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/ExampleMetadata.swift @@ -0,0 +1,31 @@ +import Foundation + +#if canImport(Darwin) && !SWIFT_PACKAGE +@objcMembers +public class _ExampleMetadataBase: NSObject {} +#else +public class _ExampleMetadataBase: NSObject {} +#endif + +/** + A class that encapsulates information about an example, + including the index at which the example was executed, as + well as the example itself. +*/ +final public class ExampleMetadata: _ExampleMetadataBase { + /** + The example for which this metadata was collected. + */ + public let example: Example + + /** + The index at which this example was executed in the + test suite. + */ + public let exampleIndex: Int + + internal init(example: Example, exampleIndex: Int) { + self.example = example + self.exampleIndex = exampleIndex + } +} diff --git a/Example/Pods/Quick/Sources/Quick/Filter.swift b/Example/Pods/Quick/Sources/Quick/Filter.swift new file mode 100644 index 0000000..304f6ec --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/Filter.swift @@ -0,0 +1,38 @@ +import Foundation + +#if canImport(Darwin) && !SWIFT_PACKAGE +@objcMembers +public class _FilterBase: NSObject {} +#else +public class _FilterBase: NSObject {} +#endif + +/** + A mapping of string keys to booleans that can be used to + filter examples or example groups. For example, a "focused" + example would have the flags [Focused: true]. +*/ +public typealias FilterFlags = [String: Bool] + +/** + A namespace for filter flag keys, defined primarily to make the + keys available in Objective-C. +*/ +final public class Filter: _FilterBase { + /** + Example and example groups with [Focused: true] are included in test runs, + excluding all other examples without this flag. Use this to only run one or + two tests that you're currently focusing on. + */ + public class var focused: String { + return "focused" + } + + /** + Example and example groups with [Pending: true] are excluded from test runs. + Use this to temporarily suspend examples that you know do not pass yet. + */ + public class var pending: String { + return "pending" + } +} diff --git a/Example/Pods/Quick/Sources/Quick/Hooks/Closures.swift b/Example/Pods/Quick/Sources/Quick/Hooks/Closures.swift new file mode 100644 index 0000000..9c7d310 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/Hooks/Closures.swift @@ -0,0 +1,35 @@ +// MARK: Example Hooks + +/** + A closure executed before an example is run. +*/ +public typealias BeforeExampleClosure = () -> Void + +/** + A closure executed before an example is run. The closure is given example metadata, + which contains information about the example that is about to be run. +*/ +public typealias BeforeExampleWithMetadataClosure = (_ exampleMetadata: ExampleMetadata) -> Void + +/** + A closure executed after an example is run. +*/ +public typealias AfterExampleClosure = BeforeExampleClosure + +/** + A closure executed after an example is run. The closure is given example metadata, + which contains information about the example that has just finished running. +*/ +public typealias AfterExampleWithMetadataClosure = BeforeExampleWithMetadataClosure + +// MARK: Suite Hooks + +/** + A closure executed before any examples are run. +*/ +public typealias BeforeSuiteClosure = () -> Void + +/** + A closure executed after all examples have finished running. +*/ +public typealias AfterSuiteClosure = BeforeSuiteClosure diff --git a/Example/Pods/Quick/Sources/Quick/Hooks/ExampleHooks.swift b/Example/Pods/Quick/Sources/Quick/Hooks/ExampleHooks.swift new file mode 100644 index 0000000..449cbfc --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/Hooks/ExampleHooks.swift @@ -0,0 +1,42 @@ +/** + A container for closures to be executed before and after each example. +*/ +final internal class ExampleHooks { + internal var befores: [BeforeExampleWithMetadataClosure] = [] + internal var afters: [AfterExampleWithMetadataClosure] = [] + internal var phase: HooksPhase = .nothingExecuted + + internal func appendBefore(_ closure: @escaping BeforeExampleWithMetadataClosure) { + befores.append(closure) + } + + internal func appendBefore(_ closure: @escaping BeforeExampleClosure) { + befores.append { (_: ExampleMetadata) in closure() } + } + + internal func appendAfter(_ closure: @escaping AfterExampleWithMetadataClosure) { + afters.append(closure) + } + + internal func appendAfter(_ closure: @escaping AfterExampleClosure) { + afters.append { (_: ExampleMetadata) in closure() } + } + + internal func executeBefores(_ exampleMetadata: ExampleMetadata) { + phase = .beforesExecuting + for before in befores { + before(exampleMetadata) + } + + phase = .beforesFinished + } + + internal func executeAfters(_ exampleMetadata: ExampleMetadata) { + phase = .aftersExecuting + for after in afters { + after(exampleMetadata) + } + + phase = .aftersFinished + } +} diff --git a/Example/Pods/Quick/Sources/Quick/Hooks/HooksPhase.swift b/Example/Pods/Quick/Sources/Quick/Hooks/HooksPhase.swift new file mode 100644 index 0000000..2440158 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/Hooks/HooksPhase.swift @@ -0,0 +1,11 @@ +/** + A description of the execution cycle of the current example with + respect to the hooks of that example. + */ +internal enum HooksPhase { + case nothingExecuted + case beforesExecuting + case beforesFinished + case aftersExecuting + case aftersFinished +} diff --git a/Example/Pods/Quick/Sources/Quick/Hooks/SuiteHooks.swift b/Example/Pods/Quick/Sources/Quick/Hooks/SuiteHooks.swift new file mode 100644 index 0000000..b39292b --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/Hooks/SuiteHooks.swift @@ -0,0 +1,32 @@ +/** + A container for closures to be executed before and after all examples. +*/ +final internal class SuiteHooks { + internal var befores: [BeforeSuiteClosure] = [] + internal var afters: [AfterSuiteClosure] = [] + internal var phase: HooksPhase = .nothingExecuted + + internal func appendBefore(_ closure: @escaping BeforeSuiteClosure) { + befores.append(closure) + } + + internal func appendAfter(_ closure: @escaping AfterSuiteClosure) { + afters.append(closure) + } + + internal func executeBefores() { + phase = .beforesExecuting + for before in befores { + before() + } + phase = .beforesFinished + } + + internal func executeAfters() { + phase = .aftersExecuting + for after in afters { + after() + } + phase = .aftersFinished + } +} diff --git a/Example/Pods/Quick/Sources/Quick/NSBundle+CurrentTestBundle.swift b/Example/Pods/Quick/Sources/Quick/NSBundle+CurrentTestBundle.swift new file mode 100644 index 0000000..f5596cc --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/NSBundle+CurrentTestBundle.swift @@ -0,0 +1,25 @@ +#if canImport(Darwin) + +import Foundation + +extension Bundle { + + /** + Locates the first bundle with a '.xctest' file extension. + */ + internal static var currentTestBundle: Bundle? { + return allBundles.first { $0.bundlePath.hasSuffix(".xctest") } + } + + /** + Return the module name of the bundle. + Uses the bundle filename and transform it to match Xcode's transformation. + Module name has to be a valid "C99 extended identifier". + */ + internal var moduleName: String { + let fileName = bundleURL.fileName + return fileName.c99ExtendedIdentifier + } +} + +#endif diff --git a/Example/Pods/Quick/Sources/Quick/QuickSelectedTestSuiteBuilder.swift b/Example/Pods/Quick/Sources/Quick/QuickSelectedTestSuiteBuilder.swift new file mode 100644 index 0000000..865c3ae --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/QuickSelectedTestSuiteBuilder.swift @@ -0,0 +1,74 @@ +#if canImport(Darwin) +import Foundation + +/** + Responsible for building a "Selected tests" suite. This corresponds to a single + spec, and all its examples. + */ +internal class QuickSelectedTestSuiteBuilder: QuickTestSuiteBuilder { + + /** + The test spec class to run. + */ + let testCaseClass: AnyClass! + + /** + For Objective-C classes, returns the class name. For Swift classes without, + an explicit Objective-C name, returns a module-namespaced class name + (e.g., "FooTests.FooSpec"). + */ + var testSuiteClassName: String { + return NSStringFromClass(testCaseClass) + } + + /** + Given a test case name: + + FooSpec/testFoo + + Optionally constructs a test suite builder for the named test case class + in the running test bundle. + + If no test bundle can be found, or the test case class can't be found, + initialization fails and returns `nil`. + */ + init?(forTestCaseWithName name: String) { + guard let testCaseClass = testCaseClassForTestCaseWithName(name) else { + self.testCaseClass = nil + return nil + } + + self.testCaseClass = testCaseClass + } + + /** + Returns a `QuickTestSuite` that runs the associated test case class. + */ + func buildTestSuite() -> QuickTestSuite { + return QuickTestSuite(forTestCaseClass: testCaseClass) + } + +} + +/** + Searches `Bundle.allBundles()` for an xctest bundle, then looks up the named + test case class in that bundle. + + Returns `nil` if a bundle or test case class cannot be found. + */ +private func testCaseClassForTestCaseWithName(_ name: String) -> AnyClass? { + func extractClassName(_ name: String) -> String? { + return name.components(separatedBy: "/").first + } + + guard let className = extractClassName(name) else { return nil } + guard let bundle = Bundle.currentTestBundle else { return nil } + + if let testCaseClass = bundle.classNamed(className) { return testCaseClass } + + let moduleName = bundle.moduleName + + return NSClassFromString("\(moduleName).\(className)") +} + +#endif diff --git a/Example/Pods/Quick/Sources/Quick/QuickTestSuite.swift b/Example/Pods/Quick/Sources/Quick/QuickTestSuite.swift new file mode 100644 index 0000000..5cdc6d8 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/QuickTestSuite.swift @@ -0,0 +1,52 @@ +#if canImport(Darwin) + +import XCTest + +/** + This protocol defines the role of an object that builds test suites. + */ +internal protocol QuickTestSuiteBuilder { + + /** + Construct a `QuickTestSuite` instance with the appropriate test cases added as tests. + + Subsequent calls to this method should return equivalent test suites. + */ + func buildTestSuite() -> QuickTestSuite + +} + +/** + A base class for a class cluster of Quick test suites, that should correctly + build dynamic test suites for XCTest to execute. + */ +public class QuickTestSuite: XCTestSuite { + + private static var builtTestSuites: Set = Set() + + /** + Construct a test suite for a specific, selected subset of test cases (rather + than the default, which as all test cases). + + If this method is called multiple times for the same test case class, e.g.. + + FooSpec/testFoo + FooSpec/testBar + + It is expected that the first call should return a valid test suite, and + all subsequent calls should return `nil`. + */ + @objc + public static func selectedTestSuite(forTestCaseWithName name: String) -> QuickTestSuite? { + guard let builder = QuickSelectedTestSuiteBuilder(forTestCaseWithName: name) else { return nil } + + let (inserted, _) = builtTestSuites.insert(builder.testSuiteClassName) + if inserted { + return builder.buildTestSuite() + } else { + return nil + } + } +} + +#endif diff --git a/Example/Pods/Quick/Sources/Quick/String+C99ExtendedIdentifier.swift b/Example/Pods/Quick/Sources/Quick/String+C99ExtendedIdentifier.swift new file mode 100644 index 0000000..2dcd606 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/String+C99ExtendedIdentifier.swift @@ -0,0 +1,46 @@ +#if canImport(Darwin) +import Foundation + +extension String { + private static var invalidCharacters: CharacterSet = { + var invalidCharacters = CharacterSet() + + let invalidCharacterSets: [CharacterSet] = [ + .whitespacesAndNewlines, + .illegalCharacters, + .controlCharacters, + .punctuationCharacters, + .nonBaseCharacters, + .symbols + ] + + for invalidSet in invalidCharacterSets { + invalidCharacters.formUnion(invalidSet) + } + + return invalidCharacters + }() + + internal var c99ExtendedIdentifier: String { + let validComponents = components(separatedBy: String.invalidCharacters) + let result = validComponents.joined(separator: "_") + + return result.isEmpty ? "_" : result + } +} + +/// Extension methods or properties for NSObject subclasses are invisible from +/// the Objective-C runtime on static linking unless the consumers add `-ObjC` +/// linker flag, so let's make a wrapper class to mitigate that situation. +/// +/// See: https://github.com/Quick/Quick/issues/785 and https://github.com/Quick/Quick/pull/803 +@objc +class QCKObjCStringUtils: NSObject { + override private init() {} + + @objc + static func c99ExtendedIdentifier(from string: String) -> String { + return string.c99ExtendedIdentifier + } +} +#endif diff --git a/Example/Pods/Quick/Sources/Quick/URL+FileName.swift b/Example/Pods/Quick/Sources/Quick/URL+FileName.swift new file mode 100644 index 0000000..23c4781 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/URL+FileName.swift @@ -0,0 +1,12 @@ +import Foundation + +extension URL { + + /** + Returns the path file name without file extension. + */ + var fileName: String { + return self.deletingPathExtension().lastPathComponent + } + +} diff --git a/Example/Pods/Quick/Sources/Quick/World.swift b/Example/Pods/Quick/Sources/Quick/World.swift new file mode 100644 index 0000000..e652871 --- /dev/null +++ b/Example/Pods/Quick/Sources/Quick/World.swift @@ -0,0 +1,241 @@ +import Foundation + +/** + A closure that, when evaluated, returns a dictionary of key-value + pairs that can be accessed from within a group of shared examples. +*/ +public typealias SharedExampleContext = () -> [String: Any] + +/** + A closure that is used to define a group of shared examples. This + closure may contain any number of example and example groups. +*/ +public typealias SharedExampleClosure = (@escaping SharedExampleContext) -> Void + +#if canImport(Darwin) && !SWIFT_PACKAGE +@objcMembers +internal class _WorldBase: NSObject {} +#else +internal class _WorldBase: NSObject {} +#endif + +/** + A collection of state Quick builds up in order to work its magic. + World is primarily responsible for maintaining a mapping of QuickSpec + classes to root example groups for those classes. + + It also maintains a mapping of shared example names to shared + example closures. + + You may configure how Quick behaves by calling the -[World configure:] + method from within an overridden +[QuickConfiguration configure:] method. +*/ +final internal class World: _WorldBase { + /** + The example group that is currently being run. + The DSL requires that this group is correctly set in order to build a + correct hierarchy of example groups and their examples. + */ + internal var currentExampleGroup: ExampleGroup! + + /** + The example metadata of the test that is currently being run. + This is useful for using the Quick test metadata (like its name) at + runtime. + */ + + internal var currentExampleMetadata: ExampleMetadata? + + /** + A flag that indicates whether additional test suites are being run + within this test suite. This is only true within the context of Quick + functional tests. + */ +#if canImport(Darwin) + // Convention of generating Objective-C selector has been changed on Swift 3 + @objc(isRunningAdditionalSuites) + internal var isRunningAdditionalSuites = false +#else + internal var isRunningAdditionalSuites = false +#endif + + private var specs: [String: ExampleGroup] = [:] + private var sharedExamples: [String: SharedExampleClosure] = [:] + private let configuration = Configuration() + + internal private(set) var isConfigurationFinalized = false + + internal var exampleHooks: ExampleHooks {return configuration.exampleHooks } + internal var suiteHooks: SuiteHooks { return configuration.suiteHooks } + + // MARK: Singleton Constructor + + private override init() {} + + static let sharedWorld = World() + + // MARK: Public Interface + + /** + Exposes the World's Configuration object within the scope of the closure + so that it may be configured. This method must not be called outside of + an overridden +[QuickConfiguration configure:] method. + + - parameter closure: A closure that takes a Configuration object that can + be mutated to change Quick's behavior. + */ + internal func configure(_ closure: QuickConfigurer) { + assert(!isConfigurationFinalized, + "Quick cannot be configured outside of a +[QuickConfiguration configure:] method. You should not call -[World configure:] directly. Instead, subclass QuickConfiguration and override the +[QuickConfiguration configure:] method.") + closure(configuration) + } + + /** + Finalizes the World's configuration. + Any subsequent calls to World.configure() will raise. + */ + internal func finalizeConfiguration() { + isConfigurationFinalized = true + } + + /** + Returns an internally constructed root example group for the given + QuickSpec class. + + A root example group with the description "root example group" is lazily + initialized for each QuickSpec class. This root example group wraps the + top level of a -[QuickSpec spec] method--it's thanks to this group that + users can define beforeEach and it closures at the top level, like so: + + override func spec() { + // These belong to the root example group + beforeEach {} + it("is at the top level") {} + } + + - parameter cls: The QuickSpec class for which to retrieve the root example group. + - returns: The root example group for the class. + */ + internal func rootExampleGroupForSpecClass(_ cls: AnyClass) -> ExampleGroup { + let name = String(describing: cls) + + if let group = specs[name] { + return group + } else { + let group = ExampleGroup( + description: "root example group", + flags: [:], + isInternalRootExampleGroup: true + ) + specs[name] = group + return group + } + } + + /** + Returns all examples that should be run for a given spec class. + There are two filtering passes that occur when determining which examples should be run. + That is, these examples are the ones that are included by inclusion filters, and are + not excluded by exclusion filters. + + - parameter specClass: The QuickSpec subclass for which examples are to be returned. + - returns: A list of examples to be run as test invocations. + */ + internal func examples(_ specClass: AnyClass) -> [Example] { + // 1. Grab all included examples. + let included = includedExamples + // 2. Grab the intersection of (a) examples for this spec, and (b) included examples. + let spec = rootExampleGroupForSpecClass(specClass).examples.filter { included.contains($0) } + // 3. Remove all excluded examples. + return spec.filter { example in + !self.configuration.exclusionFilters.reduce(false) { $0 || $1(example) } + } + } + +#if canImport(Darwin) + @objc(examplesForSpecClass:) + internal func objc_examples(_ specClass: AnyClass) -> [Example] { + return examples(specClass) + } +#endif + + // MARK: Internal + + internal func registerSharedExample(_ name: String, closure: @escaping SharedExampleClosure) { + raiseIfSharedExampleAlreadyRegistered(name) + sharedExamples[name] = closure + } + + internal func sharedExample(_ name: String) -> SharedExampleClosure { + raiseIfSharedExampleNotRegistered(name) + return sharedExamples[name]! + } + + internal var includedExampleCount: Int { + return includedExamples.count + } + + internal var beforesCurrentlyExecuting: Bool { + let suiteBeforesExecuting = suiteHooks.phase == .beforesExecuting + let exampleBeforesExecuting = exampleHooks.phase == .beforesExecuting + var groupBeforesExecuting = false + if let runningExampleGroup = currentExampleMetadata?.example.group { + groupBeforesExecuting = runningExampleGroup.phase == .beforesExecuting + } + + return suiteBeforesExecuting || exampleBeforesExecuting || groupBeforesExecuting + } + + internal var aftersCurrentlyExecuting: Bool { + let suiteAftersExecuting = suiteHooks.phase == .aftersExecuting + let exampleAftersExecuting = exampleHooks.phase == .aftersExecuting + var groupAftersExecuting = false + if let runningExampleGroup = currentExampleMetadata?.example.group { + groupAftersExecuting = runningExampleGroup.phase == .aftersExecuting + } + + return suiteAftersExecuting || exampleAftersExecuting || groupAftersExecuting + } + + internal func performWithCurrentExampleGroup(_ group: ExampleGroup, closure: () -> Void) { + let previousExampleGroup = currentExampleGroup + currentExampleGroup = group + + closure() + + currentExampleGroup = previousExampleGroup + } + + private var allExamples: [Example] { + var all: [Example] = [] + for (_, group) in specs { + group.walkDownExamples { all.append($0) } + } + return all + } + + private var includedExamples: [Example] { + let all = allExamples + let included = all.filter { example in + return self.configuration.inclusionFilters.reduce(false) { $0 || $1(example) } + } + + if included.isEmpty && configuration.runAllWhenEverythingFiltered { + return all + } else { + return included + } + } + + private func raiseIfSharedExampleAlreadyRegistered(_ name: String) { + if sharedExamples[name] != nil { + raiseError("A shared example named '\(name)' has already been registered.") + } + } + + private func raiseIfSharedExampleNotRegistered(_ name: String) { + if sharedExamples[name] == nil { + raiseError("No shared example named '\(name)' has been registered. Registered shared examples: '\(Array(sharedExamples.keys))'") + } + } +} diff --git a/Example/Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.h b/Example/Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.h new file mode 100644 index 0000000..5646199 --- /dev/null +++ b/Example/Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.h @@ -0,0 +1,30 @@ +#import + +@class Configuration; + +/** + Subclass QuickConfiguration and override the +[QuickConfiguration configure:] + method in order to configure how Quick behaves when running specs, or to define + shared examples that are used across spec files. + */ +@interface QuickConfiguration : NSObject + +/** + This method is executed on each subclass of this class before Quick runs + any examples. You may override this method on as many subclasses as you like, but + there is no guarantee as to the order in which these methods are executed. + + You can override this method in order to: + + 1. Configure how Quick behaves, by modifying properties on the Configuration object. + Setting the same properties in several methods has undefined behavior. + + 2. Define shared examples using `sharedExamples`. + + @param configuration A mutable object that is used to configure how Quick behaves on + a framework level. For details on all the options, see the + documentation in Configuration.swift. + */ ++ (void)configure:(Configuration *)configuration; + +@end diff --git a/Example/Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.m b/Example/Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.m new file mode 100644 index 0000000..17beaa7 --- /dev/null +++ b/Example/Pods/Quick/Sources/QuickObjectiveC/Configuration/QuickConfiguration.m @@ -0,0 +1,88 @@ +#import "QuickConfiguration.h" +#import + +#if __has_include("Quick-Swift.h") +#import "Quick-Swift.h" +#else +#import +#endif + +typedef void (^QCKClassEnumerationBlock)(Class klass); + +/** + Finds all direct subclasses of the given class and passes them to the block provided. + The classes are iterated over in the order that objc_getClassList returns them. + + @param klass The base class to find subclasses of. + @param block A block that takes a Class. This block will be executed once for each subclass of klass. + */ +void qck_enumerateSubclasses(Class klass, QCKClassEnumerationBlock block) { + Class *classes = NULL; + int classesCount = objc_getClassList(NULL, 0); + + if (classesCount > 0) { + classes = (Class *)calloc(sizeof(Class), classesCount); + classesCount = objc_getClassList(classes, classesCount); + + Class subclass, superclass; + for(int i = 0; i < classesCount; i++) { + subclass = classes[i]; + superclass = class_getSuperclass(subclass); + if (superclass == klass && block) { + block(subclass); + } + } + + free(classes); + } +} + +@implementation QuickConfiguration + +#pragma mark - Object Lifecycle + +/** + QuickConfiguration is not meant to be instantiated; it merely provides a hook + for users to configure how Quick behaves. Raise an exception if an instance of + QuickConfiguration is created. + */ +- (instancetype)init { + NSString *className = NSStringFromClass([self class]); + NSString *selectorName = NSStringFromSelector(@selector(configure:)); + [NSException raise:NSInternalInconsistencyException + format:@"%@ is not meant to be instantiated; " + @"subclass %@ and override %@ to configure Quick.", + className, className, selectorName]; + return nil; +} + +#pragma mark - NSObject Overrides + +/** + Hook into when QuickConfiguration is initialized in the runtime in order to + call +[QuickConfiguration configure:] on each of its subclasses. + */ ++ (void)initialize { + // Only enumerate over the subclasses of QuickConfiguration, not any of its subclasses. + if ([self class] == [QuickConfiguration class]) { + + // Only enumerate over subclasses once, even if +[QuickConfiguration initialize] + // were to be called several times. This is necessary because +[QuickSpec initialize] + // manually calls +[QuickConfiguration initialize]. + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + qck_enumerateSubclasses([QuickConfiguration class], ^(__unsafe_unretained Class klass) { + [[World sharedWorld] configure:^(Configuration *configuration) { + [klass configure:configuration]; + }]; + }); + [[World sharedWorld] finalizeConfiguration]; + }); + } +} + +#pragma mark - Public Interface + ++ (void)configure:(Configuration *)configuration { } + +@end diff --git a/Example/Pods/Quick/Sources/QuickObjectiveC/DSL/QCKDSL.h b/Example/Pods/Quick/Sources/QuickObjectiveC/DSL/QCKDSL.h new file mode 100644 index 0000000..c5f3152 --- /dev/null +++ b/Example/Pods/Quick/Sources/QuickObjectiveC/DSL/QCKDSL.h @@ -0,0 +1,234 @@ +#import + +@class ExampleMetadata; + +/** + Provides a hook for Quick to be configured before any examples are run. + Within this scope, override the +[QuickConfiguration configure:] method + to set properties on a configuration object to customize Quick behavior. + For details, see the documentation for Configuraiton.swift. + + @param name The name of the configuration class. Like any Objective-C + class name, this must be unique to the current runtime + environment. + */ +#define QuickConfigurationBegin(name) \ + @interface name : QuickConfiguration; @end \ + @implementation name \ + + +/** + Marks the end of a Quick configuration. + Make sure you put this after `QuickConfigurationBegin`. + */ +#define QuickConfigurationEnd \ + @end \ + + +/** + Defines a new QuickSpec. Define examples and example groups within the space + between this and `QuickSpecEnd`. + + @param name The name of the spec class. Like any Objective-C class name, this + must be unique to the current runtime environment. + */ +#define QuickSpecBegin(name) \ + @interface name : QuickSpec; @end \ + @implementation name \ + - (void)spec { \ + + +/** + Marks the end of a QuickSpec. Make sure you put this after `QuickSpecBegin`. + */ +#define QuickSpecEnd \ + } \ + @end \ + +typedef NSDictionary *(^QCKDSLSharedExampleContext)(void); +typedef void (^QCKDSLSharedExampleBlock)(QCKDSLSharedExampleContext); +typedef void (^QCKDSLEmptyBlock)(void); +typedef void (^QCKDSLExampleMetadataBlock)(ExampleMetadata *exampleMetadata); + +#define QUICK_EXPORT FOUNDATION_EXPORT + +QUICK_EXPORT void qck_beforeSuite(QCKDSLEmptyBlock closure); +QUICK_EXPORT void qck_afterSuite(QCKDSLEmptyBlock closure); +QUICK_EXPORT void qck_sharedExamples(NSString *name, QCKDSLSharedExampleBlock closure); +QUICK_EXPORT void qck_describe(NSString *description, QCKDSLEmptyBlock closure); +QUICK_EXPORT void qck_context(NSString *description, QCKDSLEmptyBlock closure); +QUICK_EXPORT void qck_beforeEach(QCKDSLEmptyBlock closure); +QUICK_EXPORT void qck_beforeEachWithMetadata(QCKDSLExampleMetadataBlock closure); +QUICK_EXPORT void qck_afterEach(QCKDSLEmptyBlock closure); +QUICK_EXPORT void qck_afterEachWithMetadata(QCKDSLExampleMetadataBlock closure); +QUICK_EXPORT void qck_pending(NSString *description, QCKDSLEmptyBlock closure); +QUICK_EXPORT void qck_xdescribe(NSString *description, QCKDSLEmptyBlock closure); +QUICK_EXPORT void qck_xcontext(NSString *description, QCKDSLEmptyBlock closure); +QUICK_EXPORT void qck_fdescribe(NSString *description, QCKDSLEmptyBlock closure); +QUICK_EXPORT void qck_fcontext(NSString *description, QCKDSLEmptyBlock closure); + +#ifndef QUICK_DISABLE_SHORT_SYNTAX +/** + Defines a closure to be run prior to any examples in the test suite. + You may define an unlimited number of these closures, but there is no + guarantee as to the order in which they're run. + + If the test suite crashes before the first example is run, this closure + will not be executed. + + @param closure The closure to be run prior to any examples in the test suite. + */ +static inline void beforeSuite(QCKDSLEmptyBlock closure) { + qck_beforeSuite(closure); +} + + +/** + Defines a closure to be run after all of the examples in the test suite. + You may define an unlimited number of these closures, but there is no + guarantee as to the order in which they're run. + + If the test suite crashes before all examples are run, this closure + will not be executed. + + @param closure The closure to be run after all of the examples in the test suite. + */ +static inline void afterSuite(QCKDSLEmptyBlock closure) { + qck_afterSuite(closure); +} + +/** + Defines a group of shared examples. These examples can be re-used in several locations + by using the `itBehavesLike` function. + + @param name The name of the shared example group. This must be unique across all shared example + groups defined in a test suite. + @param closure A closure containing the examples. This behaves just like an example group defined + using `describe` or `context`--the closure may contain any number of `beforeEach` + and `afterEach` closures, as well as any number of examples (defined using `it`). + */ +static inline void sharedExamples(NSString *name, QCKDSLSharedExampleBlock closure) { + qck_sharedExamples(name, closure); +} + +/** + Defines an example group. Example groups are logical groupings of examples. + Example groups can share setup and teardown code. + + @param description An arbitrary string describing the example group. + @param closure A closure that can contain other examples. + */ +static inline void describe(NSString *description, QCKDSLEmptyBlock closure) { + qck_describe(description, closure); +} + +/** + Defines an example group. Equivalent to `describe`. + */ +static inline void context(NSString *description, QCKDSLEmptyBlock closure) { + qck_context(description, closure); +} + +/** + Defines a closure to be run prior to each example in the current example + group. This closure is not run for pending or otherwise disabled examples. + An example group may contain an unlimited number of beforeEach. They'll be + run in the order they're defined, but you shouldn't rely on that behavior. + + @param closure The closure to be run prior to each example. + */ +static inline void beforeEach(QCKDSLEmptyBlock closure) { + qck_beforeEach(closure); +} + +/** + Identical to QCKDSL.beforeEach, except the closure is provided with + metadata on the example that the closure is being run prior to. + */ +static inline void beforeEachWithMetadata(QCKDSLExampleMetadataBlock closure) { + qck_beforeEachWithMetadata(closure); +} + +/** + Defines a closure to be run after each example in the current example + group. This closure is not run for pending or otherwise disabled examples. + An example group may contain an unlimited number of afterEach. They'll be + run in the order they're defined, but you shouldn't rely on that behavior. + + @param closure The closure to be run after each example. + */ +static inline void afterEach(QCKDSLEmptyBlock closure) { + qck_afterEach(closure); +} + +/** + Identical to QCKDSL.afterEach, except the closure is provided with + metadata on the example that the closure is being run after. + */ +static inline void afterEachWithMetadata(QCKDSLExampleMetadataBlock closure) { + qck_afterEachWithMetadata(closure); +} + +/** + Defines an example or example group that should not be executed. Use `pending` to temporarily disable + examples or groups that should not be run yet. + + @param description An arbitrary string describing the example or example group. + @param closure A closure that will not be evaluated. + */ +static inline void pending(NSString *description, QCKDSLEmptyBlock closure) { + qck_pending(description, closure); +} + +/** + Use this to quickly mark a `describe` block as pending. + This disables all examples within the block. + */ +static inline void xdescribe(NSString *description, QCKDSLEmptyBlock closure) { + qck_xdescribe(description, closure); +} + +/** + Use this to quickly mark a `context` block as pending. + This disables all examples within the block. + */ +static inline void xcontext(NSString *description, QCKDSLEmptyBlock closure) { + qck_xcontext(description, closure); +} + +/** + Use this to quickly focus a `describe` block, focusing the examples in the block. + If any examples in the test suite are focused, only those examples are executed. + This trumps any explicitly focused or unfocused examples within the block--they are all treated as focused. + */ +static inline void fdescribe(NSString *description, QCKDSLEmptyBlock closure) { + qck_fdescribe(description, closure); +} + +/** + Use this to quickly focus a `context` block. Equivalent to `fdescribe`. + */ +static inline void fcontext(NSString *description, QCKDSLEmptyBlock closure) { + qck_fcontext(description, closure); +} + +#define it qck_it +#define xit qck_xit +#define fit qck_fit +#define itBehavesLike qck_itBehavesLike +#define xitBehavesLike qck_xitBehavesLike +#define fitBehavesLike qck_fitBehavesLike +#endif + +#define qck_it qck_it_builder(@{}, @(__FILE__), __LINE__) +#define qck_xit qck_it_builder(@{Filter.pending: @YES}, @(__FILE__), __LINE__) +#define qck_fit qck_it_builder(@{Filter.focused: @YES}, @(__FILE__), __LINE__) +#define qck_itBehavesLike qck_itBehavesLike_builder(@{}, @(__FILE__), __LINE__) +#define qck_xitBehavesLike qck_itBehavesLike_builder(@{Filter.pending: @YES}, @(__FILE__), __LINE__) +#define qck_fitBehavesLike qck_itBehavesLike_builder(@{Filter.focused: @YES}, @(__FILE__), __LINE__) + +typedef void (^QCKItBlock)(NSString *description, QCKDSLEmptyBlock closure); +typedef void (^QCKItBehavesLikeBlock)(NSString *description, QCKDSLSharedExampleContext context); + +QUICK_EXPORT QCKItBlock qck_it_builder(NSDictionary *flags, NSString *file, NSUInteger line); +QUICK_EXPORT QCKItBehavesLikeBlock qck_itBehavesLike_builder(NSDictionary *flags, NSString *file, NSUInteger line); diff --git a/Example/Pods/Quick/Sources/QuickObjectiveC/DSL/QCKDSL.m b/Example/Pods/Quick/Sources/QuickObjectiveC/DSL/QCKDSL.m new file mode 100644 index 0000000..624832e --- /dev/null +++ b/Example/Pods/Quick/Sources/QuickObjectiveC/DSL/QCKDSL.m @@ -0,0 +1,83 @@ +#import "QCKDSL.h" + +#if __has_include("Quick-Swift.h") +#import "Quick-Swift.h" +#else +#import +#endif + +void qck_beforeSuite(QCKDSLEmptyBlock closure) { + [[World sharedWorld] beforeSuite:closure]; +} + +void qck_afterSuite(QCKDSLEmptyBlock closure) { + [[World sharedWorld] afterSuite:closure]; +} + +void qck_sharedExamples(NSString *name, QCKDSLSharedExampleBlock closure) { + [[World sharedWorld] sharedExamples:name closure:closure]; +} + +void qck_describe(NSString *description, QCKDSLEmptyBlock closure) { + [[World sharedWorld] describe:description flags:@{} closure:closure]; +} + +void qck_context(NSString *description, QCKDSLEmptyBlock closure) { + qck_describe(description, closure); +} + +void qck_beforeEach(QCKDSLEmptyBlock closure) { + [[World sharedWorld] beforeEach:closure]; +} + +void qck_beforeEachWithMetadata(QCKDSLExampleMetadataBlock closure) { + [[World sharedWorld] beforeEachWithMetadata:closure]; +} + +void qck_afterEach(QCKDSLEmptyBlock closure) { + [[World sharedWorld] afterEach:closure]; +} + +void qck_afterEachWithMetadata(QCKDSLExampleMetadataBlock closure) { + [[World sharedWorld] afterEachWithMetadata:closure]; +} + +QCKItBlock qck_it_builder(NSDictionary *flags, NSString *file, NSUInteger line) { + return ^(NSString *description, QCKDSLEmptyBlock closure) { + [[World sharedWorld] itWithDescription:description + flags:flags + file:file + line:line + closure:closure]; + }; +} + +QCKItBehavesLikeBlock qck_itBehavesLike_builder(NSDictionary *flags, NSString *file, NSUInteger line) { + return ^(NSString *name, QCKDSLSharedExampleContext context) { + [[World sharedWorld] itBehavesLikeSharedExampleNamed:name + sharedExampleContext:context + flags:flags + file:file + line:line]; + }; +} + +void qck_pending(NSString *description, QCKDSLEmptyBlock closure) { + [[World sharedWorld] pending:description closure:closure]; +} + +void qck_xdescribe(NSString *description, QCKDSLEmptyBlock closure) { + [[World sharedWorld] xdescribe:description flags:@{} closure:closure]; +} + +void qck_xcontext(NSString *description, QCKDSLEmptyBlock closure) { + qck_xdescribe(description, closure); +} + +void qck_fdescribe(NSString *description, QCKDSLEmptyBlock closure) { + [[World sharedWorld] fdescribe:description flags:@{} closure:closure]; +} + +void qck_fcontext(NSString *description, QCKDSLEmptyBlock closure) { + qck_fdescribe(description, closure); +} diff --git a/Example/Pods/Target Support Files/Quick/Quick-umbrella.h b/Example/Pods/Quick/Sources/QuickObjectiveC/Quick.h similarity index 62% rename from Example/Pods/Target Support Files/Quick/Quick-umbrella.h rename to Example/Pods/Quick/Sources/QuickObjectiveC/Quick.h index c1aab14..87dad10 100644 --- a/Example/Pods/Target Support Files/Quick/Quick-umbrella.h +++ b/Example/Pods/Quick/Sources/QuickObjectiveC/Quick.h @@ -1,10 +1,11 @@ -#import - -#import "QuickConfiguration.h" -#import "QCKDSL.h" -#import "Quick.h" -#import "QuickSpec.h" +#import +//! Project version number for Quick. FOUNDATION_EXPORT double QuickVersionNumber; + +//! Project version string for Quick. FOUNDATION_EXPORT const unsigned char QuickVersionString[]; +#import "QuickSpec.h" +#import "QCKDSL.h" +#import "QuickConfiguration.h" diff --git a/Example/Pods/Quick/Sources/QuickObjectiveC/QuickSpec.h b/Example/Pods/Quick/Sources/QuickObjectiveC/QuickSpec.h new file mode 100644 index 0000000..ccf006e --- /dev/null +++ b/Example/Pods/Quick/Sources/QuickObjectiveC/QuickSpec.h @@ -0,0 +1,56 @@ +#import + +/** + QuickSpec is a base class all specs written in Quick inherit from. + They need to inherit from QuickSpec, a subclass of XCTestCase, in + order to be discovered by the XCTest framework. + + XCTest automatically compiles a list of XCTestCase subclasses included + in the test target. It iterates over each class in that list, and creates + a new instance of that class for each test method. It then creates an + "invocation" to execute that test method. The invocation is an instance of + NSInvocation, which represents a single message send in Objective-C. + The invocation is set on the XCTestCase instance, and the test is run. + + Most of the code in QuickSpec is dedicated to hooking into XCTest events. + First, when the spec is first loaded and before it is sent any messages, + the +[NSObject initialize] method is called. QuickSpec overrides this method + to call +[QuickSpec spec]. This builds the example group stacks and + registers them with Quick.World, a global register of examples. + + Then, XCTest queries QuickSpec for a list of test methods. Normally, XCTest + automatically finds all methods whose selectors begin with the string "test". + However, QuickSpec overrides this default behavior by implementing the + +[XCTestCase testInvocations] method. This method iterates over each example + registered in Quick.World, defines a new method for that example, and + returns an invocation to call that method to XCTest. Those invocations are + the tests that are run by XCTest. Their selector names are displayed in + the Xcode test navigation bar. + */ +@interface QuickSpec : XCTestCase + +/** + Override this method in your spec to define a set of example groups + and examples. + + @code + override func spec() { + describe("winter") { + it("is coming") { + // ... + } + } + } + @endcode + + See DSL.swift for more information on what syntax is available. + */ +- (void)spec; + +/** + Returns the currently executing spec. Use in specs that require XCTestCase + methods, e.g. expectationWithDescription. +*/ +@property (class, nonatomic, readonly) QuickSpec *current; + +@end diff --git a/Example/Pods/Quick/Sources/QuickObjectiveC/QuickSpec.m b/Example/Pods/Quick/Sources/QuickObjectiveC/QuickSpec.m new file mode 100644 index 0000000..ed70d35 --- /dev/null +++ b/Example/Pods/Quick/Sources/QuickObjectiveC/QuickSpec.m @@ -0,0 +1,149 @@ +#import "QuickSpec.h" +#import "QuickConfiguration.h" + +#if __has_include("Quick-Swift.h") +#import "Quick-Swift.h" +#else +#import +#endif + +static QuickSpec *currentSpec = nil; + +@interface QuickSpec () +@property (nonatomic, strong) Example *example; +@end + +@implementation QuickSpec + +#pragma mark - XCTestCase Overrides + +/** + The runtime sends initialize to each class in a program just before the class, or any class + that inherits from it, is sent its first message from within the program. QuickSpec hooks into + this event to compile the example groups for this spec subclass. + + If an exception occurs when compiling the examples, report it to the user. Chances are they + included an expectation outside of a "it", "describe", or "context" block. + */ ++ (void)initialize { + [QuickConfiguration initialize]; + + World *world = [World sharedWorld]; + [world performWithCurrentExampleGroup:[world rootExampleGroupForSpecClass:self] closure:^{ + QuickSpec *spec = [self new]; + + @try { + [spec spec]; + } + @catch (NSException *exception) { + [NSException raise:NSInternalInconsistencyException + format:@"An exception occurred when building Quick's example groups.\n" + @"Some possible reasons this might happen include:\n\n" + @"- An 'expect(...).to' expectation was evaluated outside of " + @"an 'it', 'context', or 'describe' block\n" + @"- 'sharedExamples' was called twice with the same name\n" + @"- 'itBehavesLike' was called with a name that is not registered as a shared example\n\n" + @"Here's the original exception: '%@', reason: '%@', userInfo: '%@'", + exception.name, exception.reason, exception.userInfo]; + } + [self testInvocations]; + }]; +} + +/** + Invocations for each test method in the test case. QuickSpec overrides this method to define a + new method for each example defined in +[QuickSpec spec]. + + @return An array of invocations that execute the newly defined example methods. + */ ++ (NSArray *)testInvocations { + NSArray *examples = [[World sharedWorld] examplesForSpecClass:[self class]]; + NSMutableArray *invocations = [NSMutableArray arrayWithCapacity:[examples count]]; + + NSMutableSet *selectorNames = [NSMutableSet set]; + + for (Example *example in examples) { + SEL selector = [self addInstanceMethodForExample:example classSelectorNames:selectorNames]; + + NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector]; + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; + invocation.selector = selector; + + [invocations addObject:invocation]; + } + + return invocations; +} + +#pragma mark - Public Interface + +- (void)spec { } + ++ (QuickSpec*) current { + return currentSpec; +} + +#pragma mark - Internal Methods + +/** + QuickSpec uses this method to dynamically define a new instance method for the + given example. The instance method runs the example, catching any exceptions. + The exceptions are then reported as test failures. + + In order to report the correct file and line number, examples must raise exceptions + containing following keys in their userInfo: + + - "SenTestFilenameKey": A String representing the file name + - "SenTestLineNumberKey": An Int representing the line number + + These keys used to be used by SenTestingKit, and are still used by some testing tools + in the wild. See: https://github.com/Quick/Quick/pull/41 + + @return The selector of the newly defined instance method. + */ ++ (SEL)addInstanceMethodForExample:(Example *)example classSelectorNames:(NSMutableSet *)selectorNames { + IMP implementation = imp_implementationWithBlock(^(QuickSpec *self){ + self.example = example; + currentSpec = self; + [example run]; + }); + + const char *types = [[NSString stringWithFormat:@"%s%s%s", @encode(void), @encode(id), @encode(SEL)] UTF8String]; + + NSString *originalName = [QCKObjCStringUtils c99ExtendedIdentifierFrom:example.name]; + NSString *selectorName = originalName; + NSUInteger i = 2; + + while ([selectorNames containsObject:selectorName]) { + selectorName = [NSString stringWithFormat:@"%@_%tu", originalName, i++]; + } + + [selectorNames addObject:selectorName]; + + SEL selector = NSSelectorFromString(selectorName); + class_addMethod(self, selector, implementation, types); + + return selector; +} + +/** + This method is used to record failures, whether they represent example + expectations that were not met, or exceptions raised during test setup + and teardown. By default, the failure will be reported as an + XCTest failure, and the example will be highlighted in Xcode. + */ +- (void)recordFailureWithDescription:(NSString *)description + inFile:(NSString *)filePath + atLine:(NSUInteger)lineNumber + expected:(BOOL)expected { + if (self.example.isSharedExample) { + filePath = self.example.callsite.file; + lineNumber = self.example.callsite.line; + } + [currentSpec.testRun recordFailureWithDescription:description + inFile:filePath + atLine:lineNumber + expected:expected]; +} + +@end diff --git a/Example/Pods/Quick/Sources/QuickObjectiveC/XCTestSuite+QuickTestSuiteBuilder.m b/Example/Pods/Quick/Sources/QuickObjectiveC/XCTestSuite+QuickTestSuiteBuilder.m new file mode 100644 index 0000000..ae63036 --- /dev/null +++ b/Example/Pods/Quick/Sources/QuickObjectiveC/XCTestSuite+QuickTestSuiteBuilder.m @@ -0,0 +1,45 @@ +#import +#import + +#if __has_include("Quick-Swift.h") +#import "Quick-Swift.h" +#else +#import +#endif + +@interface XCTestSuite (QuickTestSuiteBuilder) +@end + +@implementation XCTestSuite (QuickTestSuiteBuilder) + +/** + In order to ensure we can correctly build dynamic test suites, we need to + replace some of the default test suite constructors. + */ ++ (void)load { + Method testCaseWithName = class_getClassMethod(self, @selector(testSuiteForTestCaseWithName:)); + Method hooked_testCaseWithName = class_getClassMethod(self, @selector(qck_hooked_testSuiteForTestCaseWithName:)); + method_exchangeImplementations(testCaseWithName, hooked_testCaseWithName); +} + +/** + The `+testSuiteForTestCaseWithName:` method is called when a specific test case + class is run from the Xcode test navigator. If the built test suite is `nil`, + Xcode will not run any tests for that test case. + + Given if the following test case class is run from the Xcode test navigator: + + FooSpec + testFoo + testBar + + XCTest will invoke this once per test case, with test case names following this format: + + FooSpec/testFoo + FooSpec/testBar + */ ++ (nullable instancetype)qck_hooked_testSuiteForTestCaseWithName:(nonnull NSString *)name { + return [QuickTestSuite selectedTestSuiteForTestCaseWithName:name]; +} + +@end diff --git a/Example/Pods/Quick/Sources/QuickSpecBase/QuickSpecBase.m b/Example/Pods/Quick/Sources/QuickSpecBase/QuickSpecBase.m new file mode 100644 index 0000000..10b6f7e --- /dev/null +++ b/Example/Pods/Quick/Sources/QuickSpecBase/QuickSpecBase.m @@ -0,0 +1,55 @@ +#import "QuickSpecBase.h" + +#pragma mark - _QuickSelectorWrapper + +@interface _QuickSelectorWrapper () +@property(nonatomic, assign) SEL selector; +@end + +@implementation _QuickSelectorWrapper + +- (instancetype)initWithSelector:(SEL)selector { + self = [super init]; + _selector = selector; + return self; +} + +@end + + +#pragma mark - _QuickSpecBase + +@implementation _QuickSpecBase + +- (instancetype)init { + self = [super initWithInvocation: nil]; + return self; +} + +/** + Invocations for each test method in the test case. QuickSpec overrides this method to define a + new method for each example defined in +[QuickSpec spec]. + + @return An array of invocations that execute the newly defined example methods. + */ ++ (NSArray *)testInvocations { + NSArray<_QuickSelectorWrapper *> *wrappers = [self _qck_testMethodSelectors]; + NSMutableArray *invocations = [NSMutableArray arrayWithCapacity:wrappers.count]; + + for (_QuickSelectorWrapper *wrapper in wrappers) { + SEL selector = wrapper.selector; + NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector]; + NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; + invocation.selector = selector; + + [invocations addObject:invocation]; + } + + return invocations; +} + ++ (NSArray<_QuickSelectorWrapper *> *)_qck_testMethodSelectors { + return @[]; +} + +@end diff --git a/Example/Pods/Quick/Sources/QuickSpecBase/include/QuickSpecBase.h b/Example/Pods/Quick/Sources/QuickSpecBase/include/QuickSpecBase.h new file mode 100644 index 0000000..8881ca0 --- /dev/null +++ b/Example/Pods/Quick/Sources/QuickSpecBase/include/QuickSpecBase.h @@ -0,0 +1,11 @@ +#import +#import + +@interface _QuickSelectorWrapper : NSObject +- (instancetype)initWithSelector:(SEL)selector; +@end + +@interface _QuickSpecBase : XCTestCase ++ (NSArray<_QuickSelectorWrapper *> *)_qck_testMethodSelectors; +- (instancetype)init NS_DESIGNATED_INITIALIZER; +@end diff --git a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-Info.plist b/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-Info.plist new file mode 100644 index 0000000..2660a93 --- /dev/null +++ b/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.4 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-dummy.m b/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-dummy.m deleted file mode 100644 index 6a6800f..0000000 --- a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_HealthKitSampleGenerator : NSObject -@end -@implementation PodsDummy_HealthKitSampleGenerator -@end diff --git a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-prefix.pch b/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-prefix.pch deleted file mode 100644 index aa992a4..0000000 --- a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-prefix.pch +++ /dev/null @@ -1,4 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - diff --git a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-umbrella.h b/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-umbrella.h deleted file mode 100644 index 99ffbab..0000000 --- a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator-umbrella.h +++ /dev/null @@ -1,6 +0,0 @@ -#import - - -FOUNDATION_EXPORT double HealthKitSampleGeneratorVersionNumber; -FOUNDATION_EXPORT const unsigned char HealthKitSampleGeneratorVersionString[]; - diff --git a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator.modulemap b/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator.modulemap deleted file mode 100644 index d72e790..0000000 --- a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module HealthKitSampleGenerator { - umbrella header "HealthKitSampleGenerator-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator.xcconfig b/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator.xcconfig deleted file mode 100644 index 5373e2d..0000000 --- a/Example/Pods/Target Support Files/HealthKitSampleGenerator/HealthKitSampleGenerator.xcconfig +++ /dev/null @@ -1,5 +0,0 @@ -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/HealthKitSampleGenerator" "${PODS_ROOT}/Headers/Public" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_ROOT = ${SRCROOT} -SKIP_INSTALL = YES \ No newline at end of file diff --git a/Example/Pods/Target Support Files/HealthKitSampleGenerator/Info.plist b/Example/Pods/Target Support Files/HealthKitSampleGenerator/Info.plist deleted file mode 100644 index 3a2dd09..0000000 --- a/Example/Pods/Target Support Files/HealthKitSampleGenerator/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 0.2.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/HealthKitSampleGenerator/ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-Info.plist b/Example/Pods/Target Support Files/HealthKitSampleGenerator/ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-Info.plist new file mode 100644 index 0000000..13e21f1 --- /dev/null +++ b/Example/Pods/Target Support Files/HealthKitSampleGenerator/ResourceBundle-HealthKitSampleGenerator-HealthKitSampleGenerator-Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0.4 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Nimble/Info.plist b/Example/Pods/Target Support Files/Nimble/Info.plist deleted file mode 100644 index 8d72d5a..0000000 --- a/Example/Pods/Target Support Files/Nimble/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 2.0.0-rc.3 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/Nimble/Nimble-dummy.m b/Example/Pods/Target Support Files/Nimble/Nimble-dummy.m deleted file mode 100644 index e8177ab..0000000 --- a/Example/Pods/Target Support Files/Nimble/Nimble-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Nimble : NSObject -@end -@implementation PodsDummy_Nimble -@end diff --git a/Example/Pods/Target Support Files/Nimble/Nimble-prefix.pch b/Example/Pods/Target Support Files/Nimble/Nimble-prefix.pch deleted file mode 100644 index aa992a4..0000000 --- a/Example/Pods/Target Support Files/Nimble/Nimble-prefix.pch +++ /dev/null @@ -1,4 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - diff --git a/Example/Pods/Target Support Files/Nimble/Nimble-umbrella.h b/Example/Pods/Target Support Files/Nimble/Nimble-umbrella.h deleted file mode 100644 index 5e5b5c8..0000000 --- a/Example/Pods/Target Support Files/Nimble/Nimble-umbrella.h +++ /dev/null @@ -1,9 +0,0 @@ -#import - -#import "Nimble.h" -#import "DSL.h" -#import "NMBExceptionCapture.h" - -FOUNDATION_EXPORT double NimbleVersionNumber; -FOUNDATION_EXPORT const unsigned char NimbleVersionString[]; - diff --git a/Example/Pods/Target Support Files/Nimble/Nimble.modulemap b/Example/Pods/Target Support Files/Nimble/Nimble.modulemap deleted file mode 100644 index 6f77009..0000000 --- a/Example/Pods/Target Support Files/Nimble/Nimble.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Nimble { - umbrella header "Nimble-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/Nimble/Nimble.xcconfig b/Example/Pods/Target Support Files/Nimble/Nimble.xcconfig deleted file mode 100644 index 5711d87..0000000 --- a/Example/Pods/Target Support Files/Nimble/Nimble.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -ENABLE_BITCODE = NO -FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Nimble" "${PODS_ROOT}/Headers/Public" -OTHER_LDFLAGS = -framework "XCTest" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_ROOT = ${SRCROOT} -SKIP_INSTALL = YES \ No newline at end of file diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Info.plist b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Info.plist deleted file mode 100644 index 11db4b7..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-Info.plist b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-acknowledgements.markdown deleted file mode 100644 index db35449..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-acknowledgements.markdown +++ /dev/null @@ -1,26 +0,0 @@ -# Acknowledgements -This application makes use of the following third party libraries: - -## HealthKitSampleGenerator - -Copyright (c) 2015 Michael Seemann - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -Generated by CocoaPods - http://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-acknowledgements.plist deleted file mode 100644 index cb87d38..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-acknowledgements.plist +++ /dev/null @@ -1,56 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2015 Michael Seemann <seemann@mseemann.de> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - Title - HealthKitSampleGenerator - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - http://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-dummy.m b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-dummy.m deleted file mode 100644 index 041ca1f..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_HealthKitSampleGenerator_Example : NSObject -@end -@implementation PodsDummy_Pods_HealthKitSampleGenerator_Example -@end diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-frameworks.sh b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-frameworks.sh deleted file mode 100755 index eca9871..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-frameworks.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -set -e - -echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" -mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" - -install_framework() -{ - if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then - local source="${BUILT_PRODUCTS_DIR}/$1" - elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then - local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" - elif [ -r "$1" ]; then - local source="$1" - fi - - local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - - if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" - fi - - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" - - local basename - basename="$(basename -s .framework "$1")" - binary="${destination}/${basename}.framework/${basename}" - if ! [ -r "$binary" ]; then - binary="${destination}/${basename}" - fi - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then - strip_invalid_archs "$binary" - fi - - # Resign the code if required by the build settings to avoid unstable apps - code_sign_if_enabled "${destination}/$(basename "$1")" - - # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. - if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then - local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) - for lib in $swift_runtime_libs; do - echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" - rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" - code_sign_if_enabled "${destination}/${lib}" - done - fi -} - -# Signs a framework with the provided identity -code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identitiy - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" - fi -} - -# Strip invalid architectures -strip_invalid_archs() { - binary="$1" - # Get architectures for current file - archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" - stripped="" - for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" || exit 1 - stripped="$stripped $arch" - fi - done - if [[ "$stripped" ]]; then - echo "Stripped $binary of architectures:$stripped" - fi -} - - -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "Pods-HealthKitSampleGenerator_Example/HealthKitSampleGenerator.framework" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "Pods-HealthKitSampleGenerator_Example/HealthKitSampleGenerator.framework" -fi diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-resources.sh b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-resources.sh deleted file mode 100755 index 16774fb..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-resources.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES=() - -realpath() { - DIRECTORY="$(cd "${1%/*}" && pwd)" - FILENAME="${1##*/}" - echo "$DIRECTORY/$FILENAME" -} - -install_resource() -{ - case $1 in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.framework) - echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" - xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") - XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") - ;; - /*) - echo "$1" - echo "$1" >> "$RESOURCES_TO_COPY" - ;; - *) - echo "${PODS_ROOT}/$1" - echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then - mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] -then - case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; - esac - - # Find all other xcassets (this unfortunately includes those of path pods and other targets). - OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) - while read line; do - if [[ $line != "`realpath $PODS_ROOT`*" ]]; then - XCASSET_FILES+=("$line") - fi - done <<<"$OTHER_XCASSETS" - - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-umbrella.h b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-umbrella.h deleted file mode 100644 index bb3dae5..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example-umbrella.h +++ /dev/null @@ -1,6 +0,0 @@ -#import - - -FOUNDATION_EXPORT double Pods_HealthKitSampleGenerator_ExampleVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_HealthKitSampleGenerator_ExampleVersionString[]; - diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.debug.xcconfig b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.debug.xcconfig deleted file mode 100644 index a40c53b..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.debug.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/HealthKitSampleGenerator.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "HealthKitSampleGenerator" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-HealthKitSampleGenerator_Example -PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.modulemap b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.modulemap deleted file mode 100644 index d9be6bf..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Pods_HealthKitSampleGenerator_Example { - umbrella header "Pods-HealthKitSampleGenerator_Example-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.release.xcconfig b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.release.xcconfig deleted file mode 100644 index a40c53b..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Example/Pods-HealthKitSampleGenerator_Example.release.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/HealthKitSampleGenerator.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "HealthKitSampleGenerator" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-HealthKitSampleGenerator_Example -PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Info.plist b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Info.plist deleted file mode 100644 index 11db4b7..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-Info.plist b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-acknowledgements.markdown index 566494d..fe28799 100644 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-acknowledgements.markdown +++ b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-acknowledgements.markdown @@ -214,7 +214,7 @@ Apache License same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2014 Quick Team + Copyright 2016 Quick Team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -433,4 +433,4 @@ Apache License See the License for the specific language governing permissions and limitations under the License. -Generated by CocoaPods - http://cocoapods.org +Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-acknowledgements.plist deleted file mode 100644 index a1627f6..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-acknowledgements.plist +++ /dev/null @@ -1,474 +0,0 @@ - - - - - PreferenceSpecifiers - - - FooterText - This application makes use of the following third party libraries: - Title - Acknowledgements - Type - PSGroupSpecifier - - - FooterText - Copyright (c) 2015 Michael Seemann <seemann@mseemann.de> - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - Title - HealthKitSampleGenerator - Type - PSGroupSpecifier - - - FooterText - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2014 Quick Team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - Title - Nimble - Type - PSGroupSpecifier - - - FooterText - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2014, Quick Team - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - Title - Quick - Type - PSGroupSpecifier - - - FooterText - Generated by CocoaPods - http://cocoapods.org - Title - - Type - PSGroupSpecifier - - - StringsTable - Acknowledgements - Title - Acknowledgements - - diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-dummy.m b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-dummy.m deleted file mode 100644 index 21a5fdd..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Pods_HealthKitSampleGenerator_Tests : NSObject -@end -@implementation PodsDummy_Pods_HealthKitSampleGenerator_Tests -@end diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-frameworks.sh b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-frameworks.sh deleted file mode 100755 index c3d49ed..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-frameworks.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh -set -e - -echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" -mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - -SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" - -install_framework() -{ - if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then - local source="${BUILT_PRODUCTS_DIR}/$1" - elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then - local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" - elif [ -r "$1" ]; then - local source="$1" - fi - - local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - - if [ -L "${source}" ]; then - echo "Symlinked..." - source="$(readlink "${source}")" - fi - - # use filter instead of exclude so missing patterns dont' throw errors - echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" - rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" - - local basename - basename="$(basename -s .framework "$1")" - binary="${destination}/${basename}.framework/${basename}" - if ! [ -r "$binary" ]; then - binary="${destination}/${basename}" - fi - - # Strip invalid architectures so "fat" simulator / device frameworks work on device - if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then - strip_invalid_archs "$binary" - fi - - # Resign the code if required by the build settings to avoid unstable apps - code_sign_if_enabled "${destination}/$(basename "$1")" - - # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. - if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then - local swift_runtime_libs - swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) - for lib in $swift_runtime_libs; do - echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" - rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" - code_sign_if_enabled "${destination}/${lib}" - done - fi -} - -# Signs a framework with the provided identity -code_sign_if_enabled() { - if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then - # Use the current code_sign_identitiy - echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" - echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" - /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" - fi -} - -# Strip invalid architectures -strip_invalid_archs() { - binary="$1" - # Get architectures for current file - archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" - stripped="" - for arch in $archs; do - if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then - # Strip non-valid architectures in-place - lipo -remove "$arch" -output "$binary" "$binary" || exit 1 - stripped="$stripped $arch" - fi - done - if [[ "$stripped" ]]; then - echo "Stripped $binary of architectures:$stripped" - fi -} - - -if [[ "$CONFIGURATION" == "Debug" ]]; then - install_framework "Pods-HealthKitSampleGenerator_Tests/HealthKitSampleGenerator.framework" - install_framework "Pods-HealthKitSampleGenerator_Tests/Nimble.framework" - install_framework "Pods-HealthKitSampleGenerator_Tests/Quick.framework" -fi -if [[ "$CONFIGURATION" == "Release" ]]; then - install_framework "Pods-HealthKitSampleGenerator_Tests/HealthKitSampleGenerator.framework" - install_framework "Pods-HealthKitSampleGenerator_Tests/Nimble.framework" - install_framework "Pods-HealthKitSampleGenerator_Tests/Quick.framework" -fi diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-resources.sh b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-resources.sh deleted file mode 100755 index 16774fb..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-resources.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh -set -e - -mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - -RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt -> "$RESOURCES_TO_COPY" - -XCASSET_FILES=() - -realpath() { - DIRECTORY="$(cd "${1%/*}" && pwd)" - FILENAME="${1##*/}" - echo "$DIRECTORY/$FILENAME" -} - -install_resource() -{ - case $1 in - *.storyboard) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.xib) - echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" - ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" - ;; - *.framework) - echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" - ;; - *.xcdatamodel) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" - ;; - *.xcdatamodeld) - echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" - xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" - ;; - *.xcmappingmodel) - echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" - xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" - ;; - *.xcassets) - ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") - XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") - ;; - /*) - echo "$1" - echo "$1" >> "$RESOURCES_TO_COPY" - ;; - *) - echo "${PODS_ROOT}/$1" - echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" - ;; - esac -} - -mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then - mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" - rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi -rm -f "$RESOURCES_TO_COPY" - -if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] -then - case "${TARGETED_DEVICE_FAMILY}" in - 1,2) - TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" - ;; - 1) - TARGET_DEVICE_ARGS="--target-device iphone" - ;; - 2) - TARGET_DEVICE_ARGS="--target-device ipad" - ;; - *) - TARGET_DEVICE_ARGS="--target-device mac" - ;; - esac - - # Find all other xcassets (this unfortunately includes those of path pods and other targets). - OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) - while read line; do - if [[ $line != "`realpath $PODS_ROOT`*" ]]; then - XCASSET_FILES+=("$line") - fi - done <<<"$OTHER_XCASSETS" - - printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" -fi diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-umbrella.h b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-umbrella.h deleted file mode 100644 index 5e968af..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests-umbrella.h +++ /dev/null @@ -1,6 +0,0 @@ -#import - - -FOUNDATION_EXPORT double Pods_HealthKitSampleGenerator_TestsVersionNumber; -FOUNDATION_EXPORT const unsigned char Pods_HealthKitSampleGenerator_TestsVersionString[]; - diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.debug.xcconfig b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.debug.xcconfig deleted file mode 100644 index 5fa1201..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.debug.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/HealthKitSampleGenerator.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Nimble.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Quick.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "HealthKitSampleGenerator" -framework "Nimble" -framework "Quick" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-HealthKitSampleGenerator_Tests -PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.modulemap b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.modulemap deleted file mode 100644 index b1752f0..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Pods_HealthKitSampleGenerator_Tests { - umbrella header "Pods-HealthKitSampleGenerator_Tests-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.release.xcconfig b/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.release.xcconfig deleted file mode 100644 index 5fa1201..0000000 --- a/Example/Pods/Target Support Files/Pods-HealthKitSampleGenerator_Tests/Pods-HealthKitSampleGenerator_Tests.release.xcconfig +++ /dev/null @@ -1,8 +0,0 @@ -EMBEDDED_CONTENT_CONTAINS_SWIFT = YES -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' -OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/HealthKitSampleGenerator.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Nimble.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Quick.framework/Headers" -OTHER_LDFLAGS = $(inherited) -framework "HealthKitSampleGenerator" -framework "Nimble" -framework "Quick" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-HealthKitSampleGenerator_Tests -PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Example/Pods/Target Support Files/Quick/Info.plist b/Example/Pods/Target Support Files/Quick/Info.plist deleted file mode 100644 index 0fdf176..0000000 --- a/Example/Pods/Target Support Files/Quick/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - FMWK - CFBundleShortVersionString - 0.6.0 - CFBundleSignature - ???? - CFBundleVersion - ${CURRENT_PROJECT_VERSION} - NSPrincipalClass - - - diff --git a/Example/Pods/Target Support Files/Quick/Quick-dummy.m b/Example/Pods/Target Support Files/Quick/Quick-dummy.m deleted file mode 100644 index 54d7dc0..0000000 --- a/Example/Pods/Target Support Files/Quick/Quick-dummy.m +++ /dev/null @@ -1,5 +0,0 @@ -#import -@interface PodsDummy_Quick : NSObject -@end -@implementation PodsDummy_Quick -@end diff --git a/Example/Pods/Target Support Files/Quick/Quick-prefix.pch b/Example/Pods/Target Support Files/Quick/Quick-prefix.pch deleted file mode 100644 index aa992a4..0000000 --- a/Example/Pods/Target Support Files/Quick/Quick-prefix.pch +++ /dev/null @@ -1,4 +0,0 @@ -#ifdef __OBJC__ -#import -#endif - diff --git a/Example/Pods/Target Support Files/Quick/Quick.modulemap b/Example/Pods/Target Support Files/Quick/Quick.modulemap deleted file mode 100644 index 1d12b21..0000000 --- a/Example/Pods/Target Support Files/Quick/Quick.modulemap +++ /dev/null @@ -1,6 +0,0 @@ -framework module Quick { - umbrella header "Quick-umbrella.h" - - export * - module * { export * } -} diff --git a/Example/Pods/Target Support Files/Quick/Quick.xcconfig b/Example/Pods/Target Support Files/Quick/Quick.xcconfig deleted file mode 100644 index 369a5d4..0000000 --- a/Example/Pods/Target Support Files/Quick/Quick.xcconfig +++ /dev/null @@ -1,7 +0,0 @@ -FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Quick" "${PODS_ROOT}/Headers/Public" -OTHER_LDFLAGS = -framework "XCTest" -OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" -PODS_ROOT = ${SRCROOT} -SKIP_INSTALL = YES \ No newline at end of file diff --git a/Example/Tests/DataExporterTest.swift b/Example/Tests/DataExporterTest.swift index be33e96..9fc23f7 100644 --- a/Example/Tests/DataExporterTest.swift +++ b/Example/Tests/DataExporterTest.swift @@ -1,326 +1,326 @@ +//// +//// DataExporterTest.swift +//// HealthKitSampleGenerator +//// +//// Created by Michael Seemann on 19.10.15. +//// Copyright © 2015 CocoaPods. All rights reserved. +//// // -// DataExporterTest.swift -// HealthKitSampleGenerator +//import XCTest +//import Quick +//import Nimble +//import HealthKit +//@testable import HealthKitSampleGenerator // -// Created by Michael Seemann on 19.10.15. -// Copyright © 2015 CocoaPods. All rights reserved. +//class DataExporterTest: QuickSpec { +// +// let healthStore = HealthKitStoreMock() +// +// let profileName = "testName" // - -import XCTest -import Quick -import Nimble -import HealthKit -@testable import HealthKitSampleGenerator - -class DataExporterTest: QuickSpec { - - let healthStore = HealthKitStoreMock() - - let profileName = "testName" - - - override func spec() { - - var exportConfiguration = HealthDataFullExportConfiguration(profileName: self.profileName, exportType: HealthDataToExportType.ALL) - exportConfiguration.exportUuids = true - - describe("MetaData and UserData Export") { - - it("should make sure the JsonSingleDocInMemExportTarget is always valid"){ - let target = JsonSingleDocInMemExportTarget() - - expect(target.isValid()) == true - } - - it ("should export the meta data") { - - let exporter = MetaDataExporter(exportConfiguration: exportConfiguration) - - let target = JsonSingleDocInMemExportTarget() - target.startExport() - - try! exporter.export(self.healthStore, exportTargets: [target]) - - target.endExport() - - let metaDataDict = JsonReader.toJsonObject(target.getJsonString(), returnDictForKey:HealthKitConstants.META_DATA) - - expect(metaDataDict[HealthKitConstants.CREATION_DATE] as? NSNumber).notTo(beNil()) - expect(metaDataDict[HealthKitConstants.PROFILE_NAME] as? String) == self.profileName - expect(metaDataDict[HealthKitConstants.VERSION] as? String) == "1.0.0" - expect(metaDataDict[HealthKitConstants.TYPE] as? String) == "JsonSingleDocExportTarget" - - } - - it ("should export the user data") { - let exporter = UserDataExporter(exportConfiguration: exportConfiguration) - - let target = JsonSingleDocInMemExportTarget() - target.startExport() - - try! exporter.export(self.healthStore, exportTargets: [target]) - - target.endExport() - - let userDataDict = JsonReader.toJsonObject(target.getJsonString(), returnDictForKey:"userData") - - let dateOfBirth = userDataDict[HealthKitConstants.DATE_OF_BIRTH] as? NSNumber - let biologicalSex = userDataDict[HealthKitConstants.BIOLOGICAL_SEX] as? Int - let bloodType = userDataDict[HealthKitConstants.BLOOD_TYPE] as? Int - let fitzpatrickSkinType = userDataDict[HealthKitConstants.FITZPATRICK_SKIN_TYPE] as? Int - - let date = NSDate(timeIntervalSince1970: (dateOfBirth?.doubleValue)! / 1000.0) - - expect(try! self.healthStore.dateOfBirth()) == date - - expect(biologicalSex) == HKBiologicalSex.Male.rawValue - expect(bloodType) == HKBloodType.APositive.rawValue - expect(fitzpatrickSkinType) == HKFitzpatrickSkinType.I.rawValue - - } - } - - describe("QuantityType Exports") { - - let type = HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBodyMass)! - let strUnit = "kg" - let unit = HKUnit(fromString: strUnit) - - let exporter = QuantityTypeDataExporter(exportConfiguration: exportConfiguration, type: type, unit: unit) - - it("should export quantity data") { - - let target = JsonSingleDocInMemExportTarget() - target.startExport() - - target.startWriteType(type) - - let date = NSDate() - let quantity = HKQuantity(unit: unit, doubleValue: 70) - let sample = HKQuantitySample(type: type, quantity: quantity, startDate: date, endDate: date) - - exporter.writeResults([sample], exportTargets: [target], error: nil) - - target.endWriteType() - - target.endExport() - - let dataArray = JsonReader.toJsonObject(target.getJsonString(), returnArrayForKey:String(HKQuantityTypeIdentifierBodyMass)) - - - expect(dataArray.count) == 1 - - let savedSample = dataArray.first as! Dictionary - - - - let sdate = savedSample[HealthKitConstants.S_DATE] as! NSNumber - let uuid = savedSample[HealthKitConstants.UUID] as! String - let value = savedSample[HealthKitConstants.VALUE] as! NSNumber - let unitValue = savedSample[HealthKitConstants.UNIT] as! String - - expect(sdate).to(beCloseTo(date.timeIntervalSince1970 * 1000, within: 1000)) - expect(uuid).notTo(beNil()) - expect(value) == quantity.doubleValueForUnit(unit) - expect(savedSample[HealthKitConstants.E_DATE]).to(beNil()) - expect(unitValue) == strUnit - - } - - it ("should handle healthkit query errors") { - - exporter.writeResults([], exportTargets: [], error: NSError(domain: "", code: 0, userInfo: [:])) - expect{try exporter.rethrowCollectedErrors()}.to(throwError()) - } - } - - - describe("CategoryTypeDataExporter") { - - let type = HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierAppleStandHour)! - - let exporter = CategoryTypeDataExporter(exportConfiguration: exportConfiguration, type: type) - - it ("should export category types"){ - - let target = JsonSingleDocInMemExportTarget() - target.startExport() - target.startWriteType(type) - - let date = NSDate() - - let sample = HKCategorySample(type: type, value: 1, startDate: date, endDate: date) - - exporter.writeResults([sample], exportTargets: [target], error: nil) - - target.endWriteType() - - target.endExport() - - let dataArray = JsonReader.toJsonObject(target.getJsonString(), returnArrayForKey:String(HKCategoryTypeIdentifierAppleStandHour)) - - expect(dataArray.count) == 1 - - let savedSample = dataArray.first as! Dictionary - - let sdate = savedSample[HealthKitConstants.S_DATE] as! NSNumber - let uuid = savedSample[HealthKitConstants.UUID] as! String - let value = savedSample[HealthKitConstants.VALUE] as! NSNumber - - expect(sdate).to(beCloseTo(date.timeIntervalSince1970 * 1000, within: 1000)) - expect(uuid).notTo(beNil()) - expect(value) == 1 - - expect(savedSample[HealthKitConstants.E_DATE]).to(beNil()) - - } - - - it ("should handle healthkit query errors") { - exporter.writeResults([], exportTargets: [], error: NSError(domain: "", code: 0, userInfo: [:])) - expect{try exporter.rethrowCollectedErrors()}.to(throwError()) - } - } - - describe("CorrelationTypeDataExporter") { - let unit = HKUnit(fromString: "mmHg") - let type1 = HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBloodPressureSystolic)! - let type2 = HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBloodPressureDiastolic)! - - let type = HKObjectType.correlationTypeForIdentifier(HKCorrelationTypeIdentifierBloodPressure)! - let exporter = CorrelationTypeDataExporter(exportConfiguration: exportConfiguration, type: type, typeMap:[type1:unit,type2:unit]) - - it ("should export correlation types") { - - let target = JsonSingleDocInMemExportTarget() - target.startExport() - target.startWriteType(type) - - - let quantity1 = HKQuantity(unit: unit, doubleValue: 80) - let quantity2 = HKQuantity(unit: unit, doubleValue: 120) - - let date = NSDate() - - let samples: [HKSample] = [ - HKQuantitySample(type: type1, quantity: quantity1, startDate: date, endDate: date), - HKQuantitySample(type: type2, quantity: quantity2, startDate: date, endDate: date) - ] - - let correlation = HKCorrelation(type: type, startDate: date, endDate: date, objects: Set(samples)) - - exporter.writeResults([correlation], exportTargets: [target], error: nil) - - target.endWriteType() - - target.endExport() - - let dataArray = JsonReader.toJsonObject(target.getJsonString(), returnArrayForKey:String(HKCorrelationTypeIdentifierBloodPressure)) - - expect(dataArray.count) == 1 - - let savedCorrelation = dataArray.first as! Dictionary - - - let sdate = savedCorrelation[HealthKitConstants.S_DATE] as! NSNumber - let uuid = savedCorrelation[HealthKitConstants.UUID] as! String - let objects = savedCorrelation[HealthKitConstants.OBJECTS] as! [AnyObject] - - expect(sdate).to(beCloseTo(date.timeIntervalSince1970 * 1000, within: 1000)) - expect(uuid).notTo(beNil()) - expect(objects.count) == 2 - expect(savedCorrelation[HealthKitConstants.E_DATE]).to(beNil()) - - for object in objects { - let dictObject = object as! Dictionary - let oUuid = dictObject[HealthKitConstants.UUID] as! String - let oType = dictObject[HealthKitConstants.TYPE] as! String - - expect(oUuid).notTo(beNil()) - expect(oType).to(contain("HKQuantityTypeIdentifierBloodPressure")) - } - - } - - it ("should handle healthkit query errors") { - exporter.writeResults([], exportTargets: [], error: NSError(domain: "", code: 0, userInfo: [:])) - expect{try exporter.rethrowCollectedErrors()}.to(throwError()) - } - } - - describe("WorkoutDataExporter") { - - let exporter = WorkoutDataExporter(exportConfiguration: exportConfiguration) - - it("should export workouts"){ - let start = NSDate() - let pause = start.dateByAddingTimeInterval(60*2) // + 2 minutes - let resume = start.dateByAddingTimeInterval(60*3) // + 3 minutes - let end = start.dateByAddingTimeInterval(60*10) // + 10 minutes - - let events : [HKWorkoutEvent] = [HKWorkoutEvent(type: HKWorkoutEventType.Pause, date: pause), HKWorkoutEvent(type: HKWorkoutEventType.Resume, date: resume)] - let burned = HKQuantity(unit: HKUnit(fromString: "kcal"), doubleValue: 200.6) - let distance = HKQuantity(unit: HKUnit(fromString: "km"), doubleValue: 4.5) - - let workout = HKWorkout(activityType: HKWorkoutActivityType.Running, startDate: start, endDate: end, workoutEvents: events, totalEnergyBurned: burned, totalDistance: distance, metadata: nil) - - let target = JsonSingleDocInMemExportTarget() - target.startExport() - - exporter.writeResults([workout], exportTargets: [target], error: nil) - - target.endExport() - - let dataArray = JsonReader.toJsonObject(target.getJsonString(), returnArrayForKey:String(HKObjectType.workoutType())) - - expect(dataArray.count) == 1 - - let savedWorkout = dataArray.first as! Dictionary - - let uuid = savedWorkout[HealthKitConstants.UUID] as! String - expect(uuid).notTo(beNil()) - - let workoutActivityType = savedWorkout[HealthKitConstants.WORKOUT_ACTIVITY_TYPE] as! NSNumber - expect(workoutActivityType) == HKWorkoutActivityType.Running.rawValue - - let sDate = savedWorkout[HealthKitConstants.S_DATE] as! NSNumber - let eDate = savedWorkout[HealthKitConstants.E_DATE] as! NSNumber - expect(sDate).to(beCloseTo(eDate, within: 60*10*1001)) - - let duration = savedWorkout[HealthKitConstants.DURATION] as! NSNumber - expect(duration) == 540 // 9 minutes - - let totalDistance = savedWorkout[HealthKitConstants.TOTAL_DISTANCE] as! NSNumber - expect(totalDistance) == 4500 //meters - - let totalEnergyBurned = savedWorkout[HealthKitConstants.TOTAL_ENERGY_BURNED] as! NSNumber - expect(totalEnergyBurned) == 200.6 - - - - let workoutEvents = savedWorkout[HealthKitConstants.WORKOUT_EVENTS] as! [AnyObject] - - let pauseEvent = workoutEvents[0] as! Dictionary - let pauseSDate = pauseEvent[HealthKitConstants.S_DATE] as! NSNumber - expect(pauseSDate).to(beGreaterThan(sDate)) - - let pauseType = pauseEvent[HealthKitConstants.TYPE] as! NSNumber - expect(pauseType) == HKWorkoutEventType.Pause.rawValue - - let resumeEvent = workoutEvents[1] as! Dictionary - let resumeSDate = resumeEvent[HealthKitConstants.S_DATE] as! NSNumber - expect(resumeSDate).to(beGreaterThan(sDate)) - - let resumeType = resumeEvent[HealthKitConstants.TYPE] as! NSNumber - expect(resumeType) == HKWorkoutEventType.Resume.rawValue - - } - - it ("should handle healthkit query errors") { - exporter.writeResults([], exportTargets: [], error: NSError(domain: "", code: 0, userInfo: [:])) - expect{try exporter.rethrowCollectedErrors()}.to(throwError()) - } - } - } - - } \ No newline at end of file +// +// override func spec() { +// +// var exportConfiguration = HealthDataFullExportConfiguration(profileName: self.profileName, exportType: HealthDataToExportType.ALL) +// exportConfiguration.exportUuids = true +// +// describe("MetaData and UserData Export") { +// +// it("should make sure the JsonSingleDocInMemExportTarget is always valid"){ +// let target = JsonSingleDocInMemExportTarget() +// +// expect(target.isValid()) == true +// } +// +// it ("should export the meta data") { +// +// let exporter = MetaDataExporter(exportConfiguration: exportConfiguration) +// +// let target = JsonSingleDocInMemExportTarget() +// target.startExport() +// +// try! exporter.export(self.healthStore, exportTargets: [target]) +// +// target.endExport() +// +// let metaDataDict = JsonReader.toJsonObject(target.getJsonString(), returnDictForKey:HealthKitConstants.META_DATA) +// +// expect(metaDataDict[HealthKitConstants.CREATION_DATE] as? NSNumber).notTo(beNil()) +// expect(metaDataDict[HealthKitConstants.PROFILE_NAME] as? String) == self.profileName +// expect(metaDataDict[HealthKitConstants.VERSION] as? String) == "1.0.0" +// expect(metaDataDict[HealthKitConstants.TYPE] as? String) == "JsonSingleDocExportTarget" +// +// } +// +// it ("should export the user data") { +// let exporter = UserDataExporter(exportConfiguration: exportConfiguration) +// +// let target = JsonSingleDocInMemExportTarget() +// target.startExport() +// +// try! exporter.export(self.healthStore, exportTargets: [target]) +// +// target.endExport() +// +// let userDataDict = JsonReader.toJsonObject(target.getJsonString(), returnDictForKey:"userData") +// +// let dateOfBirth = userDataDict[HealthKitConstants.DATE_OF_BIRTH] as? NSNumber +// let biologicalSex = userDataDict[HealthKitConstants.BIOLOGICAL_SEX] as? Int +// let bloodType = userDataDict[HealthKitConstants.BLOOD_TYPE] as? Int +// let fitzpatrickSkinType = userDataDict[HealthKitConstants.FITZPATRICK_SKIN_TYPE] as? Int +// +// let date = NSDate(timeIntervalSince1970: (dateOfBirth?.doubleValue)! / 1000.0) +// +// expect(try! self.healthStore.dateOfBirth()) == date +// +// expect(biologicalSex) == HKBiologicalSex.Male.rawValue +// expect(bloodType) == HKBloodType.APositive.rawValue +// expect(fitzpatrickSkinType) == HKFitzpatrickSkinType.I.rawValue +// +// } +// } +// +// describe("QuantityType Exports") { +// +// let type = HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBodyMass)! +// let strUnit = "kg" +// let unit = HKUnit(fromString: strUnit) +// +// let exporter = QuantityTypeDataExporter(exportConfiguration: exportConfiguration, type: type, unit: unit) +// +// it("should export quantity data") { +// +// let target = JsonSingleDocInMemExportTarget() +// target.startExport() +// +// target.startWriteType(type) +// +// let date = NSDate() +// let quantity = HKQuantity(unit: unit, doubleValue: 70) +// let sample = HKQuantitySample(type: type, quantity: quantity, startDate: date, endDate: date) +// +// exporter.writeResults([sample], exportTargets: [target], error: nil) +// +// target.endWriteType() +// +// target.endExport() +// +// let dataArray = JsonReader.toJsonObject(target.getJsonString(), returnArrayForKey:String(HKQuantityTypeIdentifierBodyMass)) +// +// +// expect(dataArray.count) == 1 +// +// let savedSample = dataArray.first as! Dictionary +// +// +// +// let sdate = savedSample[HealthKitConstants.S_DATE] as! NSNumber +// let uuid = savedSample[HealthKitConstants.UUID] as! String +// let value = savedSample[HealthKitConstants.VALUE] as! NSNumber +// let unitValue = savedSample[HealthKitConstants.UNIT] as! String +// +// expect(sdate).to(beCloseTo(date.timeIntervalSince1970 * 1000, within: 1000)) +// expect(uuid).notTo(beNil()) +// expect(value) == quantity.doubleValueForUnit(unit) +// expect(savedSample[HealthKitConstants.E_DATE]).to(beNil()) +// expect(unitValue) == strUnit +// +// } +// +// it ("should handle healthkit query errors") { +// +// exporter.writeResults([], exportTargets: [], error: NSError(domain: "", code: 0, userInfo: [:])) +// expect{try exporter.rethrowCollectedErrors()}.to(throwError()) +// } +// } +// +// +// describe("CategoryTypeDataExporter") { +// +// let type = HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierAppleStandHour)! +// +// let exporter = CategoryTypeDataExporter(exportConfiguration: exportConfiguration, type: type) +// +// it ("should export category types"){ +// +// let target = JsonSingleDocInMemExportTarget() +// target.startExport() +// target.startWriteType(type) +// +// let date = NSDate() +// +// let sample = HKCategorySample(type: type, value: 1, startDate: date, endDate: date) +// +// exporter.writeResults([sample], exportTargets: [target], error: nil) +// +// target.endWriteType() +// +// target.endExport() +// +// let dataArray = JsonReader.toJsonObject(target.getJsonString(), returnArrayForKey:String(HKCategoryTypeIdentifierAppleStandHour)) +// +// expect(dataArray.count) == 1 +// +// let savedSample = dataArray.first as! Dictionary +// +// let sdate = savedSample[HealthKitConstants.S_DATE] as! NSNumber +// let uuid = savedSample[HealthKitConstants.UUID] as! String +// let value = savedSample[HealthKitConstants.VALUE] as! NSNumber +// +// expect(sdate).to(beCloseTo(date.timeIntervalSince1970 * 1000, within: 1000)) +// expect(uuid).notTo(beNil()) +// expect(value) == 1 +// +// expect(savedSample[HealthKitConstants.E_DATE]).to(beNil()) +// +// } +// +// +// it ("should handle healthkit query errors") { +// exporter.writeResults([], exportTargets: [], error: NSError(domain: "", code: 0, userInfo: [:])) +// expect{try exporter.rethrowCollectedErrors()}.to(throwError()) +// } +// } +// +// describe("CorrelationTypeDataExporter") { +// let unit = HKUnit(fromString: "mmHg") +// let type1 = HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBloodPressureSystolic)! +// let type2 = HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBloodPressureDiastolic)! +// +// let type = HKObjectType.correlationTypeForIdentifier(HKCorrelationTypeIdentifierBloodPressure)! +// let exporter = CorrelationTypeDataExporter(exportConfiguration: exportConfiguration, type: type, typeMap:[type1:unit,type2:unit]) +// +// it ("should export correlation types") { +// +// let target = JsonSingleDocInMemExportTarget() +// target.startExport() +// target.startWriteType(type) +// +// +// let quantity1 = HKQuantity(unit: unit, doubleValue: 80) +// let quantity2 = HKQuantity(unit: unit, doubleValue: 120) +// +// let date = NSDate() +// +// let samples: [HKSample] = [ +// HKQuantitySample(type: type1, quantity: quantity1, startDate: date, endDate: date), +// HKQuantitySample(type: type2, quantity: quantity2, startDate: date, endDate: date) +// ] +// +// let correlation = HKCorrelation(type: type, startDate: date, endDate: date, objects: Set(samples)) +// +// exporter.writeResults([correlation], exportTargets: [target], error: nil) +// +// target.endWriteType() +// +// target.endExport() +// +// let dataArray = JsonReader.toJsonObject(target.getJsonString(), returnArrayForKey:String(HKCorrelationTypeIdentifierBloodPressure)) +// +// expect(dataArray.count) == 1 +// +// let savedCorrelation = dataArray.first as! Dictionary +// +// +// let sdate = savedCorrelation[HealthKitConstants.S_DATE] as! NSNumber +// let uuid = savedCorrelation[HealthKitConstants.UUID] as! String +// let objects = savedCorrelation[HealthKitConstants.OBJECTS] as! [AnyObject] +// +// expect(sdate).to(beCloseTo(date.timeIntervalSince1970 * 1000, within: 1000)) +// expect(uuid).notTo(beNil()) +// expect(objects.count) == 2 +// expect(savedCorrelation[HealthKitConstants.E_DATE]).to(beNil()) +// +// for object in objects { +// let dictObject = object as! Dictionary +// let oUuid = dictObject[HealthKitConstants.UUID] as! String +// let oType = dictObject[HealthKitConstants.TYPE] as! String +// +// expect(oUuid).notTo(beNil()) +// expect(oType).to(contain("HKQuantityTypeIdentifierBloodPressure")) +// } +// +// } +// +// it ("should handle healthkit query errors") { +// exporter.writeResults([], exportTargets: [], error: NSError(domain: "", code: 0, userInfo: [:])) +// expect{try exporter.rethrowCollectedErrors()}.to(throwError()) +// } +// } +// +// describe("WorkoutDataExporter") { +// +// let exporter = WorkoutDataExporter(exportConfiguration: exportConfiguration) +// +// it("should export workouts"){ +// let start = NSDate() +// let pause = start.dateByAddingTimeInterval(60*2) // + 2 minutes +// let resume = start.dateByAddingTimeInterval(60*3) // + 3 minutes +// let end = start.dateByAddingTimeInterval(60*10) // + 10 minutes +// +// let events : [HKWorkoutEvent] = [HKWorkoutEvent(type: HKWorkoutEventType.Pause, date: pause), HKWorkoutEvent(type: HKWorkoutEventType.Resume, date: resume)] +// let burned = HKQuantity(unit: HKUnit(fromString: "kcal"), doubleValue: 200.6) +// let distance = HKQuantity(unit: HKUnit(fromString: "km"), doubleValue: 4.5) +// +// let workout = HKWorkout(activityType: HKWorkoutActivityType.Running, startDate: start, endDate: end, workoutEvents: events, totalEnergyBurned: burned, totalDistance: distance, metadata: nil) +// +// let target = JsonSingleDocInMemExportTarget() +// target.startExport() +// +// exporter.writeResults([workout], exportTargets: [target], error: nil) +// +// target.endExport() +// +// let dataArray = JsonReader.toJsonObject(target.getJsonString(), returnArrayForKey:String(HKObjectType.workoutType())) +// +// expect(dataArray.count) == 1 +// +// let savedWorkout = dataArray.first as! Dictionary +// +// let uuid = savedWorkout[HealthKitConstants.UUID] as! String +// expect(uuid).notTo(beNil()) +// +// let workoutActivityType = savedWorkout[HealthKitConstants.WORKOUT_ACTIVITY_TYPE] as! NSNumber +// expect(workoutActivityType) == HKWorkoutActivityType.Running.rawValue +// +// let sDate = savedWorkout[HealthKitConstants.S_DATE] as! NSNumber +// let eDate = savedWorkout[HealthKitConstants.E_DATE] as! NSNumber +// expect(sDate).to(beCloseTo(eDate, within: 60*10*1001)) +// +// let duration = savedWorkout[HealthKitConstants.DURATION] as! NSNumber +// expect(duration) == 540 // 9 minutes +// +// let totalDistance = savedWorkout[HealthKitConstants.TOTAL_DISTANCE] as! NSNumber +// expect(totalDistance) == 4500 //meters +// +// let totalEnergyBurned = savedWorkout[HealthKitConstants.TOTAL_ENERGY_BURNED] as! NSNumber +// expect(totalEnergyBurned) == 200.6 +// +// +// +// let workoutEvents = savedWorkout[HealthKitConstants.WORKOUT_EVENTS] as! [AnyObject] +// +// let pauseEvent = workoutEvents[0] as! Dictionary +// let pauseSDate = pauseEvent[HealthKitConstants.S_DATE] as! NSNumber +// expect(pauseSDate).to(beGreaterThan(sDate)) +// +// let pauseType = pauseEvent[HealthKitConstants.TYPE] as! NSNumber +// expect(pauseType) == HKWorkoutEventType.Pause.rawValue +// +// let resumeEvent = workoutEvents[1] as! Dictionary +// let resumeSDate = resumeEvent[HealthKitConstants.S_DATE] as! NSNumber +// expect(resumeSDate).to(beGreaterThan(sDate)) +// +// let resumeType = resumeEvent[HealthKitConstants.TYPE] as! NSNumber +// expect(resumeType) == HKWorkoutEventType.Resume.rawValue +// +// } +// +// it ("should handle healthkit query errors") { +// exporter.writeResults([], exportTargets: [], error: NSError(domain: "", code: 0, userInfo: [:])) +// expect{try exporter.rethrowCollectedErrors()}.to(throwError()) +// } +// } +// } +// +// } diff --git a/Example/Tests/ExportConfigurationTest.swift b/Example/Tests/ExportConfigurationTest.swift index 9797f8f..b0a189d 100644 --- a/Example/Tests/ExportConfigurationTest.swift +++ b/Example/Tests/ExportConfigurationTest.swift @@ -1,48 +1,48 @@ +//// +//// ExportConfigurationTest.swift +//// HealthKitSampleGenerator +//// +//// Created by Michael Seemann on 19.10.15. +//// Copyright © 2015 CocoaPods. All rights reserved. +//// // -// ExportConfigurationTest.swift -// HealthKitSampleGenerator +//import XCTest +//import Quick +//import Nimble +//@testable import HealthKitSampleGenerator // -// Created by Michael Seemann on 19.10.15. -// Copyright © 2015 CocoaPods. All rights reserved. +//class ExportConfigurationTest: QuickSpec { +// +// override func spec() { +// +// it("should return no predicate if ALL data should be exported") { +// let exportConfig = HealthDataFullExportConfiguration(profileName: "x", exportType: .ALL) +// +// let predicate = exportConfig.getPredicate() +// expect(predicate?.predicateFormat).to(contain("correlation")) +// } +// +// // run not in TRAVIS-CI - it will fail. may be because of HKSource call - i don't know +// #if !TRAVIS +// it ("should return a predicate that restricts to this app") { +// let exportConfig = HealthDataFullExportConfiguration(profileName: "x", exportType: .ADDED_BY_THIS_APP) +// +// let predicate = exportConfig.getPredicate() +// +// expect(predicate?.predicateFormat).to(contain("HKSource")) +// } +// #endif +// +// it("should return a predicate that restricts to this metadata additions") { +// +// let exportConfig = HealthDataFullExportConfiguration(profileName: "x", exportType: .GENERATED_BY_THIS_APP) +// +// let predicate = exportConfig.getPredicate() // - -import XCTest -import Quick -import Nimble -@testable import HealthKitSampleGenerator - -class ExportConfigurationTest: QuickSpec { - - override func spec() { - - it("should return no predicate if ALL data should be exported") { - let exportConfig = HealthDataFullExportConfiguration(profileName: "x", exportType: .ALL) - - let predicate = exportConfig.getPredicate() - expect(predicate?.predicateFormat).to(contain("correlation")) - } - - // run not in TRAVIS-CI - it will fail. may be because of HKSource call - i don't know - #if !TRAVIS - it ("should return a predicate that restricts to this app") { - let exportConfig = HealthDataFullExportConfiguration(profileName: "x", exportType: .ADDED_BY_THIS_APP) - - let predicate = exportConfig.getPredicate() - - expect(predicate?.predicateFormat).to(contain("HKSource")) - } - #endif - - it("should return a predicate that restricts to this metadata additions") { - - let exportConfig = HealthDataFullExportConfiguration(profileName: "x", exportType: .GENERATED_BY_THIS_APP) - - let predicate = exportConfig.getPredicate() - - expect(predicate?.predicateFormat).to(contain("metadata.GeneratorSource")) - expect(predicate?.predicateFormat).to(contain("HSG")) - - } - } - -} +// expect(predicate?.predicateFormat).to(contain("metadata.GeneratorSource")) +// expect(predicate?.predicateFormat).to(contain("HSG")) +// +// } +// } +// +//} diff --git a/Example/Tests/ExportTest.swift b/Example/Tests/ExportTest.swift index cc62a20..1e64641 100644 --- a/Example/Tests/ExportTest.swift +++ b/Example/Tests/ExportTest.swift @@ -1,76 +1,76 @@ +//// +//// ExportTest.swift +//// HealthKitSampleGenerator +//// +//// Created by Michael Seemann on 20.10.15. +//// Copyright © 2015 CocoaPods. All rights reserved. +//// // -// ExportTest.swift -// HealthKitSampleGenerator +//import Foundation // -// Created by Michael Seemann on 20.10.15. -// Copyright © 2015 CocoaPods. All rights reserved. +//import XCTest +//import Quick +//import Nimble +//import HealthKit +//@testable import HealthKitSampleGenerator // - -import Foundation - -import XCTest -import Quick -import Nimble -import HealthKit -@testable import HealthKitSampleGenerator - -class ExportTest: QuickSpec { - - internal func find(dataExporter: [DataExporter], className: Any) -> Any? { - - for exporter in dataExporter { - if String(exporter.dynamicType) == String(className) { - return exporter - } - } - - return nil - - } - - override func spec() { - it("should create an array of data exporter based on the exportconfiguration") { - - let exportConfiguration = HealthDataFullExportConfiguration(profileName: "profilename", exportType: HealthDataToExportType.ALL) - - let export = HealthKitDataExporter(healthStore: HealthKitStoreMock()) - - let dataExporter = export.getDataExporters(exportConfiguration, typeMap: [:]) - - let metaDataExporter = self.find(dataExporter, className: MetaDataExporter.self) - - expect(metaDataExporter).toNot(beNil()) - - let userDataExporter = self.find(dataExporter, className: UserDataExporter.self) - - expect(userDataExporter).toNot(beNil()) - - let workoutExporter = self.find(dataExporter, className: WorkoutDataExporter.self) - - expect(workoutExporter).toNot(beNil()) - } - - it("should not conatin userdata exporter if export type not null") { - let exportConfiguration = HealthDataFullExportConfiguration(profileName: "profilename", exportType: HealthDataToExportType.ADDED_BY_THIS_APP) - - let export = HealthKitDataExporter(healthStore: HealthKitStoreMock()) - - let dataExporter = export.getDataExporters(exportConfiguration, typeMap: [:]) - - - let userDataExporter = self.find(dataExporter, className: UserDataExporter.self) - - expect(userDataExporter).to(beNil()) - } - - it("should have the right count of HK-types"){ - expect(HealthKitConstants.healthKitCharacteristicsTypes.count) == 4 - expect(HealthKitConstants.healthKitCategoryTypes.count) == 6 - expect(HealthKitConstants.healthKitQuantityTypes.count) == 67 - expect(HealthKitConstants.healthKitCorrelationTypes.count) == 2 - - let count = 4 + 6 + 67 + 2 + 1 - expect(HealthKitConstants.allTypes().count) == count - } - } -} \ No newline at end of file +//class ExportTest: QuickSpec { +// +// internal func find(dataExporter: [DataExporter], className: Any) -> Any? { +// +// for exporter in dataExporter { +// if String(exporter.dynamicType) == String(className) { +// return exporter +// } +// } +// +// return nil +// +// } +// +// override func spec() { +// it("should create an array of data exporter based on the exportconfiguration") { +// +// let exportConfiguration = HealthDataFullExportConfiguration(profileName: "profilename", exportType: HealthDataToExportType.ALL) +// +// let export = HealthKitDataExporter(healthStore: HealthKitStoreMock()) +// +// let dataExporter = export.getDataExporters(exportConfiguration, typeMap: [:]) +// +// let metaDataExporter = self.find(dataExporter, className: MetaDataExporter.self) +// +// expect(metaDataExporter).toNot(beNil()) +// +// let userDataExporter = self.find(dataExporter, className: UserDataExporter.self) +// +// expect(userDataExporter).toNot(beNil()) +// +// let workoutExporter = self.find(dataExporter, className: WorkoutDataExporter.self) +// +// expect(workoutExporter).toNot(beNil()) +// } +// +// it("should not conatin userdata exporter if export type not null") { +// let exportConfiguration = HealthDataFullExportConfiguration(profileName: "profilename", exportType: HealthDataToExportType.ADDED_BY_THIS_APP) +// +// let export = HealthKitDataExporter(healthStore: HealthKitStoreMock()) +// +// let dataExporter = export.getDataExporters(exportConfiguration, typeMap: [:]) +// +// +// let userDataExporter = self.find(dataExporter, className: UserDataExporter.self) +// +// expect(userDataExporter).to(beNil()) +// } +// +// it("should have the right count of HK-types"){ +// expect(HealthKitConstants.healthKitCharacteristicsTypes.count) == 4 +// expect(HealthKitConstants.healthKitCategoryTypes.count) == 6 +// expect(HealthKitConstants.healthKitQuantityTypes.count) == 67 +// expect(HealthKitConstants.healthKitCorrelationTypes.count) == 2 +// +// let count = 4 + 6 + 67 + 2 + 1 +// expect(HealthKitConstants.allTypes().count) == count +// } +// } +//} diff --git a/Example/Tests/FileNameUtilTest.swift b/Example/Tests/FileNameUtilTest.swift index f49752d..0337b54 100644 --- a/Example/Tests/FileNameUtilTest.swift +++ b/Example/Tests/FileNameUtilTest.swift @@ -1,32 +1,32 @@ +//// +//// FileNameUtilTest.swift +//// HealthKitSampleGenerator +//// +//// Created by Michael Seemann on 17.10.15. +//// Copyright © 2015 CocoaPods. All rights reserved. +//// // -// FileNameUtilTest.swift -// HealthKitSampleGenerator +//import XCTest +//import Quick +//import Nimble +//@testable import HealthKitSampleGenerator // -// Created by Michael Seemann on 17.10.15. -// Copyright © 2015 CocoaPods. All rights reserved. +//class FileNameUtilTest: QuickSpec { // - -import XCTest -import Quick -import Nimble -@testable import HealthKitSampleGenerator - -class FileNameUtilTest: QuickSpec { - - override func spec() { - - it ("should remove all chars from a string that are not valid as filenames") { - let testString = "/\\?%*|\"<>" - let resulString = FileNameUtil.normalizeName(testString) - - expect(resulString) == "" - } - - it("should keep all chars that are allowed in filenames") { - let testString = "a<>b" - let resulString = FileNameUtil.normalizeName(testString) - - expect(resulString) == "ab" - } - } -} +// override func spec() { +// +// it ("should remove all chars from a string that are not valid as filenames") { +// let testString = "/\\?%*|\"<>" +// let resulString = FileNameUtil.normalizeName(testString) +// +// expect(resulString) == "" +// } +// +// it("should keep all chars that are allowed in filenames") { +// let testString = "a<>b" +// let resulString = FileNameUtil.normalizeName(testString) +// +// expect(resulString) == "ab" +// } +// } +//} diff --git a/Example/Tests/HealthKitProfileReaderTest.swift b/Example/Tests/HealthKitProfileReaderTest.swift index 75b6ff7..f14c3de 100644 --- a/Example/Tests/HealthKitProfileReaderTest.swift +++ b/Example/Tests/HealthKitProfileReaderTest.swift @@ -1,78 +1,78 @@ +//// +//// HealthKitProfileReaderTest.swift +//// HealthKitSampleGenerator +//// +//// Created by Michael Seemann on 24.10.15. +//// Copyright © 2015 CocoaPods. All rights reserved. +//// // -// HealthKitProfileReaderTest.swift -// HealthKitSampleGenerator +//import Foundation // -// Created by Michael Seemann on 24.10.15. -// Copyright © 2015 CocoaPods. All rights reserved. +//import XCTest +//import Quick +//import Nimble +//import HealthKit +//@testable import HealthKitSampleGenerator // - -import Foundation - -import XCTest -import Quick -import Nimble -import HealthKit -@testable import HealthKitSampleGenerator - -class HealthKitProfileReaderTest: QuickSpec { - - override func spec() { - - describe("Read and Manage Profile Data on disk") { - - let pathUrl = NSBundle(forClass: self.dynamicType).bundleURL - let profiles = HealthKitProfileReader.readProfilesFromDisk(pathUrl) - - it("should create an array of profiles"){ - expect(profiles.count) == 1 - expect(profiles[0].fileName) == "version-1.0.0.single-doc.json.hsg" - expect(profiles[0].fileSize) > 0 - expect(profiles[0].description) == "version-1.0.0.single-doc.json.hsg Optional(4491)" - } - - it("should read the profile metadata"){ - let profile = profiles[0] - - let testDate = NSDate(timeIntervalSince1970: 1446486924969.067/1000 ) - - profile.loadMetaData(false){ (metaData:HealthKitProfileMetaData) in - expect(metaData.creationDate) == testDate - expect(metaData.profileName) == "output" - expect(metaData.version) == "1.0.0" - expect(metaData.type) == "JsonSingleDocExportTarget" - } - } - - it("should import samples") { - let profile = profiles[0] - var samples:[HKSample] = [] - try! profile.importSamples(){ - (sample: HKSample) in - samples.append(sample) - print(sample) - } - - expect(samples.count) == 8 - - let stepCount = samples[0] as! HKQuantitySample - expect(stepCount.sampleType.identifier) == "HKQuantityTypeIdentifierStepCount" - expect(stepCount.quantity.doubleValueForUnit(HKUnit(fromString: "count"))) == 200 - - let sleepSample = samples[2] as! HKCategorySample - expect(sleepSample.value) == 0 - - let bloodPresure = samples[6] as! HKCorrelation - expect(bloodPresure.objects.count) == 2 - - let workout = samples[7] as! HKWorkout - expect(workout.workoutActivityType) == HKWorkoutActivityType.Running - - } - - it("shoudl delete a profile"){ - // TODO - } - - } - } -} \ No newline at end of file +//class HealthKitProfileReaderTest: QuickSpec { +// +// override func spec() { +// +// describe("Read and Manage Profile Data on disk") { +// +// let pathUrl = NSBundle(forClass: self.dynamicType).bundleURL +// let profiles = HealthKitProfileReader.readProfilesFromDisk(pathUrl) +// +// it("should create an array of profiles"){ +// expect(profiles.count) == 1 +// expect(profiles[0].fileName) == "version-1.0.0.single-doc.json.hsg" +// expect(profiles[0].fileSize) > 0 +// expect(profiles[0].description) == "version-1.0.0.single-doc.json.hsg Optional(4491)" +// } +// +// it("should read the profile metadata"){ +// let profile = profiles[0] +// +// let testDate = NSDate(timeIntervalSince1970: 1446486924969.067/1000 ) +// +// profile.loadMetaData(false){ (metaData:HealthKitProfileMetaData) in +// expect(metaData.creationDate) == testDate +// expect(metaData.profileName) == "output" +// expect(metaData.version) == "1.0.0" +// expect(metaData.type) == "JsonSingleDocExportTarget" +// } +// } +// +// it("should import samples") { +// let profile = profiles[0] +// var samples:[HKSample] = [] +// try! profile.importSamples(){ +// (sample: HKSample) in +// samples.append(sample) +// print(sample) +// } +// +// expect(samples.count) == 8 +// +// let stepCount = samples[0] as! HKQuantitySample +// expect(stepCount.sampleType.identifier) == "HKQuantityTypeIdentifierStepCount" +// expect(stepCount.quantity.doubleValueForUnit(HKUnit(fromString: "count"))) == 200 +// +// let sleepSample = samples[2] as! HKCategorySample +// expect(sleepSample.value) == 0 +// +// let bloodPresure = samples[6] as! HKCorrelation +// expect(bloodPresure.objects.count) == 2 +// +// let workout = samples[7] as! HKWorkout +// expect(workout.workoutActivityType) == HKWorkoutActivityType.Running +// +// } +// +// it("shoudl delete a profile"){ +// // TODO +// } +// +// } +// } +//} diff --git a/Example/Tests/HealthKitStoreMock.swift b/Example/Tests/HealthKitStoreMock.swift index cebc531..8ca4d13 100644 --- a/Example/Tests/HealthKitStoreMock.swift +++ b/Example/Tests/HealthKitStoreMock.swift @@ -1,56 +1,56 @@ +//// +//// HealthKitStoreMock.swift +//// HealthKitSampleGenerator +//// +//// Created by Michael Seemann on 19.10.15. +//// Copyright © 2015 CocoaPods. All rights reserved. +//// // -// HealthKitStoreMock.swift -// HealthKitSampleGenerator +//import Foundation +//import HealthKit // -// Created by Michael Seemann on 19.10.15. -// Copyright © 2015 CocoaPods. All rights reserved. +//public class HKBiologicalSexObjectMock: HKBiologicalSexObject { +// override public var biologicalSex: HKBiologicalSex { +// get { +// return HKBiologicalSex.Male +// } +// } +//} // - -import Foundation -import HealthKit - -public class HKBiologicalSexObjectMock: HKBiologicalSexObject { - override public var biologicalSex: HKBiologicalSex { - get { - return HKBiologicalSex.Male - } - } -} - -public class HKBloodTypeObjectMock: HKBloodTypeObject { - override public var bloodType: HKBloodType { - get { - return HKBloodType.APositive - } - } -} - -public class HKFitzpatrickSkinTypeObjectMock: HKFitzpatrickSkinTypeObject { - override public var skinType: HKFitzpatrickSkinType { - get { - return HKFitzpatrickSkinType.I - } - } -} - -class HealthKitStoreMock: HKHealthStore { - - override func dateOfBirth() throws -> NSDate { - let dateFormatter = NSDateFormatter() - dateFormatter.dateFormat = "MM/dd/yyyy" - return dateFormatter.dateFromString("01/30/1984")! - } - - override func biologicalSex() throws -> HKBiologicalSexObject { - return HKBiologicalSexObjectMock() - } - - override func bloodType() throws -> HKBloodTypeObject { - return HKBloodTypeObjectMock() - } - - override func fitzpatrickSkinType() throws -> HKFitzpatrickSkinTypeObject { - return HKFitzpatrickSkinTypeObjectMock() - } - -} +//public class HKBloodTypeObjectMock: HKBloodTypeObject { +// override public var bloodType: HKBloodType { +// get { +// return HKBloodType.APositive +// } +// } +//} +// +//public class HKFitzpatrickSkinTypeObjectMock: HKFitzpatrickSkinTypeObject { +// override public var skinType: HKFitzpatrickSkinType { +// get { +// return HKFitzpatrickSkinType.I +// } +// } +//} +// +//class HealthKitStoreMock: HKHealthStore { +// +// override func dateOfBirth() throws -> NSDate { +// let dateFormatter = NSDateFormatter() +// dateFormatter.dateFormat = "MM/dd/yyyy" +// return dateFormatter.dateFromString("01/30/1984")! +// } +// +// override func biologicalSex() throws -> HKBiologicalSexObject { +// return HKBiologicalSexObjectMock() +// } +// +// override func bloodType() throws -> HKBloodTypeObject { +// return HKBloodTypeObjectMock() +// } +// +// override func fitzpatrickSkinType() throws -> HKFitzpatrickSkinTypeObject { +// return HKFitzpatrickSkinTypeObjectMock() +// } +// +//} diff --git a/Example/Tests/JsonReaderTest.swift b/Example/Tests/JsonReaderTest.swift index 696d82f..754bff8 100644 --- a/Example/Tests/JsonReaderTest.swift +++ b/Example/Tests/JsonReaderTest.swift @@ -1,162 +1,162 @@ +//// +//// JsonReaderTest.swift +//// HealthKitSampleGenerator +//// +//// Created by Michael Seemann on 20.10.15. +//// Copyright © 2015 CocoaPods. All rights reserved. +//// // -// JsonReaderTest.swift -// HealthKitSampleGenerator -// -// Created by Michael Seemann on 20.10.15. -// Copyright © 2015 CocoaPods. All rights reserved. -// - -import XCTest -import Quick -import Nimble -@testable import HealthKitSampleGenerator - -class JsonReaderTest: QuickSpec { - - override func spec() { - - describe("read json and work together with the default handler") { - - it("should call every method of the jsonHandler"){ - class TestJsonHandler : DefaultJsonHandler { - var functionCalled = Set() - override func startArray(){super.startArray(); functionCalled.insert("a") } - override func endArray(){super.endArray(); functionCalled.insert("b")} - - override func startObject(){super.startObject(); functionCalled.insert("c")} - override func endObject(){super.endObject(); functionCalled.insert("d")} - - override func name(name: String){super.name(name); functionCalled.insert("e")} - override func stringValue(value: String){super.stringValue(value); functionCalled.insert("f")} - override func boolValue(value: Bool){super.boolValue(value); functionCalled.insert("g")} - override func numberValue(value: NSNumber){super.numberValue(value); functionCalled.insert("h")} - override func nullValue(){super.nullValue(); functionCalled.insert("i")} - } - - let testHandler = TestJsonHandler() - - let tokenizer = JsonTokenizer(jsonHandler: testHandler) - tokenizer.tokenize("{\"a\":[1,true,\"string\",null]}") - - expect(testHandler.functionCalled.count) == 9 - } - } - - describe("read json and write the same via jsonwriter") { - var jsonStringOutputHandler:JsonStringOutputJsonHandler! - var tokenizer:JsonTokenizer! - - beforeEach { - jsonStringOutputHandler = JsonStringOutputJsonHandler() - tokenizer = JsonTokenizer(jsonHandler: jsonStringOutputHandler) - } - - it("should read an arry"){ - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "[]") - } - - it("shoudl read an array with a simple object") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "[{\"a\":\"bb\"}]") - } - - it("should read an aray with two simple objects") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "[{\"a\":\"b\"},{\"c\":\"d\"}]") - } - - it("should read an object with two properties") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":\"b\",\"c\":\"d\"}") - } - - it("should read an object with two properties"){ - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":\"b\",\"c\":\"d\"}") - } - - it("should read bool and number values") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":true,\"c\":23}") - } - - it("should read NSDate time values"){ - let date = NSDate() - let milisecondDate = NSNumber(double:date.timeIntervalSince1970*1000) - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":\(milisecondDate)}") - } - - it("should read null values") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":null,\"b\":null,\"c\":null,\"e\":null}") - } - - it("should read array values") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[\"a\",\"b\"]}") - } - - it("should read dictionaries") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"d\":42,\"a\":\"b\"}}") - } - - it("should read dict with numbers") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"a\":123}}") - } - - it("should read dict with bool true values") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"a\":true}}") - } - - it("should read dict with bool false values") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"a\":false}}") - } - - it ("should read dict with double values") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"a\":1.6}}") - } - - it("should read dict with subarray") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[\"a\",\"b\",1,6]}") - } - - it("should read dict of dict with an array") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"a\":[\"a\",\"b\"]}}") - } - - it("should read dict with subarray dict values") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "[{\"a\":1,\"c\":0},{\"b\":2}]") - } - - it("should read named arrays"){ - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[\"t\"]}") - } - - it("should read named objects") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"b\":true}}") - } - - it("should read three named objects in an object") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"m\":{\"a\":7,\"b\":\"o\",\"c\":\"1.0.0\",\"d\":\"s\"},\"u\":{\"d\":5},\"x\":{\"f\":6,\"k\":3}}") - } - - it("should read a named array with dicts"){ - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"b\":\"mi\",\"d\":[{\"u\":\"x\",\"v\":1,\"e\":2,\"s\":3}]}}") - } - - it("should read values/names with json charachters") { - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a,:{}[]\\\":[\"t,:{}[]\"]}") - } - - it("should read array of numbers"){ - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[true,2,1,6]}") - } - - it("should read empty values"){ - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[\"\"]}") - } - - it("should read escaped chars"){ //FIXME is this right? - self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[\"\"\"]}") - } - } - } - - internal func test(tokenizer:JsonTokenizer!, jsonStringOutputHandler:JsonStringOutputJsonHandler!, jsonString: String) { - tokenizer.tokenize(jsonString) - expect(jsonStringOutputHandler.json) == jsonString - } -} +//import XCTest +//import Quick +//import Nimble +//@testable import HealthKitSampleGenerator +// +//class JsonReaderTest: QuickSpec { +// +// override func spec() { +// +// describe("read json and work together with the default handler") { +// +// it("should call every method of the jsonHandler"){ +// class TestJsonHandler : DefaultJsonHandler { +// var functionCalled = Set() +// override func startArray(){super.startArray(); functionCalled.insert("a") } +// override func endArray(){super.endArray(); functionCalled.insert("b")} +// +// override func startObject(){super.startObject(); functionCalled.insert("c")} +// override func endObject(){super.endObject(); functionCalled.insert("d")} +// +// override func name(name: String){super.name(name); functionCalled.insert("e")} +// override func stringValue(value: String){super.stringValue(value); functionCalled.insert("f")} +// override func boolValue(value: Bool){super.boolValue(value); functionCalled.insert("g")} +// override func numberValue(value: NSNumber){super.numberValue(value); functionCalled.insert("h")} +// override func nullValue(){super.nullValue(); functionCalled.insert("i")} +// } +// +// let testHandler = TestJsonHandler() +// +// let tokenizer = JsonTokenizer(jsonHandler: testHandler) +// tokenizer.tokenize("{\"a\":[1,true,\"string\",null]}") +// +// expect(testHandler.functionCalled.count) == 9 +// } +// } +// +// describe("read json and write the same via jsonwriter") { +// var jsonStringOutputHandler:JsonStringOutputJsonHandler! +// var tokenizer:JsonTokenizer! +// +// beforeEach { +// jsonStringOutputHandler = JsonStringOutputJsonHandler() +// tokenizer = JsonTokenizer(jsonHandler: jsonStringOutputHandler) +// } +// +// it("should read an arry"){ +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "[]") +// } +// +// it("shoudl read an array with a simple object") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "[{\"a\":\"bb\"}]") +// } +// +// it("should read an aray with two simple objects") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "[{\"a\":\"b\"},{\"c\":\"d\"}]") +// } +// +// it("should read an object with two properties") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":\"b\",\"c\":\"d\"}") +// } +// +// it("should read an object with two properties"){ +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":\"b\",\"c\":\"d\"}") +// } +// +// it("should read bool and number values") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":true,\"c\":23}") +// } +// +// it("should read NSDate time values"){ +// let date = NSDate() +// let milisecondDate = NSNumber(double:date.timeIntervalSince1970*1000) +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":\(milisecondDate)}") +// } +// +// it("should read null values") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":null,\"b\":null,\"c\":null,\"e\":null}") +// } +// +// it("should read array values") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[\"a\",\"b\"]}") +// } +// +// it("should read dictionaries") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"d\":42,\"a\":\"b\"}}") +// } +// +// it("should read dict with numbers") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"a\":123}}") +// } +// +// it("should read dict with bool true values") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"a\":true}}") +// } +// +// it("should read dict with bool false values") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"a\":false}}") +// } +// +// it ("should read dict with double values") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"a\":1.6}}") +// } +// +// it("should read dict with subarray") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[\"a\",\"b\",1,6]}") +// } +// +// it("should read dict of dict with an array") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"a\":[\"a\",\"b\"]}}") +// } +// +// it("should read dict with subarray dict values") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "[{\"a\":1,\"c\":0},{\"b\":2}]") +// } +// +// it("should read named arrays"){ +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[\"t\"]}") +// } +// +// it("should read named objects") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"b\":true}}") +// } +// +// it("should read three named objects in an object") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"m\":{\"a\":7,\"b\":\"o\",\"c\":\"1.0.0\",\"d\":\"s\"},\"u\":{\"d\":5},\"x\":{\"f\":6,\"k\":3}}") +// } +// +// it("should read a named array with dicts"){ +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":{\"b\":\"mi\",\"d\":[{\"u\":\"x\",\"v\":1,\"e\":2,\"s\":3}]}}") +// } +// +// it("should read values/names with json charachters") { +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a,:{}[]\\\":[\"t,:{}[]\"]}") +// } +// +// it("should read array of numbers"){ +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[true,2,1,6]}") +// } +// +// it("should read empty values"){ +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[\"\"]}") +// } +// +// it("should read escaped chars"){ //FIXME is this right? +// self.test(tokenizer, jsonStringOutputHandler: jsonStringOutputHandler, jsonString: "{\"a\":[\"\"\"]}") +// } +// } +// } +// +// internal func test(tokenizer:JsonTokenizer!, jsonStringOutputHandler:JsonStringOutputJsonHandler!, jsonString: String) { +// tokenizer.tokenize(jsonString) +// expect(jsonStringOutputHandler.json) == jsonString +// } +//} diff --git a/Example/Tests/JsonWriterTest.swift b/Example/Tests/JsonWriterTest.swift index 0eda6ef..02c163a 100644 --- a/Example/Tests/JsonWriterTest.swift +++ b/Example/Tests/JsonWriterTest.swift @@ -1,262 +1,262 @@ +//// +//// JsonWriterTest.swift +//// HealthKitSampleGenerator +//// +//// Created by Michael Seemann on 05.10.15. +//// Copyright © 2015 CocoaPods. All rights reserved. +//// // -// JsonWriterTest.swift -// HealthKitSampleGenerator +//import XCTest +//import Quick +//import Nimble +//@testable import HealthKitSampleGenerator // -// Created by Michael Seemann on 05.10.15. -// Copyright © 2015 CocoaPods. All rights reserved. +//class JsonWriterTest: QuickSpec { +// +// override func spec() { +// it("should write a simple array as json"){ // - -import XCTest -import Quick -import Nimble -@testable import HealthKitSampleGenerator - -class JsonWriterTest: QuickSpec { - - override func spec() { - it("should write a simple array as json"){ - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartArray() - jw.writeEndArray() - - expect(jw.getJsonString()) == "[]" - } - - it("should write an json object within an array") { - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartArray() - jw.writeStartObject() - jw.writeField("a", value: "b") - jw.writeEndObject() - jw.writeEndArray() - - - expect(jw.getJsonString()) == "[{\"a\":\"b\"}]" - } - - it("should write an json array with 2 objects"){ - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartArray() - jw.writeStartObject() - jw.writeField("a", value: "b") - jw.writeEndObject() - jw.writeStartObject() - jw.writeField("c", value: "d") - jw.writeEndObject() - jw.writeEndArray() - - expect(jw.getJsonString()) == "[{\"a\":\"b\"},{\"c\":\"d\"}]" - } - - it("should write an Object with two properties"){ - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - jw.writeField("a", value: "b") - jw.writeField("c", value: "d") - jw.writeEndObject() - - - expect(jw.getJsonString()) == "{\"a\":\"b\",\"c\":\"d\"}" - } - - it("should write Bool and Number values"){ - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - jw.writeField("a", value: true) - jw.writeField("c", value: Int(23)) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":true,\"c\":23}" - } - - it("should write NSDate values"){ - let date = NSDate() - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - jw.writeField("a", value: date) - jw.writeEndObject() - - let milisecondDate = NSNumber(double:date.timeIntervalSince1970*1000) - expect(jw.getJsonString()) == "{\"a\":\(milisecondDate)}" - } - - it ("should write null values") { - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - jw.writeField("a", value: nil as NSNumber!) - jw.writeField("b", value: nil as String!) - jw.writeField("c", value: nil as NSDate!) - jw.writeField("e", value: nil as Bool!) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":null,\"b\":null,\"c\":null,\"e\":null}" - } - - it ("should write array values") { - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - try! jw.writeFieldWithObject("a", value: ["a", "b"]) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":[\"a\",\"b\"]}" - } - - it ("should write dictionaries") { - - let jw = JsonWriter(outputStream: MemOutputStream()) - - let date = NSDate() - let jsonDate = NSNumber(double:date.timeIntervalSince1970*1000) - - let dict: Dictionary = ["a":"b", "d":date] - - jw.writeStartObject() - try! jw.writeFieldWithObject("a", value: dict) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":{\"d\":\(jsonDate),\"a\":\"b\"}}" - } - - it ("should write dict with numbers") { - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - try! jw.writeFieldWithObject("a", value: ["a":123]) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":{\"a\":123}}" - } - - it ("should write dict with bool - true value") { - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - try! jw.writeFieldWithObject("a", value: ["a":true]) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":{\"a\":true}}" - } - - it ("should write dict with bool - false value") { - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - try! jw.writeFieldWithObject("a", value: ["a":false]) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":{\"a\":false}}" - } - - it ("should write dict with double") { - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - try! jw.writeFieldWithObject("a", value: ["a":Double(1.6)]) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":{\"a\":1.6}}" - } - - it ("should write dict with sub array") { - - let date = NSDate() - let jsonDate = NSNumber(double:date.timeIntervalSince1970*1000) - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - try! jw.writeFieldWithObject("a", value: ["a", "b", 1, date]) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":[\"a\",\"b\",1,\(jsonDate)]}" - } - - it ("should write dict with dict of an array") { - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - try! jw.writeFieldWithObject("a", value: ["a": ["a","b"]]) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":{\"a\":[\"a\",\"b\"]}}" - } - - it ("should write dict with sub array dict values") { - - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - try! jw.writeFieldWithObject("a", value: [["a":1], ["b":2]]) - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":[{\"a\":1},{\"b\":2}]}" - } - - it ("should write named array") { - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - jw.writeArrayFieldStart("a") - jw.writeString("t") - jw.writeEndArray() - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":[\"t\"]}" - } - - it ("should write named objects") { - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - jw.writeObjectFieldStart("a") - jw.writeField("b", value: true) - jw.writeEndObject() - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"a\":{\"b\":true}}" - } - - it("should write two named objects in an object"){ - let jw = JsonWriter(outputStream: MemOutputStream()) - - jw.writeStartObject() - - jw.writeFieldName("m") - jw.writeStartObject() - jw.writeField("a", value: 7) - jw.writeField("b", value: "o") - jw.writeField("c", value: "1.0.0") - jw.writeField("d", value: "s") - jw.writeEndObject() - - jw.writeFieldName("u") - jw.writeStartObject() - jw.writeField("d", value: 5) - jw.writeEndObject() - - jw.writeEndObject() - - expect(jw.getJsonString()) == "{\"m\":{\"a\":7,\"b\":\"o\",\"c\":\"1.0.0\",\"d\":\"s\"},\"u\":{\"d\":5}}" - } - } -} +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartArray() +// jw.writeEndArray() +// +// expect(jw.getJsonString()) == "[]" +// } +// +// it("should write an json object within an array") { +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartArray() +// jw.writeStartObject() +// jw.writeField("a", value: "b") +// jw.writeEndObject() +// jw.writeEndArray() +// +// +// expect(jw.getJsonString()) == "[{\"a\":\"b\"}]" +// } +// +// it("should write an json array with 2 objects"){ +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartArray() +// jw.writeStartObject() +// jw.writeField("a", value: "b") +// jw.writeEndObject() +// jw.writeStartObject() +// jw.writeField("c", value: "d") +// jw.writeEndObject() +// jw.writeEndArray() +// +// expect(jw.getJsonString()) == "[{\"a\":\"b\"},{\"c\":\"d\"}]" +// } +// +// it("should write an Object with two properties"){ +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// jw.writeField("a", value: "b") +// jw.writeField("c", value: "d") +// jw.writeEndObject() +// +// +// expect(jw.getJsonString()) == "{\"a\":\"b\",\"c\":\"d\"}" +// } +// +// it("should write Bool and Number values"){ +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// jw.writeField("a", value: true) +// jw.writeField("c", value: Int(23)) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":true,\"c\":23}" +// } +// +// it("should write NSDate values"){ +// let date = NSDate() +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// jw.writeField("a", value: date) +// jw.writeEndObject() +// +// let milisecondDate = NSNumber(double:date.timeIntervalSince1970*1000) +// expect(jw.getJsonString()) == "{\"a\":\(milisecondDate)}" +// } +// +// it ("should write null values") { +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// jw.writeField("a", value: nil as NSNumber!) +// jw.writeField("b", value: nil as String!) +// jw.writeField("c", value: nil as NSDate!) +// jw.writeField("e", value: nil as Bool!) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":null,\"b\":null,\"c\":null,\"e\":null}" +// } +// +// it ("should write array values") { +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// try! jw.writeFieldWithObject("a", value: ["a", "b"]) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":[\"a\",\"b\"]}" +// } +// +// it ("should write dictionaries") { +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// let date = NSDate() +// let jsonDate = NSNumber(double:date.timeIntervalSince1970*1000) +// +// let dict: Dictionary = ["a":"b", "d":date] +// +// jw.writeStartObject() +// try! jw.writeFieldWithObject("a", value: dict) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":{\"d\":\(jsonDate),\"a\":\"b\"}}" +// } +// +// it ("should write dict with numbers") { +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// try! jw.writeFieldWithObject("a", value: ["a":123]) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":{\"a\":123}}" +// } +// +// it ("should write dict with bool - true value") { +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// try! jw.writeFieldWithObject("a", value: ["a":true]) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":{\"a\":true}}" +// } +// +// it ("should write dict with bool - false value") { +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// try! jw.writeFieldWithObject("a", value: ["a":false]) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":{\"a\":false}}" +// } +// +// it ("should write dict with double") { +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// try! jw.writeFieldWithObject("a", value: ["a":Double(1.6)]) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":{\"a\":1.6}}" +// } +// +// it ("should write dict with sub array") { +// +// let date = NSDate() +// let jsonDate = NSNumber(double:date.timeIntervalSince1970*1000) +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// try! jw.writeFieldWithObject("a", value: ["a", "b", 1, date]) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":[\"a\",\"b\",1,\(jsonDate)]}" +// } +// +// it ("should write dict with dict of an array") { +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// try! jw.writeFieldWithObject("a", value: ["a": ["a","b"]]) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":{\"a\":[\"a\",\"b\"]}}" +// } +// +// it ("should write dict with sub array dict values") { +// +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// try! jw.writeFieldWithObject("a", value: [["a":1], ["b":2]]) +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":[{\"a\":1},{\"b\":2}]}" +// } +// +// it ("should write named array") { +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// jw.writeArrayFieldStart("a") +// jw.writeString("t") +// jw.writeEndArray() +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":[\"t\"]}" +// } +// +// it ("should write named objects") { +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// jw.writeObjectFieldStart("a") +// jw.writeField("b", value: true) +// jw.writeEndObject() +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"a\":{\"b\":true}}" +// } +// +// it("should write two named objects in an object"){ +// let jw = JsonWriter(outputStream: MemOutputStream()) +// +// jw.writeStartObject() +// +// jw.writeFieldName("m") +// jw.writeStartObject() +// jw.writeField("a", value: 7) +// jw.writeField("b", value: "o") +// jw.writeField("c", value: "1.0.0") +// jw.writeField("d", value: "s") +// jw.writeEndObject() +// +// jw.writeFieldName("u") +// jw.writeStartObject() +// jw.writeField("d", value: 5) +// jw.writeEndObject() +// +// jw.writeEndObject() +// +// expect(jw.getJsonString()) == "{\"m\":{\"a\":7,\"b\":\"o\",\"c\":\"1.0.0\",\"d\":\"s\"},\"u\":{\"d\":5}}" +// } +// } +//} diff --git a/Example/Tests/OutputStreamTest.swift b/Example/Tests/OutputStreamTest.swift index c3b2525..5efe0ff 100644 --- a/Example/Tests/OutputStreamTest.swift +++ b/Example/Tests/OutputStreamTest.swift @@ -1,33 +1,33 @@ +//// +//// OutputStreamTest.swift +//// HealthKitSampleGenerator +//// +//// Created by Michael Seemann on 18.10.15. +//// Copyright © 2015 CocoaPods. All rights reserved. +//// // -// OutputStreamTest.swift -// HealthKitSampleGenerator // -// Created by Michael Seemann on 18.10.15. -// Copyright © 2015 CocoaPods. All rights reserved. +//import XCTest +//import Quick +//import Nimble +//@testable import HealthKitSampleGenerator // - - -import XCTest -import Quick -import Nimble -@testable import HealthKitSampleGenerator - -class OutputStreamTest: QuickSpec { - - override func spec() { - - it ("FileOutputStream should return the written data as String") { - let text = "text" - let tmpUrl = NSURL.init(fileURLWithPath: NSTemporaryDirectory()) - let outputFileName = tmpUrl.URLByAppendingPathComponent("x.txt").path! - - let fos = FileOutputStream(fileAtPath: outputFileName) - fos.open() - fos.write(text) - expect(fos.getDataAsString()) == text - - try! NSFileManager.defaultManager().removeItemAtPath(outputFileName) - } - - } -} +//class OutputStreamTest: QuickSpec { +// +// override func spec() { +// +// it ("FileOutputStream should return the written data as String") { +// let text = "text" +// let tmpUrl = NSURL.init(fileURLWithPath: NSTemporaryDirectory()) +// let outputFileName = tmpUrl.URLByAppendingPathComponent("x.txt").path! +// +// let fos = FileOutputStream(fileAtPath: outputFileName) +// fos.open() +// fos.write(text) +// expect(fos.getDataAsString()) == text +// +// try! NSFileManager.defaultManager().removeItemAtPath(outputFileName) +// } +// +// } +//} diff --git a/Example/Tests/SingleDocReaderTest.swift b/Example/Tests/SingleDocReaderTest.swift index 06dee80..d46c76f 100644 --- a/Example/Tests/SingleDocReaderTest.swift +++ b/Example/Tests/SingleDocReaderTest.swift @@ -1,49 +1,49 @@ +//// +//// SingleDocReaderTest.swift +//// HealthKitSampleGenerator +//// +//// Created by Michael Seemann on 20.10.15. +//// Copyright © 2015 CocoaPods. All rights reserved. +//// // -// SingleDocReaderTest.swift -// HealthKitSampleGenerator // -// Created by Michael Seemann on 20.10.15. -// Copyright © 2015 CocoaPods. All rights reserved. +//import XCTest +//import Quick +//import Nimble +//@testable import HealthKitSampleGenerator // - - -import XCTest -import Quick -import Nimble -@testable import HealthKitSampleGenerator - -class SigleDocReaderTest: QuickSpec { - - override func spec() { - let fileAtPath = NSBundle(forClass: self.dynamicType).pathForResource("version-1.0.0.single-doc.json", ofType: "hsg") - - it("should read a single doc json file from version 1.0.0") { - let exist = NSFileManager.defaultManager().fileExistsAtPath(fileAtPath!) - expect(exist) == true - - let jsonStringOutputHandler = JsonStringOutputJsonHandler() - - JsonReader.readFileAtPath(fileAtPath!, withJsonHandler: jsonStringOutputHandler) - - let stringFromFile = try! NSString(contentsOfFile: fileAtPath!, encoding: NSUTF8StringEncoding) as String - - expect(stringFromFile).to(equal(jsonStringOutputHandler.json)) - } - - it("should read the metadata - and cancel after that"){ - - let metaDataOutput = MetaDataOutputJsonHandler() - - JsonReader.readFileAtPath(fileAtPath!, withJsonHandler: metaDataOutput) - - let metaData = metaDataOutput.getMetaData() - - expect(metaData["creationDate"] as? NSNumber) == 1446486924969.067 - expect(metaData["profileName"] as? String) == "output" - expect(metaData["version"] as? String) == "1.0.0" - expect(metaData["type"] as? String) == "JsonSingleDocExportTarget" - - } - } - -} +//class SigleDocReaderTest: QuickSpec { +// +// override func spec() { +// let fileAtPath = NSBundle(forClass: self.dynamicType).pathForResource("version-1.0.0.single-doc.json", ofType: "hsg") +// +// it("should read a single doc json file from version 1.0.0") { +// let exist = NSFileManager.defaultManager().fileExistsAtPath(fileAtPath!) +// expect(exist) == true +// +// let jsonStringOutputHandler = JsonStringOutputJsonHandler() +// +// JsonReader.readFileAtPath(fileAtPath!, withJsonHandler: jsonStringOutputHandler) +// +// let stringFromFile = try! NSString(contentsOfFile: fileAtPath!, encoding: NSUTF8StringEncoding) as String +// +// expect(stringFromFile).to(equal(jsonStringOutputHandler.json)) +// } +// +// it("should read the metadata - and cancel after that"){ +// +// let metaDataOutput = MetaDataOutputJsonHandler() +// +// JsonReader.readFileAtPath(fileAtPath!, withJsonHandler: metaDataOutput) +// +// let metaData = metaDataOutput.getMetaData() +// +// expect(metaData["creationDate"] as? NSNumber) == 1446486924969.067 +// expect(metaData["profileName"] as? String) == "output" +// expect(metaData["version"] as? String) == "1.0.0" +// expect(metaData["type"] as? String) == "JsonSingleDocExportTarget" +// +// } +// } +// +//} diff --git a/HealthKitSampleGenerator.podspec b/HealthKitSampleGenerator.podspec index dad9acf..1b5d2ff 100644 --- a/HealthKitSampleGenerator.podspec +++ b/HealthKitSampleGenerator.podspec @@ -8,7 +8,7 @@ s.author = { "Michael Seemann" => "pods@mseemann.de" } s.source = { :git => "https://github.com/mseemann/healthkit-sample-generator.git", :tag => s.version.to_s } -s.platform = :ios, '9.0' +s.platform = :ios, '12.0' s.requires_arc = true s.source_files = 'Pod/Classes/**/*' diff --git a/Pod/Classes/ExportConfiguration.swift b/Pod/Classes/ExportConfiguration.swift index 1236f33..874be69 100644 --- a/Pod/Classes/ExportConfiguration.swift +++ b/Pod/Classes/ExportConfiguration.swift @@ -19,9 +19,16 @@ public protocol ExportConfiguration { var profileName:String {get} /// should uuids be exported or not var exportUuids:Bool {get} + /// export start date + var startDate:Date {get} + /// export end date + var endDate:Date {get} + /// should authorize HK parameters from user or not + var shouldAuthorize:Bool {get} + } -// possible configuration extension: +// possible configuration extension: // export correlations even if they are present in the correlation type section // export endDate always - even if the endDate and startDate are the same @@ -29,15 +36,17 @@ internal extension ExportConfiguration { internal func getPredicate() -> NSPredicate? { - let predicateNoCorreltion = HKQuery.predicateForObjectsWithNoCorrelation() +// let predicateNoCorreltion = HKQuery.predicateForObjectsWithNoCorrelation() + //let predicateNoCorreltion = HKQuery.predicateForSamples(withStart: Calendar.current.startOfDay(for: Date().addingTimeInterval(-60 * 60 * 23)),end: Calendar.current.startOfDay(for: Date()),options: .strictEndDate) + let predicateNoCorreltion = HKQuery.predicateForSamples(withStart: startDate, end: endDate, options: .strictEndDate) switch exportType { case .ALL: return predicateNoCorreltion case .ADDED_BY_THIS_APP: - return NSCompoundPredicate(andPredicateWithSubpredicates: [predicateNoCorreltion, HKQuery.predicateForObjectsFromSource(HKSource.defaultSource())]) + return NSCompoundPredicate(andPredicateWithSubpredicates: [predicateNoCorreltion, HKQuery.predicateForObjects(from: HKSource.default())]) case .GENERATED_BY_THIS_APP: - return NSCompoundPredicate(andPredicateWithSubpredicates: [predicateNoCorreltion, HKQuery.predicateForObjectsWithMetadataKey("GeneratorSource", allowedValues: ["HSG"])]) + return NSCompoundPredicate(andPredicateWithSubpredicates: [predicateNoCorreltion, HKQuery.predicateForObjects(withMetadataKey: "GeneratorSource", allowedValues: ["HSG"])]) } } @@ -47,6 +56,7 @@ internal extension ExportConfiguration { Epxort the whole Data from first Entry up to the current Date. E.g. full means the whole period of time. */ public struct HealthDataFullExportConfiguration : ExportConfiguration { + /// what should be exported - see HealthDataToExportType public var exportType = HealthDataToExportType.ALL // required /// the name of the profile @@ -54,13 +64,22 @@ public struct HealthDataFullExportConfiguration : ExportConfiguration { /// should uuids be exported or not public var exportUuids = false + public var startDate: Date // required + + public var endDate: Date // required + + public var shouldAuthorize: Bool // required + /** instantiate a HealthDataFullExportConfiguration. - Parameter profileName: the name of the profile - Parameter exportType: what should be exported. see HealthDataToExportType */ - public init(profileName:String, exportType: HealthDataToExportType){ + public init(profileName:String, exportType: HealthDataToExportType, startDate: Date, endDate: Date, shouldAuthorize: Bool){ self.profileName = profileName self.exportType = exportType + self.startDate = startDate + self.endDate = endDate + self.shouldAuthorize = shouldAuthorize } } diff --git a/Pod/Classes/ExportTargets.swift b/Pod/Classes/ExportTargets.swift index a543e19..25db4ef 100644 --- a/Pod/Classes/ExportTargets.swift +++ b/Pod/Classes/ExportTargets.swift @@ -19,81 +19,81 @@ public protocol ExportTarget { func endExport() throws -> Void /// output the metadata of the profile - func writeMetaData(creationDate creationDate: NSDate, profileName: String, version: String) throws -> Void + func writeMetaData(creationDate: Date, profileName: String, version: String) throws -> Void /// output the user data from healthkit - func writeUserData(userData: Dictionary ) throws -> Void + func writeUserData(_ userData: Dictionary ) throws -> Void /// start writing a type - func startWriteType(type:HKSampleType) throws -> Void + func startWriteType(_ type:HKSampleType) throws -> Void /// end writing a type func endWriteType() throws -> Void /// write a dictionary to the output - e.g. a dict of the sample data - func writeDictionary(entry:Dictionary ) throws -> Void + func writeDictionary(_ entry:Dictionary ) throws -> Void } /// An export target that generetes a single json doc for the whole data. -public class JsonSingleDocExportTarget { +open class JsonSingleDocExportTarget { - private(set) var jsonWriter: JsonWriter + fileprivate(set) var jsonWriter: JsonWriter init(outputStream: OutputStream){ self.jsonWriter = JsonWriter(outputStream: outputStream) } /// see ExportTarget Protocol - public func startExport() -> Void { + open func startExport() -> Void { jsonWriter.writeStartObject() } /// see ExportTarget Protocol - public func endExport() { + open func endExport() { jsonWriter.writeEndObject() jsonWriter.close() } /// see ExportTarget Protocol - public func writeMetaData(creationDate creationDate: NSDate, profileName: String, version: String) { + open func writeMetaData(creationDate: Date, profileName: String, version: String) { jsonWriter.writeObjectFieldStart(HealthKitConstants.META_DATA) jsonWriter.writeField(HealthKitConstants.CREATION_DATE, value: creationDate) jsonWriter.writeField(HealthKitConstants.PROFILE_NAME, value: profileName) jsonWriter.writeField(HealthKitConstants.VERSION, value: version) - jsonWriter.writeField(HealthKitConstants.TYPE, value: String(JsonSingleDocExportTarget)) + jsonWriter.writeField(HealthKitConstants.TYPE, value: String(describing: JsonSingleDocExportTarget.self)) jsonWriter.writeEndObject() } /// see ExportTarget Protocol - public func writeUserData(userData: Dictionary ) throws { + open func writeUserData(_ userData: Dictionary ) throws { try jsonWriter.writeFieldWithObject(HealthKitConstants.USER_DATA, value: userData) } /// see ExportTarget Protocol - public func startWriteType(type:HKSampleType) -> Void { - jsonWriter.writeArrayFieldStart(String(type)) + open func startWriteType(_ type:HKSampleType) -> Void { + jsonWriter.writeArrayFieldStart(type.identifier) } /// see ExportTarget Protocol - public func endWriteType() -> Void { + open func endWriteType() -> Void { jsonWriter.writeEndArray() } /// see ExportTarget Protocol - public func writeDictionary(entry:Dictionary ) throws -> Void { + open func writeDictionary(_ entry:Dictionary ) throws -> Void { try jsonWriter.writeObject(entry) } } /// an export target that creates a single json doc within a file -public class JsonSingleDocAsFileExportTarget : JsonSingleDocExportTarget, ExportTarget { +open class JsonSingleDocAsFileExportTarget : JsonSingleDocExportTarget, ExportTarget { /// the full path of the ouput file - private(set) public var outputFileName: String - private(set) var overwriteIfExist = false + fileprivate(set) open var outputFileName: String + fileprivate(set) var overwriteIfExist = false /** - Instantiate a JsonSingleDocAsFileExportTarget. - - Parameter outputFileName: the full path of the output file + Instantiate a JsonSingleDocAsFileExportTarget. + - Parameter outputFileName: the full path of the output file - Parameter overwriteIfExist: should the file be overwritten if it already exist. */ public init(outputFileName: String, overwriteIfExist:Bool){ @@ -107,11 +107,11 @@ public class JsonSingleDocAsFileExportTarget : JsonSingleDocExportTarget, Export Check the validity of the ExportTarget. - Returns: true if the file does not already exist or overwrite is allowed. */ - public func isValid() -> Bool { + open func isValid() -> Bool { var valid = true // if the outputFileName already exists, the state is only valid, if overwrite is allowed - if NSFileManager.defaultManager().fileExistsAtPath(outputFileName) { + if FileManager.default.fileExists(atPath: outputFileName) { valid = valid && overwriteIfExist } @@ -120,7 +120,7 @@ public class JsonSingleDocAsFileExportTarget : JsonSingleDocExportTarget, Export } /// an export target that creates a single json doc in memory -public class JsonSingleDocInMemExportTarget: JsonSingleDocExportTarget, ExportTarget { +open class JsonSingleDocInMemExportTarget: JsonSingleDocExportTarget, ExportTarget { /// create a JsonSingleDocExportTarget in Mem public init(){ @@ -128,12 +128,12 @@ public class JsonSingleDocInMemExportTarget: JsonSingleDocExportTarget, ExportTa } /// is always valid - public func isValid() -> Bool { + open func isValid() -> Bool { return true } /// see ExportTarget Protocol - public func getJsonString() -> String { + open func getJsonString() -> String { return jsonWriter.getJsonString() } -} \ No newline at end of file +} diff --git a/Pod/Classes/HealthKitConstants.swift b/Pod/Classes/HealthKitConstants.swift index 870330c..c7cc07a 100644 --- a/Pod/Classes/HealthKitConstants.swift +++ b/Pod/Classes/HealthKitConstants.swift @@ -28,6 +28,7 @@ class HealthKitConstants { static let BLOOD_TYPE = "bloodType" static let FITZPATRICK_SKIN_TYPE = "fitzpatrickSkinType" static let META_DATA = "metaData" + static let SOURCE = "source" static let CREATION_DATE = "creationDate" static let PROFILE_NAME = "profileName" static let VERSION = "version" @@ -35,138 +36,142 @@ class HealthKitConstants { static let healthKitCharacteristicsTypes: Set = Set(arrayLiteral: - HKObjectType.characteristicTypeForIdentifier(HKCharacteristicTypeIdentifierDateOfBirth)!, - HKObjectType.characteristicTypeForIdentifier(HKCharacteristicTypeIdentifierBiologicalSex)!, - HKObjectType.characteristicTypeForIdentifier(HKCharacteristicTypeIdentifierBloodType)!, - HKObjectType.characteristicTypeForIdentifier(HKCharacteristicTypeIdentifierFitzpatrickSkinType)! + HKObjectType.characteristicType(forIdentifier: HKCharacteristicTypeIdentifier.dateOfBirth)!, + HKObjectType.characteristicType(forIdentifier: HKCharacteristicTypeIdentifier.biologicalSex)!, + HKObjectType.characteristicType(forIdentifier: HKCharacteristicTypeIdentifier.bloodType)!, + HKObjectType.characteristicType(forIdentifier: HKCharacteristicTypeIdentifier.fitzpatrickSkinType)! ) static let healthKitCategoryTypes: Set = Set(arrayLiteral: - HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierSleepAnalysis)!, - HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierCervicalMucusQuality)!, - HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierOvulationTestResult)!, - HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierMenstrualFlow)!, - HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierIntermenstrualBleeding)!, - HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierSexualActivity)! + HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier.sleepAnalysis)!, + HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier.cervicalMucusQuality)!, + HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier.ovulationTestResult)!, + HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier.menstrualFlow)!, + HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier.intermenstrualBleeding)!, + HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier.sexualActivity)!, + HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier.appleStandHour)! ) // not writable static let healthKitCategoryLockedTypes: Set = Set(arrayLiteral: - HKObjectType.categoryTypeForIdentifier(HKCategoryTypeIdentifierAppleStandHour)! + HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier.appleStandHour)! ) static let healthKitQuantityTypes: Set = Set(arrayLiteral: // Body Measurements - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBodyMassIndex)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBodyFatPercentage)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierHeight)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBodyMass)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierLeanBodyMass)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyMassIndex)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyFatPercentage)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.height)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyMass)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.leanBodyMass)!, // Fitness - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierStepCount)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDistanceWalkingRunning)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDistanceCycling)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBasalEnergyBurned)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierActiveEnergyBurned)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierFlightsClimbed)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.distanceWalkingRunning)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.distanceCycling)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.basalEnergyBurned)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.activeEnergyBurned)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.flightsClimbed)!, // Vitals - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierHeartRate)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBodyTemperature)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBasalBodyTemperature)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBloodPressureSystolic)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBloodPressureDiastolic)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierRespiratoryRate)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.heartRate)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyTemperature)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.basalBodyTemperature)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bloodPressureSystolic)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bloodPressureDiastolic)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.respiratoryRate)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.heartRateVariabilitySDNN)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.restingHeartRate)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.walkingHeartRateAverage)!, // Results - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierOxygenSaturation)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierPeripheralPerfusionIndex)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBloodGlucose)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierNumberOfTimesFallen)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierElectrodermalActivity)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierInhalerUsage)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierBloodAlcoholContent)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierForcedVitalCapacity)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierForcedExpiratoryVolume1)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierPeakExpiratoryFlowRate)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.oxygenSaturation)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.peripheralPerfusionIndex)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bloodGlucose)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.numberOfTimesFallen)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.electrodermalActivity)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.inhalerUsage)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bloodAlcoholContent)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.forcedVitalCapacity)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.forcedExpiratoryVolume1)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.peakExpiratoryFlowRate)!, // Nutrition - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryFatTotal)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryFatPolyunsaturated)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryFatMonounsaturated)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryFatSaturated)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryCholesterol)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietarySodium)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryCarbohydrates)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryFiber)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietarySugar)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryEnergyConsumed)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryProtein)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryVitaminA)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryVitaminB6)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryVitaminB12)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryVitaminC)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryVitaminD)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryVitaminE)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryVitaminK)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryCalcium)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryIron)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryThiamin)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryRiboflavin)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryNiacin)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryFolate)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryBiotin)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryPantothenicAcid)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryPhosphorus)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryIodine)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryMagnesium)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryZinc)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietarySelenium)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryCopper)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryManganese)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryChromium)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryMolybdenum)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryChloride)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryPotassium)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryCaffeine)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierDietaryWater)!, - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierUVExposure)! + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryFatTotal)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryFatPolyunsaturated)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryFatMonounsaturated)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryFatSaturated)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryCholesterol)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietarySodium)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryCarbohydrates)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryFiber)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietarySugar)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryEnergyConsumed)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryProtein)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryVitaminA)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryVitaminB6)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryVitaminB12)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryVitaminC)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryVitaminD)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryVitaminE)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryVitaminK)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryCalcium)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryIron)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryThiamin)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryRiboflavin)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryNiacin)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryFolate)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryBiotin)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryPantothenicAcid)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryPhosphorus)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryIodine)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryMagnesium)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryZinc)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietarySelenium)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryCopper)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryManganese)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryChromium)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryMolybdenum)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryChloride)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryPotassium)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryCaffeine)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.dietaryWater)!, + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.uvExposure)! ) //not writable static let healthKitQuantityLockedTypes: Set = Set(arrayLiteral: - HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierNikeFuel)! + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.nikeFuel)! ) static let healthKitCorrelationTypes: Set = Set(arrayLiteral: - HKObjectType.correlationTypeForIdentifier(HKCorrelationTypeIdentifierBloodPressure)!, - HKObjectType.correlationTypeForIdentifier(HKCorrelationTypeIdentifierFood)! + HKObjectType.correlationType(forIdentifier: HKCorrelationTypeIdentifier.bloodPressure)!, + HKObjectType.correlationType(forIdentifier: HKCorrelationTypeIdentifier.food)! ) static let workoutType = HKObjectType.workoutType() static func allTypes() -> Set { var allTypes : Set = Set() - allTypes.unionInPlace(healthKitCharacteristicsTypes as Set!) - allTypes.unionInPlace(healthKitQuantityTypes as Set!) - allTypes.unionInPlace(healthKitCategoryTypes as Set!) - allTypes.unionInPlace(healthKitCorrelationTypes as Set!) + allTypes.formUnion((healthKitCharacteristicsTypes as Set?)!) + allTypes.formUnion((healthKitQuantityTypes as Set?)!) + allTypes.formUnion((healthKitCategoryTypes as Set?)!) + allTypes.formUnion((healthKitCorrelationTypes as Set?)!) allTypes.insert(workoutType) return allTypes } static func authorizationReadTypes() -> Set { var authTypes : Set = Set() - authTypes.unionInPlace(HealthKitConstants.healthKitCharacteristicsTypes as Set!) - authTypes.unionInPlace(HealthKitConstants.healthKitQuantityTypes as Set!) - authTypes.unionInPlace(HealthKitConstants.healthKitQuantityLockedTypes as Set!) - authTypes.unionInPlace(HealthKitConstants.healthKitCategoryTypes as Set!) - authTypes.unionInPlace(HealthKitConstants.healthKitCategoryLockedTypes as Set!) + authTypes.formUnion((HealthKitConstants.healthKitCharacteristicsTypes as Set?)!) + authTypes.formUnion((HealthKitConstants.healthKitQuantityTypes as Set?)!) + authTypes.formUnion((HealthKitConstants.healthKitQuantityLockedTypes as Set?)!) + authTypes.formUnion((HealthKitConstants.healthKitCategoryTypes as Set?)!) + authTypes.formUnion((HealthKitConstants.healthKitCategoryLockedTypes as Set?)!) authTypes.insert(HealthKitConstants.workoutType) return authTypes } static func authorizationWriteTypes() -> Set { var authTypes : Set = Set() - authTypes.unionInPlace(HealthKitConstants.healthKitQuantityTypes as Set!) - authTypes.unionInPlace(HealthKitConstants.healthKitCategoryTypes as Set!) + authTypes.formUnion((HealthKitConstants.healthKitQuantityTypes as Set?)!) + authTypes.formUnion((HealthKitConstants.healthKitCategoryTypes as Set?)!) authTypes.insert(HealthKitConstants.workoutType) return authTypes } diff --git a/Pod/Classes/HealthKitDataExport.swift b/Pod/Classes/HealthKitDataExport.swift index d26ae54..cc3ed9d 100644 --- a/Pod/Classes/HealthKitDataExport.swift +++ b/Pod/Classes/HealthKitDataExport.swift @@ -10,13 +10,13 @@ import Foundation import HealthKit /// Export errors -public enum ExportError: ErrorType { +public enum ExportError: Error { /// if health is not available on the device - case HealthDataNotAvailable + case healthDataNotAvailable /// in case of illegal arguments - case IllegalArgumentError(String) + case illegalArgumentError(String) /// in case of error during output - case DataWriteError(String?) + case dataWriteError(String?) } /// what data should be exported @@ -32,11 +32,11 @@ public enum HealthDataToExportType : String { public static let allValues = [ALL, ADDED_BY_THIS_APP, GENERATED_BY_THIS_APP]; } -public typealias ExportCompletion = (ErrorType?) -> Void -public typealias ExportProgress = (message: String, progressInPercent: NSNumber?) -> Void +public typealias ExportCompletion = (Error?) -> Void +public typealias ExportProgress = (_ message: String, _ progressInPercent: NSNumber?) -> Void -class ExportOperation: NSOperation { +class ExportOperation: Operation { var exportConfiguration: ExportConfiguration var exportTargets: [ExportTarget] @@ -50,8 +50,8 @@ class ExportOperation: NSOperation { exportTargets: [ExportTarget], healthStore: HKHealthStore, dataExporter: [DataExporter], - onProgress: ExportProgress, - onError: ExportCompletion, + onProgress: @escaping ExportProgress, + onError: @escaping ExportCompletion, completionBlock: (() -> Void)? ) { @@ -63,7 +63,7 @@ class ExportOperation: NSOperation { self.onError = onError super.init() self.completionBlock = completionBlock - self.qualityOfService = NSQualityOfService.UserInteractive + self.qualityOfService = QualityOfService.userInteractive } override func main() { @@ -75,8 +75,8 @@ class ExportOperation: NSOperation { let exporterCount = Double(dataExporter.count) - for (index, exporter) in dataExporter.enumerate() { - self.onProgress(message: exporter.message, progressInPercent: Double(index)/exporterCount) + for (index, exporter) in dataExporter.enumerated() { + self.onProgress(exporter.message, Double(index)/exporterCount as NSNumber) try exporter.export(healthStore, exportTargets: exportTargets) } @@ -84,7 +84,7 @@ class ExportOperation: NSOperation { try exportTarget.endExport(); } - self.onProgress(message: "export done", progressInPercent: 1.0) + self.onProgress("export done", 1.0) } catch let err { self.onError(err) } @@ -93,10 +93,10 @@ class ExportOperation: NSOperation { } /// exporter for healthkit data -public class HealthKitDataExporter { +open class HealthKitDataExporter { - let exportQueue: NSOperationQueue = { - var queue = NSOperationQueue() + let exportQueue: OperationQueue = { + var queue = OperationQueue() queue.name = "export queue" queue.maxConcurrentOperationCount = 1 return queue @@ -116,51 +116,86 @@ public class HealthKitDataExporter { - Parameter onProgress: callback for progress informations - Parameter onCompletion: callback if the export is done or aborted with an Error. */ - public func export(exportTargets exportTargets: [ExportTarget], exportConfiguration: ExportConfiguration, onProgress: ExportProgress, onCompletion: ExportCompletion) -> Void { + open func export(exportTargets: [ExportTarget], exportConfiguration: ExportConfiguration, onProgress: @escaping ExportProgress, onCompletion: @escaping ExportCompletion) -> Void { if !HKHealthStore.isHealthDataAvailable() { - onCompletion(ExportError.HealthDataNotAvailable) + onCompletion(ExportError.healthDataNotAvailable) return } for exportTarget in exportTargets { if(!exportTarget.isValid()){ - onCompletion(ExportError.IllegalArgumentError("invalid export target \(exportTarget)")) + onCompletion(ExportError.illegalArgumentError("invalid export target \(exportTarget)")) return } } - - - - healthStore.requestAuthorizationToShareTypes(nil, readTypes: HealthKitConstants.authorizationReadTypes()) { - (success, error) -> Void in - /// TODO success error handling - self.healthStore.preferredUnitsForQuantityTypes(HealthKitConstants.healthKitQuantityTypes) { - (typeMap, error) in - let dataExporter : [DataExporter] = self.getDataExporters(exportConfiguration, typeMap: typeMap) - - let exportOperation = ExportOperation( - exportConfiguration: exportConfiguration, - exportTargets: exportTargets, - healthStore: self.healthStore, - dataExporter: dataExporter, - onProgress: onProgress, - onError: {(err:ErrorType?) -> Void in - onCompletion(err) - }, - completionBlock:{ - onCompletion(nil) - } - ) - - self.exportQueue.addOperation(exportOperation) + if(exportConfiguration.shouldAuthorize){ + healthStore.requestAuthorization(toShare: nil, read: HealthKitConstants.authorizationReadTypes()) { + (success, error) -> Void in + /// TODO success error handling + self.healthStore.preferredUnits(for: HealthKitConstants.healthKitQuantityTypes) { + (typeMap, error) in + + let dataExporter : [DataExporter] = self.getDataExporters(exportConfiguration, typeMap: typeMap) + + let exportOperation = ExportOperation( + exportConfiguration: exportConfiguration, + exportTargets: exportTargets, + healthStore: self.healthStore, + dataExporter: dataExporter, + onProgress: onProgress, + onError: {(err:Error?) -> Void in + onCompletion(err) + }, + completionBlock:{ + onCompletion(nil) + } + ) + + self.exportQueue.addOperation(exportOperation) + } + } + }else{ + + var autorizedTypeMap = [HKQuantityType]() + for type in HealthKitConstants.healthKitQuantityTypes{ +// if self.healthStore.authorizationStatus(for: type) == .sharingAuthorized { + autorizedTypeMap.append(type) +// } } + + let typeMap : [HKQuantityType:HKUnit] = [HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyTemperature)! : HKUnit(from: "degC"), + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount)! : HKUnit(from: "count"), + HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.distanceWalkingRunning)! : HKUnit(from: "km"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.basalEnergyBurned)! : HKUnit(from: "kcal"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.height)! : HKUnit(from: "m"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.heartRate)! : HKUnit(from: "count/min"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bloodGlucose)! : HKUnit(from: "mg/dL"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.walkingHeartRateAverage)! : HKUnit(from: "count/min"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bloodPressureSystolic)! : HKUnit(from: "mmHg"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.restingHeartRate)! : HKUnit(from: "count/min"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bloodPressureDiastolic)! : HKUnit(from: "mmHg"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.oxygenSaturation)! : HKUnit(from: "%"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.numberOfTimesFallen)! : HKUnit(from: "count"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.heartRateVariabilitySDNN)! : HKUnit(from: "ms"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.activeEnergyBurned)! : HKUnit(from: "kcal"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.flightsClimbed)! : HKUnit(from: "count"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyMass)! : HKUnit(from: "kg"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyFatPercentage)! : HKUnit(from: "%"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.peripheralPerfusionIndex)! : HKUnit(from: "%"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.peakExpiratoryFlowRate)! : HKUnit(from: "L/min"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.respiratoryRate)! : HKUnit(from: "count/min"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.inhalerUsage)! : HKUnit(from: "count"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.forcedExpiratoryVolume1)! : HKUnit(from: "L"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.bodyMassIndex)! : HKUnit(from: "count"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.leanBodyMass)! : HKUnit(from: "kg"),HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.basalBodyTemperature)! : HKUnit(from: "degC")] + + + let dataExporter : [DataExporter] = self.getDataExporters(exportConfiguration, typeMap: typeMap) + + let exportOperation = ExportOperation( + exportConfiguration: exportConfiguration, + exportTargets: exportTargets, + healthStore: self.healthStore, + dataExporter: dataExporter, + onProgress: onProgress, + onError: {(err:Error?) -> Void in + onCompletion(err) + }, + completionBlock:{ + onCompletion(nil) + } + ) + + self.exportQueue.addOperation(exportOperation) +// } } + + + } - internal func getDataExporters(exportConfiguration: ExportConfiguration, typeMap: [HKQuantityType : HKUnit]) -> [DataExporter]{ + internal func getDataExporters(_ exportConfiguration: ExportConfiguration, typeMap: [HKQuantityType : HKUnit]) -> [DataExporter]{ var result : [DataExporter] = [] result.append(MetaDataExporter(exportConfiguration: exportConfiguration)) diff --git a/Pod/Classes/HealthKitDataExporters.swift b/Pod/Classes/HealthKitDataExporters.swift index d12da09..26449fd 100644 --- a/Pod/Classes/HealthKitDataExporters.swift +++ b/Pod/Classes/HealthKitDataExporters.swift @@ -11,13 +11,13 @@ import HealthKit /// Protocol that every data export must conform to. internal protocol DataExporter { var message: String {get} - func export(healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws -> Void + func export(_ healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws -> Void } /// convenience base class for dataexporter internal class BaseDataExporter { var healthQueryError: NSError? = nil - var exportError: ErrorType? = nil + var exportError: Error? = nil var exportConfiguration: ExportConfiguration let sortDescriptor = NSSortDescriptor(key: HKSampleSortIdentifierEndDate, ascending: true) @@ -30,7 +30,7 @@ internal class BaseDataExporter { // throw collected errors in the completion block if healthQueryError != nil { print(healthQueryError) - throw ExportError.DataWriteError(healthQueryError?.description) + throw ExportError.dataWriteError(healthQueryError?.description) } if let throwableError = exportError { throw throwableError @@ -43,9 +43,9 @@ internal class MetaDataExporter : BaseDataExporter, DataExporter { internal var message = "exporting metadata" - internal func export(healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { + internal func export(_ healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { for exportTarget in exportTargets { - try exportTarget.writeMetaData(creationDate: NSDate(), profileName: exportConfiguration.profileName, version:"1.0.0") + try exportTarget.writeMetaData(creationDate: Date(), profileName: exportConfiguration.profileName, version:"1.0.0") } } } @@ -55,23 +55,23 @@ internal class UserDataExporter: BaseDataExporter, DataExporter { internal var message = "exporting user data" - internal func export(healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { + internal func export(_ healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { var userData = Dictionary() - if let birthDay = try? healthStore.dateOfBirth() { - userData[HealthKitConstants.DATE_OF_BIRTH] = birthDay + if let birthDay = try? healthStore.dateOfBirthComponents() { + userData[HealthKitConstants.DATE_OF_BIRTH] = birthDay.description as AnyObject } - if let sex = try? healthStore.biologicalSex() where sex.biologicalSex != HKBiologicalSex.NotSet { - userData[HealthKitConstants.BIOLOGICAL_SEX] = sex.biologicalSex.rawValue + if let sex = try? healthStore.biologicalSex(), sex.biologicalSex != HKBiologicalSex.notSet { + userData[HealthKitConstants.BIOLOGICAL_SEX] = sex.biologicalSex.rawValue as AnyObject } - if let bloodType = try? healthStore.bloodType() where bloodType.bloodType != HKBloodType.NotSet { - userData[HealthKitConstants.BLOOD_TYPE] = bloodType.bloodType.rawValue + if let bloodType = try? healthStore.bloodType(), bloodType.bloodType != HKBloodType.notSet { + userData[HealthKitConstants.BLOOD_TYPE] = bloodType.bloodType.rawValue as AnyObject } - if let fitzpatrick = try? healthStore.fitzpatrickSkinType() where fitzpatrick.skinType != HKFitzpatrickSkinType.NotSet { - userData[HealthKitConstants.FITZPATRICK_SKIN_TYPE] = fitzpatrick.skinType.rawValue + if let fitzpatrick = try? healthStore.fitzpatrickSkinType(), fitzpatrick.skinType != HKFitzpatrickSkinType.notSet { + userData[HealthKitConstants.FITZPATRICK_SKIN_TYPE] = fitzpatrick.skinType.rawValue as AnyObject } for exportTarget in exportTargets { @@ -96,27 +96,31 @@ internal class QuantityTypeDataExporter: BaseDataExporter, DataExporter { super.init(exportConfiguration: exportConfiguration) } - func writeResults(results: [HKSample]?, exportTargets: [ExportTarget], error: NSError?) -> Void { + func writeResults(_ results: [HKSample]?, exportTargets: [ExportTarget], error: NSError?) -> Void { if error != nil { self.healthQueryError = error } else { do { for sample in results as! [HKQuantitySample] { - let value = sample.quantity.doubleValueForUnit(self.unit) + let value = sample.quantity.doubleValue(for: self.unit) for exportTarget in exportTargets { var dict: Dictionary = [:] if exportConfiguration.exportUuids { - dict[HealthKitConstants.UUID] = sample.UUID.UUIDString + dict[HealthKitConstants.UUID] = sample.uuid.uuidString as AnyObject } - dict[HealthKitConstants.S_DATE] = sample.startDate - dict[HealthKitConstants.VALUE] = value - dict[HealthKitConstants.UNIT] = unit.description + dict[HealthKitConstants.S_DATE] = sample.startDate as AnyObject + dict[HealthKitConstants.VALUE] = value as AnyObject + dict[HealthKitConstants.UNIT] = unit.description as AnyObject if sample.startDate != sample.endDate { - dict[HealthKitConstants.E_DATE] = sample.endDate + dict[HealthKitConstants.E_DATE] = sample.endDate as AnyObject } + if let context = sample.metadata?[HKMetadataKeyHeartRateMotionContext] as? NSNumber{ + dict[HealthKitConstants.META_DATA] = context as AnyObject + } + dict[HealthKitConstants.SOURCE] = sample.sourceRevision.source.name as AnyObject try exportTarget.writeDictionary(dict); } } @@ -126,9 +130,9 @@ internal class QuantityTypeDataExporter: BaseDataExporter, DataExporter { } } - func anchorQuery(healthStore: HKHealthStore, exportTargets: [ExportTarget], anchor : HKQueryAnchor?) throws -> (anchor:HKQueryAnchor?, count:Int?) { + func anchorQuery(_ healthStore: HKHealthStore, exportTargets: [ExportTarget], anchor : HKQueryAnchor?) throws -> (anchor:HKQueryAnchor?, count:Int?) { - let semaphore = dispatch_semaphore_create(0) + let semaphore = DispatchSemaphore(value: 0) var resultAnchor: HKQueryAnchor? var resultCount: Int? let query = HKAnchoredObjectQuery( @@ -137,16 +141,16 @@ internal class QuantityTypeDataExporter: BaseDataExporter, DataExporter { anchor: anchor , limit: queryCountLimit) { (query, results, deleted, newAnchor, error) -> Void in - self.writeResults(results, exportTargets: exportTargets, error: error) + self.writeResults(results, exportTargets: exportTargets, error: error as? NSError) resultAnchor = newAnchor resultCount = results?.count - dispatch_semaphore_signal(semaphore) + semaphore.signal() } - healthStore.executeQuery(query) + healthStore.execute(query) - dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER) + semaphore.wait(timeout: DispatchTime.distantFuture) try rethrowCollectedErrors() @@ -154,7 +158,7 @@ internal class QuantityTypeDataExporter: BaseDataExporter, DataExporter { } - internal func export(healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { + internal func export(_ healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { for exportTarget in exportTargets { try exportTarget.startWriteType(type) } @@ -183,22 +187,22 @@ internal class CategoryTypeDataExporter: BaseDataExporter, DataExporter { super.init(exportConfiguration: exportConfiguration) } - func writeResults(results: [HKCategorySample], exportTargets: [ExportTarget], error: NSError?) -> Void { + func writeResults(_ results: [HKCategorySample]?, exportTargets: [ExportTarget], error: NSError?) -> Void { if error != nil { self.healthQueryError = error } else { do { - for sample in results { + for sample in results ?? [HKCategorySample]() { for exportTarget in exportTargets { var dict: Dictionary = [:] if exportConfiguration.exportUuids { - dict[HealthKitConstants.UUID] = sample.UUID.UUIDString + dict[HealthKitConstants.UUID] = sample.uuid.uuidString as AnyObject } - dict[HealthKitConstants.S_DATE] = sample.startDate - dict[HealthKitConstants.VALUE] = sample.value + dict[HealthKitConstants.S_DATE] = sample.startDate as AnyObject + dict[HealthKitConstants.VALUE] = sample.value as AnyObject if sample.startDate != sample.endDate { - dict[HealthKitConstants.E_DATE] = sample.endDate + dict[HealthKitConstants.E_DATE] = sample.endDate as AnyObject } try exportTarget.writeDictionary(dict); } @@ -209,9 +213,9 @@ internal class CategoryTypeDataExporter: BaseDataExporter, DataExporter { } } - func anchorQuery(healthStore: HKHealthStore, exportTargets: [ExportTarget], anchor : HKQueryAnchor?) throws -> (anchor:HKQueryAnchor?, count:Int?) { + func anchorQuery(_ healthStore: HKHealthStore, exportTargets: [ExportTarget], anchor : HKQueryAnchor?) throws -> (anchor:HKQueryAnchor?, count:Int?) { - let semaphore = dispatch_semaphore_create(0) + let semaphore = DispatchSemaphore(value: 0) var resultAnchor: HKQueryAnchor? var resultCount: Int? let query = HKAnchoredObjectQuery( @@ -219,17 +223,31 @@ internal class CategoryTypeDataExporter: BaseDataExporter, DataExporter { predicate: exportConfiguration.getPredicate(), anchor: anchor , limit: queryCountLimit) { (query, results, deleted, newAnchor, error) -> Void in - - self.writeResults(results as! [HKCategorySample], exportTargets: exportTargets, error: error) + + if(error != nil){ + if (error as! NSError).code == 5 { + self.writeResults(results as? [HKCategorySample], exportTargets: exportTargets, error: nil) + resultAnchor = newAnchor + resultCount = results?.count ?? 0 + semaphore.signal() + }else{ + self.writeResults(results as? [HKCategorySample], exportTargets: exportTargets, error: error as? NSError) + resultAnchor = newAnchor + resultCount = results?.count ?? 0 + semaphore.signal() + } + }else{ + self.writeResults(results as? [HKCategorySample], exportTargets: exportTargets, error: nil) - resultAnchor = newAnchor - resultCount = results?.count - dispatch_semaphore_signal(semaphore) + resultAnchor = newAnchor + resultCount = results?.count ?? 0 + semaphore.signal() + } } - healthStore.executeQuery(query) + healthStore.execute(query) - dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER) + semaphore.wait(timeout: DispatchTime.distantFuture) try rethrowCollectedErrors() @@ -237,7 +255,7 @@ internal class CategoryTypeDataExporter: BaseDataExporter, DataExporter { } - internal func export(healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { + internal func export(_ healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { for exportTarget in exportTargets { try exportTarget.startWriteType(type) } @@ -267,7 +285,7 @@ internal class CorrelationTypeDataExporter: BaseDataExporter, DataExporter { super.init(exportConfiguration: exportConfiguration) } - func writeResults(results: [HKCorrelation], exportTargets: [ExportTarget], error: NSError?) -> Void { + func writeResults(_ results: [HKCorrelation], exportTargets: [ExportTarget], error: NSError?) -> Void { if error != nil { self.healthQueryError = error } else { @@ -276,11 +294,11 @@ internal class CorrelationTypeDataExporter: BaseDataExporter, DataExporter { var dict: Dictionary = [:] if exportConfiguration.exportUuids { - dict[HealthKitConstants.UUID] = sample.UUID.UUIDString + dict[HealthKitConstants.UUID] = sample.uuid.uuidString as AnyObject } - dict[HealthKitConstants.S_DATE] = sample.startDate + dict[HealthKitConstants.S_DATE] = sample.startDate as AnyObject if sample.startDate != sample.endDate { - dict[HealthKitConstants.E_DATE] = sample.endDate + dict[HealthKitConstants.E_DATE] = sample.endDate as AnyObject } var subSampleArray:[AnyObject] = [] @@ -289,30 +307,30 @@ internal class CorrelationTypeDataExporter: BaseDataExporter, DataExporter { var sampleDict: Dictionary = [:] if exportConfiguration.exportUuids { - sampleDict[HealthKitConstants.UUID] = subsample.UUID.UUIDString + sampleDict[HealthKitConstants.UUID] = subsample.uuid.uuidString as AnyObject } - sampleDict[HealthKitConstants.S_DATE] = subsample.startDate + sampleDict[HealthKitConstants.S_DATE] = subsample.startDate as AnyObject if subsample.startDate != subsample.endDate { - sampleDict[HealthKitConstants.E_DATE] = subsample.endDate + sampleDict[HealthKitConstants.E_DATE] = subsample.endDate as AnyObject } - sampleDict[HealthKitConstants.TYPE] = subsample.sampleType.identifier + sampleDict[HealthKitConstants.TYPE] = subsample.sampleType.identifier as AnyObject if let quantitySample = subsample as? HKQuantitySample { let unit = self.typeMap[quantitySample.quantityType]! - sampleDict[HealthKitConstants.UNIT] = unit.description - sampleDict[HealthKitConstants.VALUE] = quantitySample.quantity.doubleValueForUnit(unit) + sampleDict[HealthKitConstants.UNIT] = unit.description as AnyObject + sampleDict[HealthKitConstants.VALUE] = quantitySample.quantity.doubleValue(for: unit) as AnyObject } else if let categorySample = subsample as? HKCategorySample { - sampleDict[HealthKitConstants.VALUE] = categorySample.value + sampleDict[HealthKitConstants.VALUE] = categorySample.value as AnyObject } else { - throw ExportError.IllegalArgumentError("unsupported correlation type \(subsample.sampleType.identifier)") + throw ExportError.illegalArgumentError("unsupported correlation type \(subsample.sampleType.identifier)") } - subSampleArray.append(sampleDict) + subSampleArray.append(sampleDict as AnyObject) } - dict[HealthKitConstants.OBJECTS] = subSampleArray + dict[HealthKitConstants.OBJECTS] = subSampleArray as AnyObject for exportTarget in exportTargets { try exportTarget.writeDictionary(dict); @@ -325,9 +343,9 @@ internal class CorrelationTypeDataExporter: BaseDataExporter, DataExporter { } } - func anchorQuery(healthStore: HKHealthStore, exportTargets: [ExportTarget], anchor : HKQueryAnchor?) throws -> (anchor:HKQueryAnchor?, count:Int?) { + func anchorQuery(_ healthStore: HKHealthStore, exportTargets: [ExportTarget], anchor : HKQueryAnchor?) throws -> (anchor:HKQueryAnchor?, count:Int?) { - let semaphore = dispatch_semaphore_create(0) + let semaphore = DispatchSemaphore(value: 0) var resultAnchor: HKQueryAnchor? var resultCount: Int? let query = HKAnchoredObjectQuery( @@ -337,23 +355,23 @@ internal class CorrelationTypeDataExporter: BaseDataExporter, DataExporter { limit: queryCountLimit) { (query, results, deleted, newAnchor, error) -> Void in - self.writeResults(results as! [HKCorrelation], exportTargets: exportTargets, error: error) + self.writeResults(results as! [HKCorrelation], exportTargets: exportTargets, error: error as? NSError) resultAnchor = newAnchor resultCount = results?.count - dispatch_semaphore_signal(semaphore) + semaphore.signal() } - healthStore.executeQuery(query) + healthStore.execute(query) - dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER) + semaphore.wait(timeout: DispatchTime.distantFuture) try rethrowCollectedErrors() return (anchor:resultAnchor, count: resultCount) } - internal func export(healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { + internal func export(_ healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { for exportTarget in exportTargets { try exportTarget.startWriteType(type) } @@ -375,7 +393,7 @@ internal class CorrelationTypeDataExporter: BaseDataExporter, DataExporter { internal class WorkoutDataExporter: BaseDataExporter, DataExporter { internal var message = "exporting workouts data" - func writeResults(results: [HKWorkout], exportTargets:[ExportTarget], error: NSError?) -> Void { + func writeResults(_ results: [HKWorkout], exportTargets:[ExportTarget], error: NSError?) -> Void { if error != nil { self.healthQueryError = error } else { @@ -388,27 +406,27 @@ internal class WorkoutDataExporter: BaseDataExporter, DataExporter { var dict: Dictionary = [:] if exportConfiguration.exportUuids { - dict[HealthKitConstants.UUID] = sample.UUID.UUIDString + dict[HealthKitConstants.UUID] = sample.uuid.uuidString as AnyObject } - dict[HealthKitConstants.WORKOUT_ACTIVITY_TYPE] = sample.workoutActivityType.rawValue - dict[HealthKitConstants.S_DATE] = sample.startDate + dict[HealthKitConstants.WORKOUT_ACTIVITY_TYPE] = sample.workoutActivityType.rawValue as AnyObject + dict[HealthKitConstants.S_DATE] = sample.startDate as AnyObject if sample.startDate != sample.endDate { - dict[HealthKitConstants.E_DATE] = sample.endDate + dict[HealthKitConstants.E_DATE] = sample.endDate as AnyObject } - dict[HealthKitConstants.DURATION] = sample.duration // seconds - dict[HealthKitConstants.TOTAL_DISTANCE] = sample.totalDistance?.doubleValueForUnit(HKUnit.meterUnit()) - dict[HealthKitConstants.TOTAL_ENERGY_BURNED] = sample.totalEnergyBurned?.doubleValueForUnit(HKUnit.kilocalorieUnit()) + dict[HealthKitConstants.DURATION] = sample.duration as AnyObject // seconds + dict[HealthKitConstants.TOTAL_DISTANCE] = sample.totalDistance?.doubleValue(for: HKUnit.meter()) as AnyObject + dict[HealthKitConstants.TOTAL_ENERGY_BURNED] = sample.totalEnergyBurned?.doubleValue(for: HKUnit.kilocalorie()) as AnyObject var workoutEvents: [Dictionary] = [] for event in sample.workoutEvents ?? [] { var workoutEvent: Dictionary = [:] - workoutEvent[HealthKitConstants.TYPE] = event.type.rawValue - workoutEvent[HealthKitConstants.S_DATE] = event.date + workoutEvent[HealthKitConstants.TYPE] = event.type.rawValue as AnyObject + workoutEvent[HealthKitConstants.S_DATE] = event.date as AnyObject workoutEvents.append(workoutEvent) } - dict[HealthKitConstants.WORKOUT_EVENTS] = workoutEvents + dict[HealthKitConstants.WORKOUT_EVENTS] = workoutEvents as AnyObject for exportTarget in exportTargets { try exportTarget.writeDictionary(dict); @@ -426,20 +444,31 @@ internal class WorkoutDataExporter: BaseDataExporter, DataExporter { } - internal func export(healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { + internal func export(_ healthStore: HKHealthStore, exportTargets: [ExportTarget]) throws { - let semaphore = dispatch_semaphore_create(0) + let semaphore = DispatchSemaphore(value: 0) let query = HKSampleQuery(sampleType: HKObjectType.workoutType(), predicate: exportConfiguration.getPredicate(), limit: Int(HKObjectQueryNoLimit), sortDescriptors: [sortDescriptor]) { (query, results, error) -> Void in - self.writeResults(results as! [HKWorkout], exportTargets:exportTargets, error:error) - dispatch_semaphore_signal(semaphore) + if(error != nil){ + if (error! as NSError).code == 5 { + self.writeResults([HKWorkout](), exportTargets:exportTargets, error:nil) + semaphore.signal() + }else{ + self.writeResults([HKWorkout](), exportTargets:exportTargets, error:error as NSError?) + semaphore.signal() + } + }else{ + self.writeResults(results as! [HKWorkout], exportTargets:exportTargets, error:error as NSError?) + semaphore.signal() + } + } - healthStore.executeQuery(query) + healthStore.execute(query) // wait for asyn call to complete - dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER) + semaphore.wait(timeout: DispatchTime.distantFuture) try rethrowCollectedErrors() } -} \ No newline at end of file +} diff --git a/Pod/Classes/HealthKitDataImporter.swift b/Pod/Classes/HealthKitDataImporter.swift index b8711bf..59709b0 100644 --- a/Pod/Classes/HealthKitDataImporter.swift +++ b/Pod/Classes/HealthKitDataImporter.swift @@ -24,7 +24,7 @@ class MetaDataOutputJsonHandler: DefaultJsonHandler { return metaDataDict } - override func name(name: String) { + override func name(_ name: String) { self.name = name } @@ -39,12 +39,12 @@ class MetaDataOutputJsonHandler: DefaultJsonHandler { } } - override func stringValue(value: String){ + override func stringValue(_ value: String){ if collectProperties { - metaDataDict[name!] = value + metaDataDict[name!] = value as AnyObject } } - override func numberValue(value: NSNumber){ + override func numberValue(_ value: NSNumber){ if collectProperties { metaDataDict[name!] = value } @@ -75,48 +75,48 @@ class SampleOutputJsonHandler: JsonHandlerProtocol { self.parent = parent } - func put(key:String, value: AnyObject?) { + func put(_ key:String, value: AnyObject?) { dict[key] = value } - func createArrayContext(name: String) -> SampleContext { - let sc = SampleContext(parent: self, type: .ARRAY) + func createArrayContext(_ name: String) -> SampleContext { + let sc = SampleContext(parent: self, type: .array) sc.name = name childs.append(sc) return sc } func createObjectContext() -> SampleContext { - let sc = SampleContext(parent: self, type: .OBJECT) + let sc = SampleContext(parent: self, type: .object) childs.append(sc) return sc } func getStructureAsDict() -> AnyObject { - if type == .ARRAY { + if type == .array { var result:[AnyObject] = [] for child in childs { result.append(child.getStructureAsDict()) } - return result; + return result as AnyObject; } var resultDict = dict for child in childs { - if child.type == .ARRAY { - resultDict[child.name!] = child.getStructureAsDict() as AnyObject! + if child.type == .array { + resultDict[child.name!] = child.getStructureAsDict() as AnyObject? } } - return resultDict + return resultDict as AnyObject } } - internal func printWithLevel(level:Int, string:String){ + internal func printWithLevel(_ level:Int, string:String){ var outString = "\(level)" - for var i=0; i Void + let onSample : (_ sample: AnyObject, _ typeName:String) -> Void /// save the lastname to decide what is a sample and what is the name of a value var lastName = "" /// a samplecontext - created for evenry new sample @@ -134,16 +134,16 @@ class SampleOutputJsonHandler: JsonHandlerProtocol { /// the healthkit sample type that is currently processed var hkTypeName: String? = nil - init(onSample: (sample: AnyObject, typeName:String) -> Void) { + init(onSample: @escaping (_ sample: AnyObject, _ typeName:String) -> Void) { self.onSample = onSample } - func name(name: String) { + func name(_ name: String) { lastName = name } func startArray() { - level++ + level += 1 if level == 2 && lastName.hasPrefix("HK") { hkTypeName = lastName } @@ -157,17 +157,17 @@ class SampleOutputJsonHandler: JsonHandlerProtocol { if level == 2 { hkTypeName = nil } - level-- + level -= 1 sampleContext = sampleContext == nil ? nil : sampleContext!.parent } func startObject() { - level++ + level += 1 if level == 3 { // a new HKSample starts - sampleContext = SampleContext(parent: nil, type: .OBJECT) + sampleContext = SampleContext(parent: nil, type: .object) sampleContext?.name = hkTypeName } @@ -179,26 +179,26 @@ class SampleOutputJsonHandler: JsonHandlerProtocol { func endObject() { if level == 3 { // the HKSample ends - onSample(sample: sampleContext!.getStructureAsDict(), typeName:hkTypeName!) + onSample(sampleContext!.getStructureAsDict(), hkTypeName!) sampleContext = nil } sampleContext = sampleContext == nil ? nil : sampleContext!.parent - level-- + level -= 1 } - func stringValue(value: String){ + func stringValue(_ value: String){ if sampleContext != nil { - sampleContext!.put(lastName, value:value) + sampleContext!.put(lastName, value:value as AnyObject) } } - func boolValue(value: Bool){ + func boolValue(_ value: Bool){ if sampleContext != nil { - sampleContext!.put(lastName, value:value) + sampleContext!.put(lastName, value:value as AnyObject) } } - func numberValue(value: NSNumber){ + func numberValue(_ value: NSNumber){ if sampleContext != nil { sampleContext!.put(lastName, value:value) } @@ -213,4 +213,4 @@ class SampleOutputJsonHandler: JsonHandlerProtocol { func shouldCancelReadingTheJson() -> Bool { return false } -} \ No newline at end of file +} diff --git a/Pod/Classes/HealthKitProfile.swift b/Pod/Classes/HealthKitProfile.swift index c8468d1..4fd464e 100644 --- a/Pod/Classes/HealthKitProfile.swift +++ b/Pod/Classes/HealthKitProfile.swift @@ -9,30 +9,30 @@ import Foundation import HealthKit ///MetaData of a profile -public class HealthKitProfileMetaData { +open class HealthKitProfileMetaData { /// the name of the profile - private(set) public var profileName: String? + fileprivate(set) open var profileName: String? /// the date the profie was exported - private(set) public var creationDate: NSDate? + fileprivate(set) open var creationDate: Date? /// the version of the profile - private(set) public var version: String? + fileprivate(set) open var version: String? /// the type of the profile - private(set) public var type: String? + fileprivate(set) open var type: String? } /// a healthkit Profile - can be used to read data from the profile and import the profile into the healthkit store. -public class HealthKitProfile : CustomStringConvertible { +open class HealthKitProfile : CustomStringConvertible { - let fileAtPath: NSURL + let fileAtPath: URL /// the name of the profile file - without any path components - private(set) public var fileName: String + fileprivate(set) open var fileName: String /// the size of the profile file in bytes - private(set) public var fileSize:UInt64? + fileprivate(set) open var fileSize:UInt64? - let fileReadQueue = NSOperationQueue() + let fileReadQueue = OperationQueue() /// for textual representation of this object - public var description: String { + open var description: String { return "\(fileName) \(fileSize)" } @@ -40,19 +40,19 @@ public class HealthKitProfile : CustomStringConvertible { constructor for aprofile - Parameter fileAtPath: the Url of the profile in the file system */ - public init(fileAtPath: NSURL){ + public init(fileAtPath: URL){ fileReadQueue.maxConcurrentOperationCount = 1 - fileReadQueue.qualityOfService = NSQualityOfService.UserInteractive + fileReadQueue.qualityOfService = QualityOfService.userInteractive self.fileAtPath = fileAtPath - self.fileName = self.fileAtPath.lastPathComponent! - let attr:NSDictionary? = try! NSFileManager.defaultManager().attributesOfItemAtPath(fileAtPath.path!) + self.fileName = self.fileAtPath.lastPathComponent + let attr:NSDictionary? = try! FileManager.default.attributesOfItem(atPath: fileAtPath.path) as NSDictionary if let _attr = attr { self.fileSize = _attr.fileSize(); } } /** - Load the MetaData of a profile. If the metadata have been readed the reading is + Load the MetaData of a profile. If the metadata have been readed the reading is interrupted - by this way also very large files are supported to. - Returns: the HealthKitProfileMetaData that were read from the profile. */ @@ -60,12 +60,12 @@ public class HealthKitProfile : CustomStringConvertible { let result = HealthKitProfileMetaData() let metaDataOutput = MetaDataOutputJsonHandler() - JsonReader.readFileAtPath(self.fileAtPath.path!, withJsonHandler: metaDataOutput) + JsonReader.readFileAtPath(self.fileAtPath.path, withJsonHandler: metaDataOutput) let metaData = metaDataOutput.getMetaData() if let dateTime = metaData["creationDate"] as? NSNumber { - result.creationDate = NSDate(timeIntervalSince1970: dateTime.doubleValue/1000) + result.creationDate = Date(timeIntervalSince1970: dateTime.doubleValue/1000) } result.profileName = metaData["profileName"] as? String @@ -81,14 +81,14 @@ public class HealthKitProfile : CustomStringConvertible { - Parameter asynchronous: if true the metsdata wil be read asynchronously. If false the read will be synchronous. - Parameter callback: is called if the meatdat have been read. */ - public func loadMetaData(asynchronous:Bool, callback:(metaData: HealthKitProfileMetaData) -> Void ){ + open func loadMetaData(_ asynchronous:Bool, callback:@escaping (_ metaData: HealthKitProfileMetaData) -> Void ){ if asynchronous { - fileReadQueue.addOperationWithBlock(){ - callback(metaData: self.loadMetaData()) + fileReadQueue.addOperation(){ + callback(self.loadMetaData()) } } else { - callback(metaData: loadMetaData()) + callback(loadMetaData()) } } @@ -96,7 +96,7 @@ public class HealthKitProfile : CustomStringConvertible { Reads all samples from the profile and fires the callback onSample on every sample. - Parameter onSample: the callback is called on every sample. */ - func importSamples(onSample: (sample: HKSample) -> Void) throws { + func importSamples(_ onSample: @escaping (_ sample: HKSample) -> Void) throws { let sampleImportHandler = SampleOutputJsonHandler(){ (sampleDict:AnyObject, typeName: String) in @@ -104,18 +104,18 @@ public class HealthKitProfile : CustomStringConvertible { if let creator = SampleCreatorRegistry.get(typeName) { let sampleOpt:HKSample? = creator.createSample(sampleDict) if let sample = sampleOpt { - onSample(sample: sample) + onSample(sample) } } } - JsonReader.readFileAtPath(self.fileAtPath.path!, withJsonHandler: sampleImportHandler) + JsonReader.readFileAtPath(self.fileAtPath.path, withJsonHandler: sampleImportHandler) } /** removes the profile from the file system */ - public func deleteFile() throws { - try NSFileManager.defaultManager().removeItemAtPath(fileAtPath.path!) + open func deleteFile() throws { + try FileManager.default.removeItem(atPath: fileAtPath.path) } -} \ No newline at end of file +} diff --git a/Pod/Classes/HealthKitProfileImporter.swift b/Pod/Classes/HealthKitProfileImporter.swift index 6bfb52a..bb9f09b 100644 --- a/Pod/Classes/HealthKitProfileImporter.swift +++ b/Pod/Classes/HealthKitProfileImporter.swift @@ -10,24 +10,24 @@ import Foundation import HealthKit /// errors the importer can create -public enum ImportError: ErrorType { +public enum ImportError: Error { /// the type of the profle is not supported - case UnsupportedType(String) + case unsupportedType(String) /// HealthKit is not available on the device - case HealthDataNotAvailable + case healthDataNotAvailable } /// importer for a healthkit profile -public class HealthKitProfileImporter { +open class HealthKitProfileImporter { let healthStore: HKHealthStore - let importQueue = NSOperationQueue() + let importQueue = OperationQueue() /// provide your instance of the HKHealthStore public init(healthStore: HKHealthStore) { self.healthStore = healthStore self.importQueue.maxConcurrentOperationCount = 1 - self.importQueue.qualityOfService = NSQualityOfService.UserInteractive + self.importQueue.qualityOfService = QualityOfService.userInteractive } /** @@ -38,28 +38,28 @@ public class HealthKitProfileImporter { - Parameter onProgress: callback for progress messages - Parameter onCompletion: callback if the import has finished. The error is nl if everything went well. */ - public func importProfile ( - profile: HealthKitProfile, + open func importProfile ( + _ profile: HealthKitProfile, deleteExistingData: Bool, - onProgress: (message: String, progressInPercent: NSNumber?)->Void, - onCompletion: (error: ErrorType?)-> Void) { + onProgress: @escaping (_ message: String, _ progressInPercent: NSNumber?)->Void, + onCompletion: @escaping (_ error: Error?)-> Void) { if !HKHealthStore.isHealthDataAvailable() { - onCompletion(error:ImportError.HealthDataNotAvailable) + onCompletion(ImportError.healthDataNotAvailable) return } - healthStore.requestAuthorizationToShareTypes(HealthKitConstants.authorizationWriteTypes(), readTypes: nil) { + healthStore.requestAuthorization(toShare: HealthKitConstants.authorizationWriteTypes(), read: nil) { (success, error) -> Void in /// TODO success error handling - self.importQueue.addOperationWithBlock(){ + self.importQueue.addOperation(){ // check that the type is one pf the supported profile types let metaData = profile.loadMetaData() - let strExpectedType = String(JsonSingleDocExportTarget) + let strExpectedType = String(describing: JsonSingleDocExportTarget.self) if metaData.type != strExpectedType { - onCompletion(error: ImportError.UnsupportedType("\(strExpectedType) is only supported")) + onCompletion(ImportError.unsupportedType("\(strExpectedType) is only supported")) return } @@ -67,37 +67,37 @@ public class HealthKitProfileImporter { if deleteExistingData { HealthKitStoreCleaner(healthStore: self.healthStore).clean(){(message:String, progressInPercent: Double?) in - onProgress(message: message, progressInPercent: progressInPercent == nil ? nil : progressInPercent!/2) + onProgress(message, progressInPercent == nil ? nil : NSNumber(value: progressInPercent!/2)) } } - onProgress(message: "Start importing", progressInPercent: nil) + onProgress("Start importing", nil) var lastSampleType = "" try! profile.importSamples(){ (sample: HKSample) in //print(sample) - if lastSampleType != String(sample.sampleType) { - lastSampleType = String(sample.sampleType) - onProgress(message: "importing \(lastSampleType)", progressInPercent: nil) + if lastSampleType != String(describing: sample.sampleType) { + lastSampleType = String(describing: sample.sampleType) + onProgress("importing \(lastSampleType)", nil) } - self.healthStore.saveObject(sample){ - (success:Bool, error:NSError?) in + self.healthStore.save(sample, withCompletion: { + (success:Bool, error:Error?) in /// TODO success error handling print(success, error) if !success { print(error) } - } + }) } - onProgress(message: "Import done", progressInPercent: 1.0) + onProgress("Import done", 1.0) - onCompletion(error:nil) + onCompletion(nil) } } } -} \ No newline at end of file +} diff --git a/Pod/Classes/HealthKitProfileReader.swift b/Pod/Classes/HealthKitProfileReader.swift index f51984c..5931619 100644 --- a/Pod/Classes/HealthKitProfileReader.swift +++ b/Pod/Classes/HealthKitProfileReader.swift @@ -9,20 +9,20 @@ import Foundation /// Utility class to generate Profiles from files in a directory -public class HealthKitProfileReader { +open class HealthKitProfileReader { /** Creates an array of profiles that are stored in a folder - Parameter folder: Url of the folder - Returns: an array of HealthKitProfile objects */ - public static func readProfilesFromDisk(folder: NSURL) -> [HealthKitProfile]{ + public static func readProfilesFromDisk(_ folder: URL) -> [HealthKitProfile]{ var profiles:[HealthKitProfile] = [] - let enumerator = NSFileManager.defaultManager().enumeratorAtPath(folder.path!) + let enumerator = FileManager.default.enumerator(atPath: folder.path) for file in enumerator! { - let pathUrl = folder.URLByAppendingPathComponent(file as! String) - if NSFileManager.defaultManager().isReadableFileAtPath(pathUrl.path!) && pathUrl.pathExtension == "hsg" { + let pathUrl = folder.appendingPathComponent(file as! String) + if FileManager.default.isReadableFile(atPath: pathUrl.path) && pathUrl.pathExtension == "hsg" { profiles.append(HealthKitProfile(fileAtPath:pathUrl)) } } @@ -30,4 +30,4 @@ public class HealthKitProfileReader { return profiles } -} \ No newline at end of file +} diff --git a/Pod/Classes/HealthKitStoreCleaner.swift b/Pod/Classes/HealthKitStoreCleaner.swift index 972e18f..9842017 100644 --- a/Pod/Classes/HealthKitStoreCleaner.swift +++ b/Pod/Classes/HealthKitStoreCleaner.swift @@ -8,6 +8,30 @@ import Foundation import HealthKit +// FIXME: comparison operators with optionals were removed from the Swift Standard Libary. +// Consider refactoring the code to use the non-optional operators. +fileprivate func < (lhs: T?, rhs: T?) -> Bool { + switch (lhs, rhs) { + case let (l?, r?): + return l < r + case (nil, _?): + return true + default: + return false + } +} + +// FIXME: comparison operators with optionals were removed from the Swift Standard Libary. +// Consider refactoring the code to use the non-optional operators. +fileprivate func > (lhs: T?, rhs: T?) -> Bool { + switch (lhs, rhs) { + case let (l?, r?): + return l > r + default: + return rhs < lhs + } +} + class HealthKitStoreCleaner { @@ -27,18 +51,18 @@ class HealthKitStoreCleaner { Cleans all HealthKIt data from the healthkit store that are created by this app. - Parameter onProgress: callback that informs about the cleaning progress */ - func clean( onProgress: (message: String, progressInPercent: Double?)->Void){ + func clean( _ onProgress: (_ message: String, _ progressInPercent: Double?)->Void){ - let source = HKSource.defaultSource() - let predicate = HKQuery.predicateForObjectsFromSource(source) + let source = HKSource.default() + let predicate = HKQuery.predicateForObjects(from: source) let allTypes = HealthKitConstants.authorizationWriteTypes() for type in allTypes { - let semaphore = dispatch_semaphore_create(0) + let semaphore = DispatchSemaphore(value: 0) - onProgress(message: "deleting \(type)", progressInPercent: nil) + onProgress("deleting \(type)", nil) let queryCountLimit = 1000 var result : (anchor:HKQueryAnchor?, count:Int?) = (anchor:nil, count: -1) @@ -51,30 +75,30 @@ class HealthKitStoreCleaner { (query, results, deleted, newAnchor, error) -> Void in if results?.count > 0 { - self.healthStore.deleteObjects(results!){ - (success:Bool, error:NSError?) -> Void in + self.healthStore.delete(results!, withCompletion: { + (success:Bool, error:Error?) -> Void in if success { print("deleted \(results?.count) from \(type)") } else { print("error deleting from \(type): \(error)") } - dispatch_semaphore_signal(semaphore) - } + semaphore.signal() + }) } else { - dispatch_semaphore_signal(semaphore) + semaphore.signal() } result.anchor = newAnchor result.count = results?.count } - healthStore.executeQuery(query) + healthStore.execute(query) - dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER) + semaphore.wait(timeout: DispatchTime.distantFuture) } while result.count != 0 || result.count==queryCountLimit } } -} \ No newline at end of file +} diff --git a/Pod/Classes/JsonReader.swift b/Pod/Classes/JsonReader.swift index 798a39d..32d50e6 100644 --- a/Pod/Classes/JsonReader.swift +++ b/Pod/Classes/JsonReader.swift @@ -18,10 +18,10 @@ internal class JsonReader { - Parameter jsonString: the json string that should be read. - Returns: an Object of type AnyObject that the json string defines. */ - static func toJsonObject(jsonString: String) -> AnyObject { - let data = jsonString.dataUsingEncoding(NSUTF8StringEncoding)! - let result = try! NSJSONSerialization.JSONObjectWithData(data, options: .AllowFragments) - return result + static func toJsonObject(_ jsonString: String) -> AnyObject { + let data = jsonString.data(using: String.Encoding.utf8)! + let result = try! JSONSerialization.jsonObject(with: data, options: .allowFragments) + return result as AnyObject } /** @@ -30,7 +30,7 @@ internal class JsonReader { - Parameter returnDictForKey: name of the field that should be returned as Dictionary. - Returns: a dictionaray for the key with AnyObject values. */ - static func toJsonObject(jsonString: String, returnDictForKey: String) -> Dictionary { + static func toJsonObject(_ jsonString: String, returnDictForKey: String) -> Dictionary { let keyWithDictInDict = JsonReader.toJsonObject(jsonString) as! Dictionary return keyWithDictInDict[returnDictForKey] as! Dictionary } @@ -41,7 +41,7 @@ internal class JsonReader { - Parameter returnArrayForKey: name of the field that should be returned as an Array. - Returns: an array for the key with AnyObject values. */ - static func toJsonObject(jsonString: String, returnArrayForKey: String) -> [AnyObject] { + static func toJsonObject(_ jsonString: String, returnArrayForKey: String) -> [AnyObject] { let keyWithDictInDict = JsonReader.toJsonObject(jsonString) as! Dictionary return keyWithDictInDict[returnArrayForKey] as! [AnyObject] } @@ -52,19 +52,19 @@ internal class JsonReader { - Parameter withJsonHandler: an object that implements JsonHandlerProtocol to process the json events. */ - static func readFileAtPath(fileAtPath: String, withJsonHandler jsonHandler: JsonHandlerProtocol) -> Void { - let inStream = NSInputStream(fileAtPath: fileAtPath)! + static func readFileAtPath(_ fileAtPath: String, withJsonHandler jsonHandler: JsonHandlerProtocol) -> Void { + let inStream = InputStream(fileAtPath: fileAtPath)! inStream.open() let tokenizer = JsonTokenizer(jsonHandler:jsonHandler) let bufferSize = 4096 - var buffer = Array(count: bufferSize, repeatedValue: 0) + var buffer = Array(repeating: 0, count: bufferSize) while inStream.hasBytesAvailable && !jsonHandler.shouldCancelReadingTheJson() { let bytesRead = inStream.read(&buffer, maxLength: bufferSize) if bytesRead > 0 { - let textFileContents = NSString(bytes: &buffer, length: bytesRead, encoding: NSUTF8StringEncoding) + let textFileContents = NSString(bytes: &buffer, length: bytesRead, encoding: String.Encoding.utf8.rawValue) tokenizer.tokenize(textFileContents as! String) } } @@ -78,7 +78,7 @@ internal class JsonReader { */ internal class JsonReaderContext { var type: JsonContextType - private var parent: JsonReaderContext? + fileprivate var parent: JsonReaderContext? var nameOrObject = "" { didSet { @@ -93,7 +93,7 @@ internal class JsonReaderContext { } init(){ - type = .ROOT + type = .root } convenience init(parent: JsonReaderContext, type: JsonContextType){ @@ -104,12 +104,12 @@ internal class JsonReaderContext { func createArrayContext() -> JsonReaderContext { //print("create array context") - return JsonReaderContext(parent: self, type: .ARRAY) + return JsonReaderContext(parent: self, type: .array) } func createObjectContext() -> JsonReaderContext { //print("create object context") - return JsonReaderContext(parent: self, type: .OBJECT) + return JsonReaderContext(parent: self, type: .object) } func popContext() -> JsonReaderContext { @@ -136,17 +136,17 @@ internal class JsonTokenizer { /** removes the question marks from a string. */ - internal func removeQuestionMarks(str: String) -> String{ + internal func removeQuestionMarks(_ str: String) -> String{ var result = str - result.removeAtIndex(result.startIndex) - result.removeAtIndex(result.endIndex.predecessor()) + result.remove(at: result.startIndex) + result.remove(at: result.index(before: result.endIndex)) return result } /** outputs a name. */ - internal func writeName(context: JsonReaderContext) { + internal func writeName(_ context: JsonReaderContext) { //print("writeName", context.nameOrObject) let name = removeQuestionMarks(context.nameOrObject) jsonHandler.name(name) @@ -157,7 +157,7 @@ internal class JsonTokenizer { /** outputs a value. Value can be a string, a boolean value a null value or a number. */ - internal func writeValue(context: JsonReaderContext){ + internal func writeValue(_ context: JsonReaderContext){ //print("writeValue", context.nameOrObject) let value:String = context.nameOrObject context.nameOrObject = "" @@ -180,9 +180,9 @@ internal class JsonTokenizer { //let number = numberFormatter.numberFromString(value)! if let intValue = Int(value) { - jsonHandler.numberValue(intValue) + jsonHandler.numberValue(NSNumber(value: intValue)) } else if let doubleValue = Double(value) { - jsonHandler.numberValue(doubleValue) + jsonHandler.numberValue(NSNumber(value: doubleValue)) } @@ -209,8 +209,8 @@ internal class JsonTokenizer { /** main tokenizer function. The string may have any size. */ - func tokenize(toTokenize: String) -> Void { - for chr in toTokenize.characters { + func tokenize(_ toTokenize: String) -> Void { + for chr in toTokenize { //print(chr) switch chr { case "\"": @@ -302,13 +302,13 @@ protocol JsonHandlerProtocol { func endObject() // a name was tokenized - func name(name: String) + func name(_ name: String) // a string value was tokenized - func stringValue(value: String) + func stringValue(_ value: String) // a boolean value was tokenized - func boolValue(value: Bool) + func boolValue(_ value: Bool) // a number was tokenized - func numberValue(value: NSNumber) + func numberValue(_ value: NSNumber) // a null value was tokenized func nullValue() @@ -326,10 +326,10 @@ class DefaultJsonHandler : JsonHandlerProtocol { func startObject(){} func endObject(){} - func name(name: String){} - func stringValue(value: String){} - func boolValue(value: Bool){} - func numberValue(value: NSNumber){} + func name(_ name: String){} + func stringValue(_ value: String){} + func boolValue(_ value: Bool){} + func numberValue(_ value: NSNumber){} func nullValue(){} func shouldCancelReadingTheJson() -> Bool { @@ -372,19 +372,19 @@ class JsonStringOutputJsonHandler: DefaultJsonHandler { jw.writeEndObject() } - override func name(name: String){ + override func name(_ name: String){ jw.writeFieldName(name) } - override func stringValue(value: String) { + override func stringValue(_ value: String) { jw.writeString(value) } - override func numberValue(value: NSNumber) { + override func numberValue(_ value: NSNumber) { jw.writeNumber(value) } - override func boolValue(value: Bool) { + override func boolValue(_ value: Bool) { jw.writeBool(value) } diff --git a/Pod/Classes/JsonWriter.swift b/Pod/Classes/JsonWriter.swift index 4a1bde2..09a4fd5 100644 --- a/Pod/Classes/JsonWriter.swift +++ b/Pod/Classes/JsonWriter.swift @@ -8,20 +8,20 @@ import Foundation -enum JsonWriterError: ErrorType { - case NSJSONSerializationError(String) +enum JsonWriterError: Error { + case nsjsonSerializationError(String) } enum JsonContextType : Int { - case ROOT - case ARRAY - case OBJECT + case root + case array + case object } enum JsonWriterStatus : Int { - case OK - case WILL_NEED_COMMA - case WILL_NEED_COLON + case ok + case will_NEED_COMMA + case will_NEED_COLON } /** @@ -34,7 +34,7 @@ class JsonWriterContext { var startField = false init(){ - type = .ROOT + type = .root } convenience init(parent: JsonWriterContext, type: JsonContextType){ @@ -48,14 +48,14 @@ class JsonWriterContext { */ func createArrayContext() -> JsonWriterContext { writeValue() - return JsonWriterContext(parent: self, type: .ARRAY) + return JsonWriterContext(parent: self, type: .array) } /** creates an object in the current context. */ func createObjectContext() -> JsonWriterContext { writeValue() - return JsonWriterContext(parent: self, type: .OBJECT) + return JsonWriterContext(parent: self, type: .object) } func writeField(){ @@ -63,7 +63,7 @@ class JsonWriterContext { } func writeValue() { - index++ + index += 1 startField = false } @@ -77,22 +77,22 @@ class JsonWriterContext { func willWriteField() -> JsonWriterStatus { if startField { - return .WILL_NEED_COLON + return .will_NEED_COLON } if(index > 0){ - return .WILL_NEED_COMMA + return .will_NEED_COMMA } - return .OK + return .ok } func willWriteValue() -> JsonWriterStatus { if startField { - return .WILL_NEED_COLON + return .will_NEED_COLON } if(index > 0){ - return .WILL_NEED_COMMA + return .will_NEED_COMMA } - return .OK + return .ok } } @@ -151,17 +151,17 @@ internal class JsonWriter { /** Starts writing a field name - a json string that will be written in quotation marks. */ - internal func writeFieldName(name: String) { + internal func writeFieldName(_ name: String) { let status = writerContext.willWriteField() writeCommaOrColon(status) writerContext.writeField() write("\""+name+"\"") } - internal func writeCommaOrColon(status: JsonWriterStatus){ - if status == .WILL_NEED_COMMA { + internal func writeCommaOrColon(_ status: JsonWriterStatus){ + if status == .will_NEED_COMMA { write(",") - } else if status == .WILL_NEED_COLON { + } else if status == .will_NEED_COLON { write(":") } } @@ -169,9 +169,9 @@ internal class JsonWriter { /** Writes a String value. All '"' characters will be escaped. */ - internal func writeString(text: String?) { + internal func writeString(_ text: String?) { if let v = text { - let escapedV = v.stringByReplacingOccurrencesOfString("\"", withString: "\"") + let escapedV = v.replacingOccurrences(of: "\"", with: "\"") let status = writerContext.willWriteValue() writeCommaOrColon(status) writerContext.writeValue() @@ -185,7 +185,7 @@ internal class JsonWriter { Writes a NSNumber. If the NSNumber-object ist a boolean true/false is written to the stream. If the NSNumber is nil null will be written */ - internal func writeNumber(number: NSNumber?) { + internal func writeNumber(_ number: NSNumber?) { if let v = number { let status = writerContext.willWriteValue() writeCommaOrColon(status) @@ -204,7 +204,7 @@ internal class JsonWriter { /** Writes a boolean value to the stream - e.g. true or false. If the value is nil null is written to the stream. */ - internal func writeBool(value: Bool?) { + internal func writeBool(_ value: Bool?) { if let v = value { let status = writerContext.willWriteValue() writeCommaOrColon(status) @@ -218,9 +218,9 @@ internal class JsonWriter { /** Writes an NSDate object to the strem. JSON did not support a date value. Instead the milliseconds since 01.01.1970 will be used. */ - internal func writeDate(value: NSDate?) { + internal func writeDate(_ value: Date?) { if let date = value { - let number = NSNumber(double:date.timeIntervalSince1970*1000) + let number = NSNumber(value: date.timeIntervalSince1970*1000 as Double) writeNumber(number) } else { writeNull() @@ -246,20 +246,20 @@ internal class JsonWriter { - Throws: JsonWriterError if a value is of unsupported type. */ - internal func writeObject(anyObject: AnyObject) throws { - if let array = anyObject as? [AnyObject] { + internal func writeObject(_ anyObject: Any) throws { + if let array = anyObject as? [Any] { writeStartArray() for element in array { if let strValue = element as? String { writeString(strValue) } else if let numberValue = element as? NSNumber { writeNumber(numberValue) - } else if let dateValue = element as? NSDate { + } else if let dateValue = element as? Date { writeDate(dateValue) } else if let dictValue = element as? Dictionary { - try writeObject(dictValue) + try writeObject(dictValue as AnyObject) } else { - throw JsonWriterError.NSJSONSerializationError("unsupported value type: \(element.dynamicType)") + throw JsonWriterError.nsjsonSerializationError("unsupported value type: \(type(of: element))") } } writeEndArray() @@ -272,18 +272,18 @@ internal class JsonWriter { writeField(key, value: strValue) } else if let numberValue = value as? NSNumber { writeField(key, value: numberValue) - } else if let dateValue = value as? NSDate { + } else if let dateValue = value as? Date { writeField(key, value: dateValue) } else if let arrayValue = value as? NSArray { writeFieldName(key) try writeObject(arrayValue) } else { - throw JsonWriterError.NSJSONSerializationError("unsupported value type: \(value.dynamicType)") + throw JsonWriterError.nsjsonSerializationError("unsupported value type: \(type(of: value))") } } writeEndObject() }else { - throw JsonWriterError.NSJSONSerializationError("unsupported value type: \(anyObject.dynamicType)") + throw JsonWriterError.nsjsonSerializationError("unsupported value type: \(type(of: anyObject))") } } @@ -292,7 +292,7 @@ internal class JsonWriter { - Parameter fieldName: The name of the field - Parameter value: The String value */ - internal func writeField(fieldName: String, value: String?) { + internal func writeField(_ fieldName: String, value: String?) { writeFieldName(fieldName) writeString(value) } @@ -302,7 +302,7 @@ internal class JsonWriter { - Parameter fieldName: The name of the field - Parameter value: The Bool value */ - internal func writeField(fieldName: String, value: Bool?) { + internal func writeField(_ fieldName: String, value: Bool?) { writeFieldName(fieldName) writeBool(value) } @@ -312,7 +312,7 @@ internal class JsonWriter { - Parameter fieldName: The name of the field - Parameter value: The NSNumber value */ - internal func writeField(fieldName: String, value: NSNumber?) { + internal func writeField(_ fieldName: String, value: NSNumber?) { writeFieldName(fieldName) writeNumber(value) } @@ -322,7 +322,7 @@ internal class JsonWriter { - Parameter fieldName: The name of the field - Parameter value: The NSDate value */ - internal func writeField(fieldName: String, value: NSDate?) { + internal func writeField(_ fieldName: String, value: Date?) { writeFieldName(fieldName) writeDate(value) } @@ -332,7 +332,7 @@ internal class JsonWriter { - Parameter fieldName: The name of the field - Parameter value: The Object/Array value - see function writeObject for more information. */ - internal func writeFieldWithObject(fieldName: String, value: AnyObject) throws { + internal func writeFieldWithObject(_ fieldName: String, value: Any) throws { writeFieldName(fieldName) try writeObject(value) } @@ -340,7 +340,7 @@ internal class JsonWriter { /** Writes a named arrays. */ - internal func writeArrayFieldStart(fieldName: String) { + internal func writeArrayFieldStart(_ fieldName: String) { writeFieldName(fieldName) writeStartArray() } @@ -348,7 +348,7 @@ internal class JsonWriter { /** Writes a named object. */ - internal func writeObjectFieldStart(fieldName: String) { + internal func writeObjectFieldStart(_ fieldName: String) { writeFieldName(fieldName) writeStartObject() } @@ -363,7 +363,7 @@ internal class JsonWriter { /** Writes the string to the outputstream. If the stream is not open the stream will be opened. */ - internal func write(theString: String) { + internal func write(_ theString: String) { if !outputStream.isOpen() { outputStream.open() } @@ -390,4 +390,4 @@ extension NSNumber { let numID = CFGetTypeID(self) return numID == boolID } -} \ No newline at end of file +} diff --git a/Pod/Classes/OuputStreams.swift b/Pod/Classes/OuputStreams.swift index d2906b9..cdb9cb7 100644 --- a/Pod/Classes/OuputStreams.swift +++ b/Pod/Classes/OuputStreams.swift @@ -15,11 +15,11 @@ import Foundation Buffer mechanisms. */ protocol OutputStream { - var outputStream: NSOutputStream { get } + var outputStream: Foundation.OutputStream { get } func open() func close() func isOpen() -> Bool - func write(theString: String) + func write(_ theString: String) func getDataAsString() -> String } @@ -28,17 +28,17 @@ protocol OutputStream { */ extension OutputStream { - private func write(buffer: UnsafePointer, maxLength len: Int) -> Int { + fileprivate func write(_ buffer: UnsafePointer, maxLength len: Int) -> Int { return self.outputStream.write(buffer, maxLength: len) } - private func stringToData(theString: String) -> NSData { - return theString.dataUsingEncoding(NSUTF8StringEncoding)! + fileprivate func stringToData(_ theString: String) -> Data { + return theString.data(using: String.Encoding.utf8)! } - func write(theString: String) { + func write(_ theString: String) { let data = stringToData(theString) - write(UnsafePointer(data.bytes), maxLength: data.length) + write((data as NSData).bytes.bindMemory(to: UInt8.self, capacity: data.count), maxLength: data.count) } func open(){ @@ -50,7 +50,7 @@ extension OutputStream { } func isOpen() -> Bool { - return outputStream.streamStatus == NSStreamStatus.Open + return outputStream.streamStatus == Stream.Status.open } } @@ -59,17 +59,17 @@ extension OutputStream { */ internal class MemOutputStream : OutputStream { - var outputStream: NSOutputStream + var outputStream: Foundation.OutputStream init(){ - self.outputStream = NSOutputStream.outputStreamToMemory() + self.outputStream = Foundation.OutputStream.toMemory() } func getDataAsString() -> String { close() - let data = outputStream.propertyForKey(NSStreamDataWrittenToMemoryStreamKey) + let data = outputStream.property(forKey: Stream.PropertyKey.dataWrittenToMemoryStreamKey) - return NSString(data: data as! NSData, encoding: NSUTF8StringEncoding) as! String + return NSString(data: data as! Data, encoding: String.Encoding.utf8.rawValue) as! String } } @@ -77,16 +77,16 @@ internal class MemOutputStream : OutputStream { A file output stream. The stream will overwrite any existing file content. */ internal class FileOutputStream : OutputStream { - var outputStream: NSOutputStream + var outputStream: Foundation.OutputStream var fileAtPath: String init(fileAtPath: String){ self.fileAtPath = fileAtPath - self.outputStream = NSOutputStream.init(toFileAtPath: fileAtPath, append: false)! + self.outputStream = Foundation.OutputStream.init(toFileAtPath: fileAtPath, append: false)! } func getDataAsString() -> String { close() - return try! NSString(contentsOfFile: fileAtPath, encoding: NSUTF8StringEncoding) as String + return try! NSString(contentsOfFile: fileAtPath, encoding: String.Encoding.utf8.rawValue) as String } -} \ No newline at end of file +} diff --git a/Pod/Classes/SampleCreator.swift b/Pod/Classes/SampleCreator.swift index 31c5cd9..aea9de5 100644 --- a/Pod/Classes/SampleCreator.swift +++ b/Pod/Classes/SampleCreator.swift @@ -17,7 +17,7 @@ class SampleCreatorRegistry { - Parameter typeName: the name of the type for what a SampleCreator is needed. - Returns: a SampleCreator for the type or nil if no SampleCreator exists for the type or the type is not supported. */ - static func get(typeName:String?) -> SampleCreator? { + static func get(_ typeName:String?) -> SampleCreator? { var sampleCreator:SampleCreator? = nil if let type = typeName { @@ -48,7 +48,7 @@ protocol SampleCreator { - Parameter sampleDict: the json dictionary containing a complete sample (inluding sub structures) - Returns: a HealthKit Sample that can be saved to the Health store or nil. */ - func createSample(sampleDict:AnyObject) -> HKSample? + func createSample(_ sampleDict:AnyObject) -> HKSample? } // abstract class implementation @@ -60,15 +60,15 @@ extension SampleCreator { - Parameter dict: The Json dictionary for a sample - Returns: a tupel with the start date and the end date */ - func dictToTimeframe(dict:Dictionary) -> (sDate:NSDate, eDate:NSDate) { + func dictToTimeframe(_ dict:Dictionary) -> (sDate:Date, eDate:Date) { let startDateNumber = dict[HealthKitConstants.S_DATE] as! Double let endDateOptNumber = dict[HealthKitConstants.E_DATE] as? Double - let startDate = NSDate(timeIntervalSince1970: startDateNumber/1000) - var endDate: NSDate? = nil + let startDate = Date(timeIntervalSince1970: startDateNumber/1000) + var endDate: Date? = nil if let endDateNumber = endDateOptNumber { - endDate = NSDate(timeIntervalSince1970: endDateNumber/1000) + endDate = Date(timeIntervalSince1970: endDateNumber/1000) } else { endDate = startDate } @@ -81,11 +81,11 @@ extension SampleCreator { - Parameter forType: the concrete category type that should be created - Returns: the CategorySample. Ready to save to the Health Store. */ - func dictToCategorySample(dict:Dictionary, forType type: HKCategoryType) -> HKCategorySample { + func dictToCategorySample(_ dict:Dictionary, forType type: HKCategoryType) -> HKCategorySample { let value = dict[HealthKitConstants.VALUE] as! Int let dates = dictToTimeframe(dict) - return HKCategorySample(type: type, value: value, startDate: dates.sDate , endDate: dates.eDate) + return HKCategorySample(type: type, value: value, start: dates.sDate , end: dates.eDate) } /** @@ -94,17 +94,17 @@ extension SampleCreator { - Parameter forType: the concrete quantity type that should be created - Returns: the QuantitySample. Ready to save to the Health Store. */ - func dictToQuantitySample(dict:Dictionary, forType type: HKQuantityType) -> HKQuantitySample { + func dictToQuantitySample(_ dict:Dictionary, forType type: HKQuantityType) -> HKQuantitySample { let dates = dictToTimeframe(dict) let value = dict[HealthKitConstants.VALUE] as! Double let strUnit = dict[HealthKitConstants.UNIT] as? String - let hkUnit = HKUnit(fromString: strUnit!) + let hkUnit = HKUnit(from: strUnit!) let quantity = HKQuantity(unit: hkUnit, doubleValue: value) - return HKQuantitySample(type: type, quantity: quantity, startDate: dates.sDate, endDate: dates.eDate) + return HKQuantitySample(type: type, quantity: quantity, start: dates.sDate, end: dates.eDate) } } @@ -113,10 +113,10 @@ class CategorySampleCreator : SampleCreator { let type: HKCategoryType init(typeName:String){ - self.type = HKObjectType.categoryTypeForIdentifier(typeName)! + self.type = HKObjectType.categoryType(forIdentifier: HKCategoryTypeIdentifier(rawValue: typeName))! } - func createSample(sampleDict: AnyObject) -> HKSample? { + func createSample(_ sampleDict: AnyObject) -> HKSample? { if let dict = sampleDict as? Dictionary { return dictToCategorySample(dict, forType:type) } @@ -129,10 +129,10 @@ class QuantitySampleCreator : SampleCreator { let type: HKQuantityType init(typeName:String){ - self.type = HKObjectType.quantityTypeForIdentifier(typeName)! + self.type = HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier(rawValue: typeName))! } - func createSample(sampleDict: AnyObject) -> HKSample? { + func createSample(_ sampleDict: AnyObject) -> HKSample? { if let dict = sampleDict as? Dictionary { return dictToQuantitySample(dict, forType:type) @@ -147,10 +147,10 @@ class CorrelationSampleCreator : SampleCreator { let type: HKCorrelationType init(typeName: String){ - self.type = HKObjectType.correlationTypeForIdentifier(typeName)! + self.type = HKObjectType.correlationType(forIdentifier: HKCorrelationTypeIdentifier(rawValue: typeName))! } - func createSample(sampleDict: AnyObject) -> HKSample? { + func createSample(_ sampleDict: AnyObject) -> HKSample? { if let dict = sampleDict as? Dictionary { let dates = dictToTimeframe(dict) @@ -162,7 +162,7 @@ class CorrelationSampleCreator : SampleCreator { if let subDict = object as? Dictionary { let subTypeName = subDict[HealthKitConstants.TYPE] as? String if let creator = SampleCreatorRegistry.get(subTypeName) { - let sampleOpt = creator.createSample(subDict) + let sampleOpt = creator.createSample(subDict as AnyObject) if let sample = sampleOpt { objects.insert(sample) } @@ -176,7 +176,7 @@ class CorrelationSampleCreator : SampleCreator { return nil } - return HKCorrelation(type: type, startDate: dates.sDate, endDate: dates.eDate, objects: objects) + return HKCorrelation(type: type, start: dates.sDate, end: dates.eDate, objects: objects) } return nil } @@ -186,7 +186,7 @@ class CorrelationSampleCreator : SampleCreator { class WorkoutSampleCreator : SampleCreator { let type = HKObjectType.workoutType() - func createSample(sampleDict: AnyObject) -> HKSample? { + func createSample(_ sampleDict: AnyObject) -> HKSample? { if let dict = sampleDict as? Dictionary { let dates = dictToTimeframe(dict) @@ -194,7 +194,7 @@ class WorkoutSampleCreator : SampleCreator { let activityTypeRawValue = dict[HealthKitConstants.WORKOUT_ACTIVITY_TYPE] as? UInt let activityType = HKWorkoutActivityType(rawValue: activityTypeRawValue!) - let duration = dict[HealthKitConstants.DURATION] as? NSTimeInterval + let duration = dict[HealthKitConstants.DURATION] as? TimeInterval let totalDistance = dict[HealthKitConstants.TOTAL_DISTANCE] as? Double // always HKUnit.meterUnit() let totalEnergyBurned = dict[HealthKitConstants.TOTAL_ENERGY_BURNED] as? Double //always HKUnit.kilocalorieUnit() @@ -206,15 +206,15 @@ class WorkoutSampleCreator : SampleCreator { let eventTypeRaw = subDict[HealthKitConstants.TYPE] as? Int let eventType = HKWorkoutEventType(rawValue: eventTypeRaw!)! let startDateNumber = subDict[HealthKitConstants.S_DATE] as! Double - let startDate = NSDate(timeIntervalSince1970: startDateNumber/1000) + let startDate = Date(timeIntervalSince1970: startDateNumber/1000) events.append(HKWorkoutEvent(type: eventType, date: startDate)) } } } if events.count > 0 { - return HKWorkout(activityType: activityType!, startDate: dates.sDate, endDate: dates.eDate, workoutEvents: events, totalEnergyBurned: HKQuantity(unit: HKUnit.kilocalorieUnit(), doubleValue: totalEnergyBurned!), totalDistance: HKQuantity(unit: HKUnit.meterUnit(), doubleValue: totalDistance!), metadata: nil) + return HKWorkout(activityType: activityType!, start: dates.sDate, end: dates.eDate, workoutEvents: events, totalEnergyBurned: HKQuantity(unit: HKUnit.kilocalorie(), doubleValue: totalEnergyBurned!), totalDistance: HKQuantity(unit: HKUnit.meter(), doubleValue: totalDistance!), metadata: nil) } else { - return HKWorkout(activityType: activityType!, startDate: dates.sDate, endDate: dates.eDate, duration: duration!, totalEnergyBurned: HKQuantity(unit: HKUnit.kilocalorieUnit(), doubleValue: totalEnergyBurned!), totalDistance: HKQuantity(unit: HKUnit.meterUnit(), doubleValue: totalDistance!), metadata: nil) + return HKWorkout(activityType: activityType!, start: dates.sDate, end: dates.eDate, duration: duration!, totalEnergyBurned: HKQuantity(unit: HKUnit.kilocalorie(), doubleValue: totalEnergyBurned!), totalDistance: HKQuantity(unit: HKUnit.meter(), doubleValue: totalDistance!), metadata: nil) } } return nil diff --git a/Pod/Classes/Util.swift b/Pod/Classes/Util.swift index a9c908e..b60dfab 100644 --- a/Pod/Classes/Util.swift +++ b/Pod/Classes/Util.swift @@ -11,18 +11,18 @@ import Foundation /** Utility class for working with file names. */ -public class FileNameUtil { +open class FileNameUtil { /** removes the characters \ ? % * | . : , " < > form a string - Parameter userInput: a string that needs to be transformed to a filename - Returns: the string with all the characters mentioned above removed from the string. */ - public static func normalizeName(userInput: String) -> String { - let trimmedUserInput = userInput.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet()) + public static func normalizeName(_ userInput: String) -> String { + let trimmedUserInput = userInput.trimmingCharacters(in: CharacterSet.whitespaces) - let illegalFileNameCharacters = NSCharacterSet.init(charactersInString: "/\\?%*|.:, \"<>") + let illegalFileNameCharacters = CharacterSet.init(charactersIn: "/\\?%*|.:, \"<>") - return trimmedUserInput.componentsSeparatedByCharactersInSet(illegalFileNameCharacters).joinWithSeparator("") + return trimmedUserInput.components(separatedBy: illegalFileNameCharacters).joined(separator: "") } -} \ No newline at end of file +} diff --git a/README.md b/README.md index c792a34..931a770 100644 --- a/README.md +++ b/README.md @@ -46,21 +46,23 @@ import HealthKitSampleGenerator // setup an output file name -let fm = NSFileManager.defaultManager() -let documentsUrl = fm.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)[0] -let outputFileName = documentsUrl.URLByAppendingPathComponent("export.json").path! -// create a target for the export - all goes in a single json file -let target = JsonSingleDocAsFileExportTarget(outputFileName: outputFileName, overwriteIfExist:true) - -// configure the export -var configuration = HealthDataFullExportConfiguration(profileName: "Profilname", exportType: HealthDataToExportType.ALL) -configuration.exportUuids = false //false is default - if true, all uuids will be exported too - -// create your instance of HKHeakthStore -let healthStore = HKHealthStore() -// and pass it to the HealthKitDataExporter -let exporter = HealthKitDataExporter(healthStore: healthStore) +let startDate = Date.distantPast // export start date +let endDate = Date() // export end date +let fm = FileManager.default +let documentsUrl = fm.urls(for: .documentDirectory, in: .userDomainMask)[0] +let outputFileName = documentsUrl.appendingPathComponent(String(format:"HKexport from %@ to %@.json", startDate.debugDescription ,endDate.debugDescription)).path + + // create a target for the export - all goes in a single json file + let target = JsonSingleDocAsFileExportTarget(outputFileName: outputFileName, overwriteIfExist:true) + + // configure the export + var configuration = HealthDataFullExportConfiguration(profileName: "Profilname", exportType: HealthDataToExportType.ALL, startDate: startDate, endDate: endDate, shouldAuthorize: false) // if you have authorized using HealthKit in your app before, shouldAuthorize: must be false, otherwise true + configuration.exportUuids = false //false is default - if true, all uuids will be exported too + // create your instance of HKHeakthStore + let healthStore = HKHealthStore() + // and pass it to the HealthKitDataExporter + let exporter = HealthKitDataExporter(healthStore: HealthMonitor().healthStore) // now start the import. exporter.export( @@ -72,9 +74,7 @@ exporter.export( onProgress: { (message: String, progressInPercent: NSNumber?) -> Void in // output progress messages - dispatch_async(dispatch_get_main_queue(), { - print(message) - }) + print(message + " progress : " + String(Float(progressInPercent ?? -1))) }, onCompletion: { @@ -192,7 +192,8 @@ Some notes about the export/import format: ## Requirements -iOS 9.0, Xcode 7 +iOS 12.0, Xcode 9, Swift 5 + ## Installation @@ -200,12 +201,13 @@ HealthKitSampleGenerator is available through [CocoaPods](http://cocoapods.org). it, simply add the following line to your Podfile: ```ruby -pod "HealthKitSampleGenerator" + pod "HealthKitSampleGenerator" , :git => 'https://github.com/mkhoshpour/healthkit-sample-generator' ``` ## Author Michael Seemann, pods@mseemann.de +Majid Khoshpour, mkhoshpour@yahoo.com ## License