cocoapods-deintegrate 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +16 -19
- data/cocoapods_deintegrate.gemspec +1 -1
- data/lib/cocoapods_deintegrate.rb +1 -1
- data/lib/pod/command/deintegrate.rb +27 -15
- data/spec/command/deintegrate_spec.rb +47 -1
- data/spec/fixtures/Project/Frameworks/Podfile +12 -0
- data/spec/fixtures/Project/Frameworks/Podfile.lock +42 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/QueryKit/QKAttribute.h +210 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/QueryKit/QKQuerySet.h +155 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/QueryKit/QueryKit.h +19 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/Quick/NSString+QCKSelectorName.h +17 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/Quick/QCKDSL.h +211 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/Quick/Quick.h +13 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/Quick/QuickConfiguration.h +30 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/Quick/QuickSpec.h +48 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/QueryKit/QKAttribute.h +210 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/QueryKit/QKQuerySet.h +155 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/QueryKit/QueryKit.h +19 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/Quick/NSString+QCKSelectorName.h +17 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/Quick/QCKDSL.h +211 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/Quick/Quick.h +13 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/Quick/QuickConfiguration.h +30 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/Quick/QuickSpec.h +48 -0
- data/spec/fixtures/Project/Frameworks/Pods/Manifest.lock +42 -0
- data/spec/fixtures/Project/Frameworks/Pods/Pods.xcodeproj/project.pbxproj +995 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/LICENSE +23 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/Attribute.swift +124 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/Expression.swift +41 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKAttribute.h +210 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKAttribute.m +315 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKAttribute.swift +13 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKQuerySet.h +155 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKQuerySet.m +314 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKQuerySet.swift +28 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/Predicate.swift +21 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/QueryKit.h +19 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/QuerySet.swift +237 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/README.md +151 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/LICENSE +201 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Callsite.swift +28 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Configuration/Configuration.swift +147 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Configuration/QuickConfiguration.h +30 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Configuration/QuickConfiguration.m +83 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/DSL/DSL.swift +227 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/DSL/QCKDSL.h +211 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/DSL/QCKDSL.m +70 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/DSL/World+DSL.swift +100 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Example.swift +103 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/ExampleGroup.swift +97 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/ExampleMetadata.swift +22 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Failure.swift +16 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Filter.swift +29 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Hooks/Closures.swift +35 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Hooks/ExampleHooks.swift +36 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Hooks/SuiteHooks.swift +34 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/NSString+QCKSelectorName.h +17 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/NSString+QCKSelectorName.m +33 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Quick.h +13 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/QuickSpec.h +48 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/QuickSpec.m +142 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/World.swift +197 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/README.md +979 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Info.plist +26 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit-Private.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit-dummy.m +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit-prefix.pch +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit-umbrella.h +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit.modulemap +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit.xcconfig b/data/spec/fixtures/Project/Frameworks/Pods/Target Support → Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit.xcconfig +0 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Info.plist +26 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-acknowledgements.markdown +30 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-acknowledgements.plist +60 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-dummy.m +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-environment.h +74 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-frameworks.sh +55 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-resources.sh +74 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-umbrella.h +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject.debug.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject.modulemap +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject.release.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Info.plist +26 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick-Private.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick-dummy.m +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick-prefix.pch +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick-umbrella.h +11 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick.modulemap +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick.xcconfig +2 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Info.plist +26 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-acknowledgements.markdown +208 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-acknowledgements.plist +238 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-dummy.m +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-environment.h +14 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-frameworks.sh +55 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-resources.sh +74 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-umbrella.h +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests.debug.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests.modulemap +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests.release.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/TestProject.xcodeproj/project.pbxproj +557 -0
- data/spec/fixtures/Project/Frameworks/TestProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/Project/Frameworks/TestProject.xcworkspace/contents.xcworkspacedata +10 -0
- data/spec/fixtures/Project/Frameworks/TestProject/AppDelegate.swift +46 -0
- data/spec/fixtures/Project/Frameworks/TestProject/Base.lproj/LaunchScreen.xib +41 -0
- data/spec/fixtures/Project/Frameworks/TestProject/Base.lproj/Main.storyboard +25 -0
- data/spec/fixtures/Project/Frameworks/TestProject/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- data/spec/fixtures/Project/Frameworks/TestProject/Info.plist +40 -0
- data/spec/fixtures/Project/Frameworks/TestProject/ViewController.swift +25 -0
- data/spec/fixtures/Project/Frameworks/TestProjectTests/Info.plist +24 -0
- data/spec/fixtures/Project/Frameworks/TestProjectTests/TestProjectTests.swift +36 -0
- data/spec/fixtures/Project/None/TestProject.xcodeproj/project.pbxproj +420 -0
- data/spec/fixtures/Project/None/TestProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/Project/None/TestProject/AppDelegate.swift +46 -0
- data/spec/fixtures/Project/None/TestProject/Base.lproj/LaunchScreen.xib +41 -0
- data/spec/fixtures/Project/None/TestProject/Base.lproj/Main.storyboard +25 -0
- data/spec/fixtures/Project/None/TestProject/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- data/spec/fixtures/Project/None/TestProject/Info.plist +40 -0
- data/spec/fixtures/Project/None/TestProject/ViewController.swift +25 -0
- data/spec/fixtures/Project/None/TestProjectTests/Info.plist +24 -0
- data/spec/fixtures/Project/None/TestProjectTests/TestProjectTests.swift +36 -0
- data/spec/fixtures/Project/StaticLibraries/Podfile +12 -0
- data/spec/fixtures/Project/StaticLibraries/Podfile.lock +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/LICENSE +19 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/README.md +308 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPBackwardCompatibility.h +42 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPBackwardCompatibility.m +17 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPBlockDefinedMatcher.h +25 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPBlockDefinedMatcher.m +60 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPDefines.h +17 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPDoubleTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPDoubleTuple.m +42 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPExpect.h +45 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPExpect.m +214 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPFloatTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPFloatTuple.m +42 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPMatcher.h +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPUnsupportedObject.h +11 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPUnsupportedObject.m +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/Expecta.h +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/Expecta.m +15 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/ExpectaSupport.h +64 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/ExpectaSupport.m +187 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/NSObject+Expecta.h +14 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/NSValue+Expecta.h +8 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/NSValue+Expecta.m +21 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatcherHelpers.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatcherHelpers.m +9 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beCloseTo.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beCloseTo.m +49 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beFalsy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beFalsy.m +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThan.m +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThanOrEqualTo.m +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beIdenticalTo.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beIdenticalTo.m +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m +30 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beLessThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beLessThan.m +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beLessThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beLessThanOrEqualTo.m +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beNil.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beNil.m +16 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beSubclassOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beSubclassOf.m +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beSupersetOf.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beSupersetOf.m +57 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beTruthy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beTruthy.m +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beginWith.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beginWith.m +49 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+conformTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+conformTo.m +33 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+contain.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+contain.m +38 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+endWith.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+endWith.m +49 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+equal.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+equal.m +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+haveCountOf.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+haveCountOf.m +36 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+notify.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+notify.m +63 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+raise.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+raise.m +30 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+raiseWithReason.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+raiseWithReason.m +35 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+respondTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+respondTo.m +28 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers.h +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPBackwardCompatibility.h +42 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPBlockDefinedMatcher.h +25 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPDefines.h +17 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPDoubleTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPExpect.h +45 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPFloatTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatcher.h +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatcherHelpers.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beCloseTo.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beFalsy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beGreaterThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beGreaterThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beIdenticalTo.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beInTheRangeOf.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beInstanceOf.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beKindOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beLessThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beLessThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beNil.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beSubclassOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beSupersetOf.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beTruthy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beginWith.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+conformTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+contain.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+endWith.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+equal.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+haveCountOf.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+notify.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+raise.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+raiseWithReason.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+respondTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers.h +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPUnsupportedObject.h +11 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/Expecta.h +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/ExpectaSupport.h +64 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/NSObject+Expecta.h +14 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/NSValue+Expecta.h +8 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/NSAttributedString+CCLFormat/NSAttributedString+CCLFormat.h +21 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPBackwardCompatibility.h +42 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPBlockDefinedMatcher.h +25 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPDefines.h +17 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPDoubleTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPExpect.h +45 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPFloatTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatcher.h +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatcherHelpers.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beCloseTo.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beFalsy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beGreaterThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beGreaterThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beIdenticalTo.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beInTheRangeOf.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beInstanceOf.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beKindOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beLessThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beLessThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beNil.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beSubclassOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beSupersetOf.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beTruthy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beginWith.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+conformTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+contain.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+endWith.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+equal.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+haveCountOf.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+notify.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+raise.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+raiseWithReason.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+respondTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers.h +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPUnsupportedObject.h +11 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/Expecta.h +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/ExpectaSupport.h +64 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/NSObject+Expecta.h +14 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/NSValue+Expecta.h +8 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/NSAttributedString+CCLFormat/NSAttributedString+CCLFormat.h +21 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Manifest.lock +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/NSAttributedString+CCLFormat/LICENSE +23 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/NSAttributedString+CCLFormat/NSAttributedString+CCLFormat.h +21 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/NSAttributedString+CCLFormat/NSAttributedString+CCLFormat.m +51 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/NSAttributedString+CCLFormat/README.md +57 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Pods.xcodeproj/project.pbxproj +943 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject-NSAttributedString+CCLFormat/Pods-TestProject-NSAttributedString+CCLFormat-Private.xcconfig +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject-NSAttributedString+CCLFormat/Pods-TestProject-NSAttributedString+CCLFormat-dummy.m +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject-NSAttributedString+CCLFormat/Pods-TestProject-NSAttributedString+CCLFormat-prefix.pch +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject-NSAttributedString+CCLFormat/Pods-TestProject-NSAttributedString+CCLFormat.xcconfig b/data/spec/fixtures/Project/StaticLibraries/Pods/Target Support → Files/Pods-TestProject-NSAttributedString+CCLFormat/Pods-TestProject-NSAttributedString+CCLFormat.xcconfig +0 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-acknowledgements.markdown +30 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-acknowledgements.plist +60 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-dummy.m +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-environment.h +14 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-resources.sh +74 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject.debug.xcconfig +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject.release.xcconfig +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests-Expecta/Pods-TestProjectTests-Expecta-Private.xcconfig +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests-Expecta/Pods-TestProjectTests-Expecta-dummy.m +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests-Expecta/Pods-TestProjectTests-Expecta-prefix.pch +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests-Expecta/Pods-TestProjectTests-Expecta.xcconfig +1 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-acknowledgements.markdown +26 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-acknowledgements.plist +56 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-dummy.m +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-environment.h +14 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-resources.sh +74 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests.debug.xcconfig +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests.release.xcconfig +6 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject.xcodeproj/project.pbxproj +525 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject.xcworkspace/contents.xcworkspacedata +10 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/AppDelegate.swift +46 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/Base.lproj/LaunchScreen.xib +41 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/Base.lproj/Main.storyboard +25 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/Info.plist +40 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/ViewController.swift +25 -0
- data/spec/fixtures/Project/StaticLibraries/TestProjectTests/Info.plist +24 -0
- data/spec/fixtures/Project/StaticLibraries/TestProjectTests/TestProjectTests.swift +36 -0
- metadata +620 -7
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
A container for closures to be executed before and after all examples.
|
3
|
+
*/
|
4
|
+
final internal class SuiteHooks {
|
5
|
+
internal var befores: [BeforeSuiteClosure] = []
|
6
|
+
internal var beforesAlreadyExecuted = false
|
7
|
+
|
8
|
+
internal var afters: [AfterSuiteClosure] = []
|
9
|
+
internal var aftersAlreadyExecuted = false
|
10
|
+
|
11
|
+
internal func appendBefore(closure: BeforeSuiteClosure) {
|
12
|
+
befores.append(closure)
|
13
|
+
}
|
14
|
+
|
15
|
+
internal func appendAfter(closure: AfterSuiteClosure) {
|
16
|
+
afters.append(closure)
|
17
|
+
}
|
18
|
+
|
19
|
+
internal func executeBefores() {
|
20
|
+
assert(!beforesAlreadyExecuted)
|
21
|
+
for before in befores {
|
22
|
+
before()
|
23
|
+
}
|
24
|
+
beforesAlreadyExecuted = true
|
25
|
+
}
|
26
|
+
|
27
|
+
internal func executeAfters() {
|
28
|
+
assert(!aftersAlreadyExecuted)
|
29
|
+
for after in afters {
|
30
|
+
after()
|
31
|
+
}
|
32
|
+
aftersAlreadyExecuted = true
|
33
|
+
}
|
34
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
/**
|
4
|
+
QuickSpec converts example names into test methods.
|
5
|
+
Those test methods need valid selector names, which means no whitespace,
|
6
|
+
control characters, etc. This category gives NSString objects an easy way
|
7
|
+
to replace those illegal characters with underscores.
|
8
|
+
*/
|
9
|
+
@interface NSString (QCKSelectorName)
|
10
|
+
|
11
|
+
/**
|
12
|
+
Returns a string with underscores in place of all characters that cannot
|
13
|
+
be included in a selector (SEL) name.
|
14
|
+
*/
|
15
|
+
@property (nonatomic, readonly) NSString *qck_selectorName;
|
16
|
+
|
17
|
+
@end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#import "NSString+QCKSelectorName.h"
|
2
|
+
|
3
|
+
@implementation NSString (QCKSelectorName)
|
4
|
+
|
5
|
+
- (NSString *)qck_selectorName {
|
6
|
+
static NSMutableCharacterSet *invalidCharacters = nil;
|
7
|
+
static dispatch_once_t onceToken;
|
8
|
+
dispatch_once(&onceToken, ^{
|
9
|
+
invalidCharacters = [NSMutableCharacterSet new];
|
10
|
+
|
11
|
+
NSCharacterSet *whitespaceCharacterSet = [NSCharacterSet whitespaceCharacterSet];
|
12
|
+
NSCharacterSet *newlineCharacterSet = [NSCharacterSet newlineCharacterSet];
|
13
|
+
NSCharacterSet *illegalCharacterSet = [NSCharacterSet illegalCharacterSet];
|
14
|
+
NSCharacterSet *controlCharacterSet = [NSCharacterSet controlCharacterSet];
|
15
|
+
NSCharacterSet *punctuationCharacterSet = [NSCharacterSet punctuationCharacterSet];
|
16
|
+
NSCharacterSet *nonBaseCharacterSet = [NSCharacterSet nonBaseCharacterSet];
|
17
|
+
NSCharacterSet *symbolCharacterSet = [NSCharacterSet symbolCharacterSet];
|
18
|
+
|
19
|
+
[invalidCharacters formUnionWithCharacterSet:whitespaceCharacterSet];
|
20
|
+
[invalidCharacters formUnionWithCharacterSet:newlineCharacterSet];
|
21
|
+
[invalidCharacters formUnionWithCharacterSet:illegalCharacterSet];
|
22
|
+
[invalidCharacters formUnionWithCharacterSet:controlCharacterSet];
|
23
|
+
[invalidCharacters formUnionWithCharacterSet:punctuationCharacterSet];
|
24
|
+
[invalidCharacters formUnionWithCharacterSet:nonBaseCharacterSet];
|
25
|
+
[invalidCharacters formUnionWithCharacterSet:symbolCharacterSet];
|
26
|
+
});
|
27
|
+
|
28
|
+
NSArray *validComponents = [self componentsSeparatedByCharactersInSet:invalidCharacters];
|
29
|
+
|
30
|
+
return [validComponents componentsJoinedByString:@"_"];
|
31
|
+
}
|
32
|
+
|
33
|
+
@end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#import <Foundation/Foundation.h>
|
2
|
+
|
3
|
+
//! Project version number for Quick.
|
4
|
+
FOUNDATION_EXPORT double QuickVersionNumber;
|
5
|
+
|
6
|
+
//! Project version string for Quick.
|
7
|
+
FOUNDATION_EXPORT const unsigned char QuickVersionString[];
|
8
|
+
|
9
|
+
// In this header, you should import all the public headers of your framework using statements like #import <Quick/PublicHeader.h>
|
10
|
+
|
11
|
+
#import <Quick/QuickSpec.h>
|
12
|
+
#import <Quick/QCKDSL.h>
|
13
|
+
#import <Quick/QuickConfiguration.h>
|
@@ -0,0 +1,48 @@
|
|
1
|
+
#import <XCTest/XCTest.h>
|
2
|
+
|
3
|
+
/**
|
4
|
+
QuickSpec is a base class all specs written in Quick inherit from.
|
5
|
+
They need to inherit from QuickSpec, a subclass of XCTestCase, in
|
6
|
+
order to be discovered by the XCTest framework.
|
7
|
+
|
8
|
+
XCTest automatically compiles a list of XCTestCase subclasses included
|
9
|
+
in the test target. It iterates over each class in that list, and creates
|
10
|
+
a new instance of that class for each test method. It then creates an
|
11
|
+
"invocation" to execute that test method. The invocation is an instance of
|
12
|
+
NSInvocation, which represents a single message send in Objective-C.
|
13
|
+
The invocation is set on the XCTestCase instance, and the test is run.
|
14
|
+
|
15
|
+
Most of the code in QuickSpec is dedicated to hooking into XCTest events.
|
16
|
+
First, when the spec is first loaded and before it is sent any messages,
|
17
|
+
the +[NSObject initialize] method is called. QuickSpec overrides this method
|
18
|
+
to call +[QuickSpec spec]. This builds the example group stacks and
|
19
|
+
registers them with Quick.World, a global register of examples.
|
20
|
+
|
21
|
+
Then, XCTest queries QuickSpec for a list of test methods. Normally, XCTest
|
22
|
+
automatically finds all methods whose selectors begin with the string "test".
|
23
|
+
However, QuickSpec overrides this default behavior by implementing the
|
24
|
+
+[XCTestCase testInvocations] method. This method iterates over each example
|
25
|
+
registered in Quick.World, defines a new method for that example, and
|
26
|
+
returns an invocation to call that method to XCTest. Those invocations are
|
27
|
+
the tests that are run by XCTest. Their selector names are displayed in
|
28
|
+
the Xcode test navigation bar.
|
29
|
+
*/
|
30
|
+
@interface QuickSpec : XCTestCase
|
31
|
+
|
32
|
+
/**
|
33
|
+
Override this method in your spec to define a set of example groups
|
34
|
+
and examples.
|
35
|
+
|
36
|
+
override class func spec() {
|
37
|
+
describe("winter") {
|
38
|
+
it("is coming") {
|
39
|
+
// ...
|
40
|
+
}
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
See DSL.swift for more information on what syntax is available.
|
45
|
+
*/
|
46
|
+
- (void)spec;
|
47
|
+
|
48
|
+
@end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
#import "QuickSpec.h"
|
2
|
+
#import "QuickConfiguration.h"
|
3
|
+
#import "NSString+QCKSelectorName.h"
|
4
|
+
#import <Quick/Quick-Swift.h>
|
5
|
+
#import <objc/runtime.h>
|
6
|
+
|
7
|
+
const void * const QCKExampleKey = &QCKExampleKey;
|
8
|
+
|
9
|
+
@interface QuickSpec ()
|
10
|
+
@property (nonatomic, strong) Example *example;
|
11
|
+
@end
|
12
|
+
|
13
|
+
@implementation QuickSpec
|
14
|
+
|
15
|
+
#pragma mark - XCTestCase Overrides
|
16
|
+
|
17
|
+
/**
|
18
|
+
The runtime sends initialize to each class in a program just before the class, or any class
|
19
|
+
that inherits from it, is sent its first message from within the program. QuickSpec hooks into
|
20
|
+
this event to compile the example groups for this spec subclass.
|
21
|
+
|
22
|
+
If an exception occurs when compiling the examples, report it to the user. Chances are they
|
23
|
+
included an expectation outside of a "it", "describe", or "context" block.
|
24
|
+
*/
|
25
|
+
+ (void)initialize {
|
26
|
+
[QuickConfiguration initialize];
|
27
|
+
|
28
|
+
World *world = [World sharedWorld];
|
29
|
+
world.currentExampleGroup = [world rootExampleGroupForSpecClass:[self class]];
|
30
|
+
QuickSpec *spec = [self new];
|
31
|
+
|
32
|
+
@try {
|
33
|
+
[spec spec];
|
34
|
+
}
|
35
|
+
@catch (NSException *exception) {
|
36
|
+
[NSException raise:NSInternalInconsistencyException
|
37
|
+
format:@"An exception occurred when building Quick's example groups.\n"
|
38
|
+
@"Some possible reasons this might happen include:\n\n"
|
39
|
+
@"- An 'expect(...).to' expectation was evaluated outside of "
|
40
|
+
@"an 'it', 'context', or 'describe' block\n"
|
41
|
+
@"- 'sharedExamples' was called twice with the same name\n"
|
42
|
+
@"- 'itBehavesLike' was called with a name that is not registered as a shared example\n\n"
|
43
|
+
@"Here's the original exception: '%@', reason: '%@', userInfo: '%@'",
|
44
|
+
exception.name, exception.reason, exception.userInfo];
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
/**
|
49
|
+
Invocations for each test method in the test case. QuickSpec overrides this method to define a
|
50
|
+
new method for each example defined in +[QuickSpec spec].
|
51
|
+
|
52
|
+
@return An array of invocations that execute the newly defined example methods.
|
53
|
+
*/
|
54
|
+
+ (NSArray *)testInvocations {
|
55
|
+
NSArray *examples = [[World sharedWorld] examplesForSpecClass:[self class]];
|
56
|
+
NSMutableArray *invocations = [NSMutableArray arrayWithCapacity:[examples count]];
|
57
|
+
for (Example *example in examples) {
|
58
|
+
SEL selector = [self addInstanceMethodForExample:example];
|
59
|
+
NSInvocation *invocation = [self invocationForInstanceMethodWithSelector:selector
|
60
|
+
example:example];
|
61
|
+
[invocations addObject:invocation];
|
62
|
+
}
|
63
|
+
|
64
|
+
return invocations;
|
65
|
+
}
|
66
|
+
|
67
|
+
/**
|
68
|
+
XCTest sets the invocation for the current test case instance using this setter.
|
69
|
+
QuickSpec hooks into this event to give the test case a reference to the current example.
|
70
|
+
It will need this reference to correctly report its name to XCTest.
|
71
|
+
*/
|
72
|
+
- (void)setInvocation:(NSInvocation *)invocation {
|
73
|
+
self.example = objc_getAssociatedObject(invocation, QCKExampleKey);
|
74
|
+
[super setInvocation:invocation];
|
75
|
+
}
|
76
|
+
|
77
|
+
#pragma mark - Public Interface
|
78
|
+
|
79
|
+
- (void)spec { }
|
80
|
+
|
81
|
+
#pragma mark - Internal Methods
|
82
|
+
|
83
|
+
/**
|
84
|
+
QuickSpec uses this method to dynamically define a new instance method for the
|
85
|
+
given example. The instance method runs the example, catching any exceptions.
|
86
|
+
The exceptions are then reported as test failures.
|
87
|
+
|
88
|
+
In order to report the correct file and line number, examples must raise exceptions
|
89
|
+
containing following keys in their userInfo:
|
90
|
+
|
91
|
+
- "SenTestFilenameKey": A String representing the file name
|
92
|
+
- "SenTestLineNumberKey": An Int representing the line number
|
93
|
+
|
94
|
+
These keys used to be used by SenTestingKit, and are still used by some testing tools
|
95
|
+
in the wild. See: https://github.com/Quick/Quick/pull/41
|
96
|
+
|
97
|
+
@return The selector of the newly defined instance method.
|
98
|
+
*/
|
99
|
+
+ (SEL)addInstanceMethodForExample:(Example *)example {
|
100
|
+
IMP implementation = imp_implementationWithBlock(^(id self){
|
101
|
+
[example run];
|
102
|
+
});
|
103
|
+
const char *types = [[NSString stringWithFormat:@"%s%s%s", @encode(id), @encode(id), @encode(SEL)] UTF8String];
|
104
|
+
SEL selector = NSSelectorFromString(example.name.qck_selectorName);
|
105
|
+
class_addMethod(self, selector, implementation, types);
|
106
|
+
|
107
|
+
return selector;
|
108
|
+
}
|
109
|
+
|
110
|
+
+ (NSInvocation *)invocationForInstanceMethodWithSelector:(SEL)selector
|
111
|
+
example:(Example *)example {
|
112
|
+
NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector];
|
113
|
+
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
|
114
|
+
invocation.selector = selector;
|
115
|
+
objc_setAssociatedObject(invocation,
|
116
|
+
QCKExampleKey,
|
117
|
+
example,
|
118
|
+
OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
119
|
+
return invocation;
|
120
|
+
}
|
121
|
+
|
122
|
+
/**
|
123
|
+
This method is used to record failures, whether they represent example
|
124
|
+
expectations that were not met, or exceptions raised during test setup
|
125
|
+
and teardown. By default, the failure will be reported as an
|
126
|
+
XCTest failure, and the example will be highlighted in Xcode.
|
127
|
+
*/
|
128
|
+
- (void)recordFailureWithDescription:(NSString *)description
|
129
|
+
inFile:(NSString *)filePath
|
130
|
+
atLine:(NSUInteger)lineNumber
|
131
|
+
expected:(BOOL)expected {
|
132
|
+
if (self.example.isSharedExample) {
|
133
|
+
filePath = self.example.callsite.file;
|
134
|
+
lineNumber = self.example.callsite.line;
|
135
|
+
}
|
136
|
+
[super recordFailureWithDescription:description
|
137
|
+
inFile:filePath
|
138
|
+
atLine:lineNumber
|
139
|
+
expected:expected];
|
140
|
+
}
|
141
|
+
|
142
|
+
@end
|
@@ -0,0 +1,197 @@
|
|
1
|
+
import Foundation
|
2
|
+
|
3
|
+
/**
|
4
|
+
A closure that, when evaluated, returns a dictionary of key-value
|
5
|
+
pairs that can be accessed from within a group of shared examples.
|
6
|
+
*/
|
7
|
+
public typealias SharedExampleContext = () -> (NSDictionary)
|
8
|
+
|
9
|
+
/**
|
10
|
+
A closure that is used to define a group of shared examples. This
|
11
|
+
closure may contain any number of example and example groups.
|
12
|
+
*/
|
13
|
+
public typealias SharedExampleClosure = (SharedExampleContext) -> ()
|
14
|
+
|
15
|
+
/**
|
16
|
+
A collection of state Quick builds up in order to work its magic.
|
17
|
+
World is primarily responsible for maintaining a mapping of QuickSpec
|
18
|
+
classes to root example groups for those classes.
|
19
|
+
|
20
|
+
It also maintains a mapping of shared example names to shared
|
21
|
+
example closures.
|
22
|
+
|
23
|
+
You may configure how Quick behaves by calling the -[World configure:]
|
24
|
+
method from within an overridden +[QuickConfiguration configure:] method.
|
25
|
+
*/
|
26
|
+
@objc final public class World {
|
27
|
+
/**
|
28
|
+
The example group that is currently being run.
|
29
|
+
The DSL requires that this group is correctly set in order to build a
|
30
|
+
correct hierarchy of example groups and their examples.
|
31
|
+
*/
|
32
|
+
public var currentExampleGroup: ExampleGroup?
|
33
|
+
|
34
|
+
/**
|
35
|
+
The example metadata of the test that is currently being run.
|
36
|
+
This is useful for using the Quick test metadata (like its name) at
|
37
|
+
runtime.
|
38
|
+
*/
|
39
|
+
|
40
|
+
public var currentExampleMetadata: ExampleMetadata?
|
41
|
+
|
42
|
+
/**
|
43
|
+
A flag that indicates whether additional test suites are being run
|
44
|
+
within this test suite. This is only true within the context of Quick
|
45
|
+
functional tests.
|
46
|
+
*/
|
47
|
+
public var isRunningAdditionalSuites = false
|
48
|
+
|
49
|
+
private var specs: Dictionary<String, ExampleGroup> = [:]
|
50
|
+
private var sharedExamples: [String: SharedExampleClosure] = [:]
|
51
|
+
private let configuration = Configuration()
|
52
|
+
private var isConfigurationFinalized = false
|
53
|
+
|
54
|
+
internal var exampleHooks: ExampleHooks {return configuration.exampleHooks }
|
55
|
+
internal var suiteHooks: SuiteHooks { return configuration.suiteHooks }
|
56
|
+
|
57
|
+
// MARK: Singleton Constructor
|
58
|
+
|
59
|
+
private init() {}
|
60
|
+
private struct Shared {
|
61
|
+
static let instance = World()
|
62
|
+
}
|
63
|
+
public class func sharedWorld() -> World {
|
64
|
+
return Shared.instance
|
65
|
+
}
|
66
|
+
|
67
|
+
// MARK: Public Interface
|
68
|
+
|
69
|
+
/**
|
70
|
+
Exposes the World's Configuration object within the scope of the closure
|
71
|
+
so that it may be configured. This method must not be called outside of
|
72
|
+
an overridden +[QuickConfiguration configure:] method.
|
73
|
+
|
74
|
+
:param: closure A closure that takes a Configuration object that can
|
75
|
+
be mutated to change Quick's behavior.
|
76
|
+
*/
|
77
|
+
public func configure(closure: QuickConfigurer) {
|
78
|
+
assert(!isConfigurationFinalized,
|
79
|
+
"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.")
|
80
|
+
closure(configuration: configuration)
|
81
|
+
}
|
82
|
+
|
83
|
+
/**
|
84
|
+
Finalizes the World's configuration.
|
85
|
+
Any subsequent calls to World.configure() will raise.
|
86
|
+
*/
|
87
|
+
public func finalizeConfiguration() {
|
88
|
+
isConfigurationFinalized = true
|
89
|
+
}
|
90
|
+
|
91
|
+
/**
|
92
|
+
Returns an internally constructed root example group for the given
|
93
|
+
QuickSpec class.
|
94
|
+
|
95
|
+
A root example group with the description "root example group" is lazily
|
96
|
+
initialized for each QuickSpec class. This root example group wraps the
|
97
|
+
top level of a -[QuickSpec spec] method--it's thanks to this group that
|
98
|
+
users can define beforeEach and it closures at the top level, like so:
|
99
|
+
|
100
|
+
override func spec() {
|
101
|
+
// These belong to the root example group
|
102
|
+
beforeEach {}
|
103
|
+
it("is at the top level") {}
|
104
|
+
}
|
105
|
+
|
106
|
+
:param: cls The QuickSpec class for which to retrieve the root example group.
|
107
|
+
:returns: The root example group for the class.
|
108
|
+
*/
|
109
|
+
public func rootExampleGroupForSpecClass(cls: AnyClass) -> ExampleGroup {
|
110
|
+
let name = NSStringFromClass(cls)
|
111
|
+
if let group = specs[name] {
|
112
|
+
return group
|
113
|
+
} else {
|
114
|
+
let group = ExampleGroup(
|
115
|
+
description: "root example group",
|
116
|
+
flags: [:],
|
117
|
+
isInternalRootExampleGroup: true
|
118
|
+
)
|
119
|
+
specs[name] = group
|
120
|
+
return group
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
/**
|
125
|
+
Returns all examples that should be run for a given spec class.
|
126
|
+
There are two filtering passes that occur when determining which examples should be run.
|
127
|
+
That is, these examples are the ones that are included by inclusion filters, and are
|
128
|
+
not excluded by exclusion filters.
|
129
|
+
|
130
|
+
:param: specClass The QuickSpec subclass for which examples are to be returned.
|
131
|
+
:returns: A list of examples to be run as test invocations.
|
132
|
+
*/
|
133
|
+
@objc(examplesForSpecClass:)
|
134
|
+
public func examples(specClass: AnyClass) -> [Example] {
|
135
|
+
// 1. Grab all included examples.
|
136
|
+
let included = includedExamples
|
137
|
+
// 2. Grab the intersection of (a) examples for this spec, and (b) included examples.
|
138
|
+
let spec = rootExampleGroupForSpecClass(specClass).examples.filter { contains(included, $0) }
|
139
|
+
// 3. Remove all excluded examples.
|
140
|
+
return spec.filter { example in
|
141
|
+
!self.configuration.exclusionFilters.reduce(false) { $0 || $1(example: example) }
|
142
|
+
}
|
143
|
+
}
|
144
|
+
|
145
|
+
// MARK: Internal
|
146
|
+
|
147
|
+
internal func registerSharedExample(name: String, closure: SharedExampleClosure) {
|
148
|
+
raiseIfSharedExampleAlreadyRegistered(name)
|
149
|
+
sharedExamples[name] = closure
|
150
|
+
}
|
151
|
+
|
152
|
+
internal func sharedExample(name: String) -> SharedExampleClosure {
|
153
|
+
raiseIfSharedExampleNotRegistered(name)
|
154
|
+
return sharedExamples[name]!
|
155
|
+
}
|
156
|
+
|
157
|
+
internal var exampleCount: Int {
|
158
|
+
return allExamples.count
|
159
|
+
}
|
160
|
+
|
161
|
+
private var allExamples: [Example] {
|
162
|
+
var all: [Example] = []
|
163
|
+
for (_, group) in specs {
|
164
|
+
group.walkDownExamples { all.append($0) }
|
165
|
+
}
|
166
|
+
return all
|
167
|
+
}
|
168
|
+
|
169
|
+
private var includedExamples: [Example] {
|
170
|
+
let all = allExamples
|
171
|
+
let included = all.filter { example in
|
172
|
+
return self.configuration.inclusionFilters.reduce(false) { $0 || $1(example: example) }
|
173
|
+
}
|
174
|
+
|
175
|
+
if included.isEmpty && configuration.runAllWhenEverythingFiltered {
|
176
|
+
return all
|
177
|
+
} else {
|
178
|
+
return included
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
182
|
+
private func raiseIfSharedExampleAlreadyRegistered(name: String) {
|
183
|
+
if sharedExamples[name] != nil {
|
184
|
+
NSException(name: NSInternalInconsistencyException,
|
185
|
+
reason: "A shared example named '\(name)' has already been registered.",
|
186
|
+
userInfo: nil).raise()
|
187
|
+
}
|
188
|
+
}
|
189
|
+
|
190
|
+
private func raiseIfSharedExampleNotRegistered(name: String) {
|
191
|
+
if sharedExamples[name] == nil {
|
192
|
+
NSException(name: NSInternalInconsistencyException,
|
193
|
+
reason: "No shared example named '\(name)' has been registered. Registered shared examples: '\(Array(sharedExamples.keys))'",
|
194
|
+
userInfo: nil).raise()
|
195
|
+
}
|
196
|
+
}
|
197
|
+
}
|