second_curtain 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/.gitignore +20 -0
- data/.travis.yml +7 -0
- data/CHANGELOG +20 -0
- data/Demo/Demo/ASHAppDelegate.h +15 -0
- data/Demo/Demo/ASHAppDelegate.m +18 -0
- data/Demo/Demo/ASHViewController.h +13 -0
- data/Demo/Demo/ASHViewController.m +30 -0
- data/Demo/Demo/Base.lproj/Main.storyboard +30 -0
- data/Demo/Demo/Demo-Info.plist +40 -0
- data/Demo/Demo/Demo-Prefix.pch +16 -0
- data/Demo/Demo/Images.xcassets/AppIcon.appiconset/Contents.json +23 -0
- data/Demo/Demo/Images.xcassets/LaunchImage.launchimage/Contents.json +23 -0
- data/Demo/Demo/en.lproj/InfoPlist.strings +2 -0
- data/Demo/Demo/main.m +18 -0
- data/Demo/Demo.xcodeproj/project.pbxproj +517 -0
- data/Demo/Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/Demo/Demo.xcodeproj/project.xcworkspace/xcshareddata/Demo.xccheckout +41 -0
- data/Demo/Demo.xcodeproj/project.xcworkspace/xcuserdata/ash.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme +96 -0
- data/Demo/Demo.xcodeproj/xcuserdata/ash.xcuserdatad/xcschemes/xcschememanagement.plist +27 -0
- data/Demo/Demo.xcodeproj/xcuserdata/orta.xcuserdatad/xcschemes/xcschememanagement.plist +27 -0
- data/Demo/Demo.xcworkspace/contents.xcworkspacedata +1 -0
- data/Demo/Demo.xcworkspace/xcshareddata/Demo.xccheckout +41 -0
- data/Demo/Demo.xcworkspace/xcuserdata/ash.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/Demo/Demo.xcworkspace/xcuserdata/orta.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/Demo/DemoTests/DemoTests-Info.plist +22 -0
- data/Demo/DemoTests/DemoTests.m +52 -0
- data/Demo/DemoTests/ReferenceImages/ASHViewControllerSpec/a_view_controller_with_a_loaded_view_should_have_a_valid_snapshot@2x.png +0 -0
- data/Demo/DemoTests/ReferenceImages/ASHViewControllerSpec/views_should_be_green@2x.png +0 -0
- data/Demo/DemoTests/ReferenceImages/ASHViewControllerSpec/views_should_be_red@2x.png +0 -0
- data/Demo/DemoTests/en.lproj/InfoPlist.strings +2 -0
- data/Demo/Makefile +15 -0
- data/Demo/Podfile +16 -0
- data/Demo/Podfile.lock +21 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPBackwardCompatibility.h +42 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPBlockDefinedMatcher.h +25 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPDefines.h +17 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPDoubleTuple.h +13 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPExpect.h +45 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPFloatTuple.h +13 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatcher.h +20 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatcherHelpers.h +4 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beCloseTo.h +7 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beFalsy.h +3 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beGreaterThan.h +6 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beGreaterThanOrEqualTo.h +6 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beIdenticalTo.h +10 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beInTheRangeOf.h +6 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beInstanceOf.h +7 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beKindOf.h +5 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beLessThan.h +6 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beLessThanOrEqualTo.h +6 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beNil.h +5 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beSubclassOf.h +5 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beSupersetOf.h +4 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beTruthy.h +3 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+beginWith.h +5 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+conformTo.h +3 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+contain.h +5 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+endWith.h +3 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+equal.h +5 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+haveCountOf.h +10 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+notify.h +4 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+raise.h +4 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+raiseWithReason.h +3 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers+respondTo.h +3 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPMatchers.h +24 -0
- data/Demo/Pods/BuildHeaders/Expecta/EXPUnsupportedObject.h +11 -0
- data/Demo/Pods/BuildHeaders/Expecta/Expecta.h +27 -0
- data/Demo/Pods/BuildHeaders/Expecta/ExpectaSupport.h +64 -0
- data/Demo/Pods/BuildHeaders/Expecta/NSObject+Expecta.h +14 -0
- data/Demo/Pods/BuildHeaders/Expecta/NSValue+Expecta.h +8 -0
- data/Demo/Pods/BuildHeaders/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.h +21 -0
- data/Demo/Pods/BuildHeaders/FBSnapshotTestCase/FBSnapshotTestCase.h +87 -0
- data/Demo/Pods/BuildHeaders/FBSnapshotTestCase/FBSnapshotTestController.h +147 -0
- data/Demo/Pods/BuildHeaders/FBSnapshotTestCase/UIImage+Compare.h +37 -0
- data/Demo/Pods/BuildHeaders/FBSnapshotTestCase/UIImage+Diff.h +37 -0
- data/Demo/Pods/BuildHeaders/Specta/SPTExample.h +14 -0
- data/Demo/Pods/BuildHeaders/Specta/SPTExampleGroup.h +40 -0
- data/Demo/Pods/BuildHeaders/Specta/SPTNestedReporter.h +5 -0
- data/Demo/Pods/BuildHeaders/Specta/SPTReporter.h +33 -0
- data/Demo/Pods/BuildHeaders/Specta/SPTSharedExampleGroups.h +17 -0
- data/Demo/Pods/BuildHeaders/Specta/SPTSpec.h +21 -0
- data/Demo/Pods/BuildHeaders/Specta/SPTXCTestCase.h +27 -0
- data/Demo/Pods/BuildHeaders/Specta/SPTXCTestReporter.h +9 -0
- data/Demo/Pods/BuildHeaders/Specta/Specta.h +70 -0
- data/Demo/Pods/BuildHeaders/Specta/SpectaSupport.h +46 -0
- data/Demo/Pods/BuildHeaders/Specta/SpectaTypes.h +3 -0
- data/Demo/Pods/BuildHeaders/Specta/SpectaUtility.h +14 -0
- data/Demo/Pods/BuildHeaders/Specta/XCTestCase+Specta.h +4 -0
- data/Demo/Pods/BuildHeaders/Specta/XCTestLog+Specta.h +7 -0
- data/Demo/Pods/BuildHeaders/Specta/XCTestRun+Specta.h +8 -0
- data/Demo/Pods/Expecta/LICENSE +19 -0
- data/Demo/Pods/Expecta/README.md +308 -0
- data/Demo/Pods/Expecta/src/EXPBackwardCompatibility.h +42 -0
- data/Demo/Pods/Expecta/src/EXPBackwardCompatibility.m +17 -0
- data/Demo/Pods/Expecta/src/EXPBlockDefinedMatcher.h +25 -0
- data/Demo/Pods/Expecta/src/EXPBlockDefinedMatcher.m +60 -0
- data/Demo/Pods/Expecta/src/EXPDefines.h +17 -0
- data/Demo/Pods/Expecta/src/EXPDoubleTuple.h +13 -0
- data/Demo/Pods/Expecta/src/EXPDoubleTuple.m +42 -0
- data/Demo/Pods/Expecta/src/EXPExpect.h +45 -0
- data/Demo/Pods/Expecta/src/EXPExpect.m +214 -0
- data/Demo/Pods/Expecta/src/EXPFloatTuple.h +13 -0
- data/Demo/Pods/Expecta/src/EXPFloatTuple.m +42 -0
- data/Demo/Pods/Expecta/src/EXPMatcher.h +20 -0
- data/Demo/Pods/Expecta/src/EXPUnsupportedObject.h +11 -0
- data/Demo/Pods/Expecta/src/EXPUnsupportedObject.m +20 -0
- data/Demo/Pods/Expecta/src/Expecta.h +27 -0
- data/Demo/Pods/Expecta/src/Expecta.m +15 -0
- data/Demo/Pods/Expecta/src/ExpectaSupport.h +64 -0
- data/Demo/Pods/Expecta/src/ExpectaSupport.m +187 -0
- data/Demo/Pods/Expecta/src/NSObject+Expecta.h +14 -0
- data/Demo/Pods/Expecta/src/NSValue+Expecta.h +8 -0
- data/Demo/Pods/Expecta/src/NSValue+Expecta.m +21 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatcherHelpers.h +4 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatcherHelpers.m +9 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beCloseTo.h +7 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beCloseTo.m +49 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beFalsy.h +3 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beFalsy.m +24 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThan.h +6 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThan.m +20 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThanOrEqualTo.h +6 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThanOrEqualTo.m +20 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beIdenticalTo.h +10 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beIdenticalTo.m +24 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.h +6 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m +30 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.h +7 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m +27 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.h +5 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m +27 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beLessThan.h +6 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beLessThan.m +20 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beLessThanOrEqualTo.h +6 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beLessThanOrEqualTo.m +20 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beNil.h +5 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beNil.m +16 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beSubclassOf.h +5 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beSubclassOf.m +27 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beSupersetOf.h +4 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beSupersetOf.m +57 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beTruthy.h +3 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beTruthy.m +24 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beginWith.h +5 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+beginWith.m +49 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+conformTo.h +3 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+conformTo.m +33 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+contain.h +5 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+contain.m +38 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+endWith.h +3 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+endWith.m +49 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+equal.h +5 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+equal.m +24 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+haveCountOf.h +10 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+haveCountOf.m +36 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+notify.h +4 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+notify.m +63 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+raise.h +4 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+raise.m +30 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+raiseWithReason.h +3 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+raiseWithReason.m +35 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+respondTo.h +3 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers+respondTo.m +28 -0
- data/Demo/Pods/Expecta/src/matchers/EXPMatchers.h +24 -0
- data/Demo/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.h +21 -0
- data/Demo/Pods/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.m +308 -0
- data/Demo/Pods/Expecta+Snapshots/LICENSE.md +22 -0
- data/Demo/Pods/Expecta+Snapshots/README.md +85 -0
- data/Demo/Pods/FBSnapshotTestCase/FBSnapshotTestCase.h +87 -0
- data/Demo/Pods/FBSnapshotTestCase/FBSnapshotTestCase.m +82 -0
- data/Demo/Pods/FBSnapshotTestCase/FBSnapshotTestController.h +147 -0
- data/Demo/Pods/FBSnapshotTestCase/FBSnapshotTestController.m +376 -0
- data/Demo/Pods/FBSnapshotTestCase/LICENSE +29 -0
- data/Demo/Pods/FBSnapshotTestCase/README.md +83 -0
- data/Demo/Pods/FBSnapshotTestCase/UIImage+Compare.h +37 -0
- data/Demo/Pods/FBSnapshotTestCase/UIImage+Compare.m +87 -0
- data/Demo/Pods/FBSnapshotTestCase/UIImage+Diff.h +37 -0
- data/Demo/Pods/FBSnapshotTestCase/UIImage+Diff.m +56 -0
- data/Demo/Pods/Headers/Expecta/EXPBackwardCompatibility.h +42 -0
- data/Demo/Pods/Headers/Expecta/EXPBlockDefinedMatcher.h +25 -0
- data/Demo/Pods/Headers/Expecta/EXPDefines.h +17 -0
- data/Demo/Pods/Headers/Expecta/EXPDoubleTuple.h +13 -0
- data/Demo/Pods/Headers/Expecta/EXPExpect.h +45 -0
- data/Demo/Pods/Headers/Expecta/EXPFloatTuple.h +13 -0
- data/Demo/Pods/Headers/Expecta/EXPMatcher.h +20 -0
- data/Demo/Pods/Headers/Expecta/EXPMatcherHelpers.h +4 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beCloseTo.h +7 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beFalsy.h +3 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beGreaterThan.h +6 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beGreaterThanOrEqualTo.h +6 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beIdenticalTo.h +10 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beInTheRangeOf.h +6 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beInstanceOf.h +7 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beKindOf.h +5 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beLessThan.h +6 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beLessThanOrEqualTo.h +6 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beNil.h +5 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beSubclassOf.h +5 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beSupersetOf.h +4 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beTruthy.h +3 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+beginWith.h +5 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+conformTo.h +3 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+contain.h +5 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+endWith.h +3 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+equal.h +5 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+haveCountOf.h +10 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+notify.h +4 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+raise.h +4 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+raiseWithReason.h +3 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers+respondTo.h +3 -0
- data/Demo/Pods/Headers/Expecta/EXPMatchers.h +24 -0
- data/Demo/Pods/Headers/Expecta/EXPUnsupportedObject.h +11 -0
- data/Demo/Pods/Headers/Expecta/Expecta.h +27 -0
- data/Demo/Pods/Headers/Expecta/ExpectaSupport.h +64 -0
- data/Demo/Pods/Headers/Expecta/NSObject+Expecta.h +14 -0
- data/Demo/Pods/Headers/Expecta/NSValue+Expecta.h +8 -0
- data/Demo/Pods/Headers/Expecta+Snapshots/EXPMatchers+FBSnapshotTest.h +21 -0
- data/Demo/Pods/Headers/FBSnapshotTestCase/FBSnapshotTestCase.h +87 -0
- data/Demo/Pods/Headers/FBSnapshotTestCase/FBSnapshotTestController.h +147 -0
- data/Demo/Pods/Headers/FBSnapshotTestCase/UIImage+Compare.h +37 -0
- data/Demo/Pods/Headers/FBSnapshotTestCase/UIImage+Diff.h +37 -0
- data/Demo/Pods/Headers/Specta/SPTExample.h +14 -0
- data/Demo/Pods/Headers/Specta/SPTExampleGroup.h +40 -0
- data/Demo/Pods/Headers/Specta/SPTNestedReporter.h +5 -0
- data/Demo/Pods/Headers/Specta/SPTReporter.h +33 -0
- data/Demo/Pods/Headers/Specta/SPTSharedExampleGroups.h +17 -0
- data/Demo/Pods/Headers/Specta/SPTSpec.h +21 -0
- data/Demo/Pods/Headers/Specta/SPTXCTestCase.h +27 -0
- data/Demo/Pods/Headers/Specta/SPTXCTestReporter.h +9 -0
- data/Demo/Pods/Headers/Specta/Specta.h +70 -0
- data/Demo/Pods/Headers/Specta/SpectaSupport.h +46 -0
- data/Demo/Pods/Headers/Specta/SpectaTypes.h +3 -0
- data/Demo/Pods/Headers/Specta/SpectaUtility.h +14 -0
- data/Demo/Pods/Headers/Specta/XCTestCase+Specta.h +4 -0
- data/Demo/Pods/Headers/Specta/XCTestLog+Specta.h +7 -0
- data/Demo/Pods/Headers/Specta/XCTestRun+Specta.h +8 -0
- data/Demo/Pods/Manifest.lock +21 -0
- data/Demo/Pods/Pods-DemoTests-EXPMatchers+FBSnapshotTest-Private.xcconfig +6 -0
- data/Demo/Pods/Pods-DemoTests-EXPMatchers+FBSnapshotTest-dummy.m +5 -0
- data/Demo/Pods/Pods-DemoTests-EXPMatchers+FBSnapshotTest-prefix.pch +5 -0
- data/Demo/Pods/Pods-DemoTests-EXPMatchers+FBSnapshotTest.xcconfig +2 -0
- data/Demo/Pods/Pods-DemoTests-Expecta+Snapshots-Private.xcconfig +6 -0
- data/Demo/Pods/Pods-DemoTests-Expecta+Snapshots-dummy.m +5 -0
- data/Demo/Pods/Pods-DemoTests-Expecta+Snapshots-prefix.pch +5 -0
- data/Demo/Pods/Pods-DemoTests-Expecta+Snapshots.xcconfig +2 -0
- data/Demo/Pods/Pods-DemoTests-Expecta-Private.xcconfig +5 -0
- data/Demo/Pods/Pods-DemoTests-Expecta-dummy.m +5 -0
- data/Demo/Pods/Pods-DemoTests-Expecta-prefix.pch +5 -0
- data/Demo/Pods/Pods-DemoTests-Expecta.xcconfig +1 -0
- data/Demo/Pods/Pods-DemoTests-FBSnapshotTestCase-Private.xcconfig +6 -0
- data/Demo/Pods/Pods-DemoTests-FBSnapshotTestCase-dummy.m +5 -0
- data/Demo/Pods/Pods-DemoTests-FBSnapshotTestCase-prefix.pch +6 -0
- data/Demo/Pods/Pods-DemoTests-FBSnapshotTestCase.xcconfig +2 -0
- data/Demo/Pods/Pods-DemoTests-Specta-Private.xcconfig +6 -0
- data/Demo/Pods/Pods-DemoTests-Specta-dummy.m +5 -0
- data/Demo/Pods/Pods-DemoTests-Specta-prefix.pch +5 -0
- data/Demo/Pods/Pods-DemoTests-Specta.xcconfig +2 -0
- data/Demo/Pods/Pods-DemoTests-acknowledgements.markdown +109 -0
- data/Demo/Pods/Pods-DemoTests-acknowledgements.plist +151 -0
- data/Demo/Pods/Pods-DemoTests-dummy.m +5 -0
- data/Demo/Pods/Pods-DemoTests-environment.h +32 -0
- data/Demo/Pods/Pods-DemoTests-resources.sh +68 -0
- data/Demo/Pods/Pods-DemoTests.xcconfig +6 -0
- data/Demo/Pods/Pods.xcodeproj/project.pbxproj +1390 -0
- data/Demo/Pods/Pods.xcodeproj/xcuserdata/ash.xcuserdatad/xcschemes/Pods-DemoTests-Expecta+Snapshots.xcscheme +59 -0
- data/Demo/Pods/Pods.xcodeproj/xcuserdata/ash.xcuserdatad/xcschemes/Pods-DemoTests-Expecta.xcscheme +59 -0
- data/Demo/Pods/Pods.xcodeproj/xcuserdata/ash.xcuserdatad/xcschemes/Pods-DemoTests-FBSnapshotTestCase.xcscheme +59 -0
- data/Demo/Pods/Pods.xcodeproj/xcuserdata/ash.xcuserdatad/xcschemes/Pods-DemoTests-Specta.xcscheme +59 -0
- data/Demo/Pods/Pods.xcodeproj/xcuserdata/ash.xcuserdatad/xcschemes/Pods-DemoTests.xcscheme +59 -0
- data/Demo/Pods/Pods.xcodeproj/xcuserdata/ash.xcuserdatad/xcschemes/xcschememanagement.plist +62 -0
- data/Demo/Pods/Specta/LICENSE +20 -0
- data/Demo/Pods/Specta/README.md +146 -0
- data/Demo/Pods/Specta/src/SPTExample.h +14 -0
- data/Demo/Pods/Specta/src/SPTExample.m +16 -0
- data/Demo/Pods/Specta/src/SPTExampleGroup.h +40 -0
- data/Demo/Pods/Specta/src/SPTExampleGroup.m +326 -0
- data/Demo/Pods/Specta/src/SPTNestedReporter.h +5 -0
- data/Demo/Pods/Specta/src/SPTNestedReporter.m +194 -0
- data/Demo/Pods/Specta/src/SPTReporter.h +33 -0
- data/Demo/Pods/Specta/src/SPTReporter.m +134 -0
- data/Demo/Pods/Specta/src/SPTSharedExampleGroups.h +17 -0
- data/Demo/Pods/Specta/src/SPTSharedExampleGroups.m +62 -0
- data/Demo/Pods/Specta/src/SPTSpec.h +21 -0
- data/Demo/Pods/Specta/src/SPTSpec.m +31 -0
- data/Demo/Pods/Specta/src/SPTXCTestCase.h +27 -0
- data/Demo/Pods/Specta/src/SPTXCTestCase.m +151 -0
- data/Demo/Pods/Specta/src/SPTXCTestReporter.h +9 -0
- data/Demo/Pods/Specta/src/SPTXCTestReporter.m +11 -0
- data/Demo/Pods/Specta/src/Specta.h +70 -0
- data/Demo/Pods/Specta/src/Specta.m +144 -0
- data/Demo/Pods/Specta/src/SpectaSupport.h +46 -0
- data/Demo/Pods/Specta/src/SpectaTypes.h +3 -0
- data/Demo/Pods/Specta/src/SpectaUtility.h +14 -0
- data/Demo/Pods/Specta/src/SpectaUtility.m +65 -0
- data/Demo/Pods/Specta/src/XCTestCase+Specta.h +4 -0
- data/Demo/Pods/Specta/src/XCTestCase+Specta.m +26 -0
- data/Demo/Pods/Specta/src/XCTestLog+Specta.h +7 -0
- data/Demo/Pods/Specta/src/XCTestLog+Specta.m +49 -0
- data/Demo/Pods/Specta/src/XCTestRun+Specta.h +8 -0
- data/Demo/Pods/Specta/src/XCTestRun+Specta.m +44 -0
- data/Gemfile +5 -0
- data/LICENSE +21 -0
- data/README.md +146 -0
- data/Rakefile +7 -0
- data/second_curtain.gemspec +20 -0
- data/spec/sample_output.txt +79 -0
- data/spec/second_shutter/kaleidoscope_command_spec.rb +25 -0
- data/spec/second_shutter/parser_spec.rb +39 -0
- data/spec/second_shutter/test_suite_spec.rb +32 -0
- data/spec/second_shutter/upload_manager_spec.rb +60 -0
- data/spec/second_shutter/upload_spec.rb +34 -0
- data/spec/second_shutter/xcode_test_case_spec.rb +22 -0
- metadata +315 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#import "SPTSharedExampleGroups.h"
|
|
2
|
+
#import "SPTExampleGroup.h"
|
|
3
|
+
#import "SPTXCTestCase.h"
|
|
4
|
+
#import "SpectaUtility.h"
|
|
5
|
+
#import <objc/runtime.h>
|
|
6
|
+
|
|
7
|
+
NSMutableDictionary *globalSharedExampleGroups = nil;
|
|
8
|
+
BOOL initialized = NO;
|
|
9
|
+
|
|
10
|
+
@implementation SPTSharedExampleGroups
|
|
11
|
+
|
|
12
|
+
+ (void)initialize {
|
|
13
|
+
Class SPTSharedExampleGroupsClass = [SPTSharedExampleGroups class];
|
|
14
|
+
if ([self class] == SPTSharedExampleGroupsClass) {
|
|
15
|
+
if (!initialized) {
|
|
16
|
+
initialized = YES;
|
|
17
|
+
globalSharedExampleGroups = [[NSMutableDictionary alloc] init];
|
|
18
|
+
|
|
19
|
+
Class *classes = NULL;
|
|
20
|
+
int numClasses = objc_getClassList(NULL, 0);
|
|
21
|
+
|
|
22
|
+
if (numClasses > 0) {
|
|
23
|
+
classes = (Class *)malloc(sizeof(Class) * numClasses);
|
|
24
|
+
numClasses = objc_getClassList(classes, numClasses);
|
|
25
|
+
|
|
26
|
+
Class klass, superClass;
|
|
27
|
+
for(uint i = 0; i < numClasses; i++) {
|
|
28
|
+
klass = classes[i];
|
|
29
|
+
superClass = class_getSuperclass(klass);
|
|
30
|
+
if (superClass == SPTSharedExampleGroupsClass) {
|
|
31
|
+
[klass defineSharedExampleGroups];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
free(classes);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
+ (void)addSharedExampleGroupWithName:(NSString *)name block:(SPTDictionaryBlock)block exampleGroup:(SPTExampleGroup *)exampleGroup {
|
|
42
|
+
(exampleGroup == nil ? globalSharedExampleGroups : exampleGroup.sharedExamples)[name] = [block copy];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
+ (SPTDictionaryBlock)sharedExampleGroupWithName:(NSString *)name exampleGroup:(SPTExampleGroup *)exampleGroup {
|
|
46
|
+
SPTDictionaryBlock sharedExampleGroup = nil;
|
|
47
|
+
while (exampleGroup != nil) {
|
|
48
|
+
if ((sharedExampleGroup = exampleGroup.sharedExamples[name])) {
|
|
49
|
+
return sharedExampleGroup;
|
|
50
|
+
}
|
|
51
|
+
exampleGroup = exampleGroup.parent;
|
|
52
|
+
}
|
|
53
|
+
return globalSharedExampleGroups[name];
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
+ (void)defineSharedExampleGroups {}
|
|
57
|
+
|
|
58
|
+
+ (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filename atLine:(NSUInteger)lineNumber expected:(BOOL)expected {
|
|
59
|
+
[SPTCurrentTestCase recordFailureWithDescription:description inFile:filename atLine:lineNumber expected:expected];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
@class
|
|
4
|
+
SPTExample
|
|
5
|
+
, SPTExampleGroup
|
|
6
|
+
;
|
|
7
|
+
|
|
8
|
+
@interface SPTSpec : NSObject
|
|
9
|
+
|
|
10
|
+
@property (nonatomic, strong) SPTExampleGroup *rootGroup;
|
|
11
|
+
@property (nonatomic, strong) NSMutableArray *groupStack;
|
|
12
|
+
@property (nonatomic, strong) NSArray *compiledExamples;
|
|
13
|
+
@property (nonatomic, strong) NSString *fileName;
|
|
14
|
+
@property (nonatomic) NSUInteger lineNumber;
|
|
15
|
+
@property (nonatomic, getter = isDisabled) BOOL disabled;
|
|
16
|
+
@property (nonatomic) BOOL hasFocusedExamples;
|
|
17
|
+
|
|
18
|
+
- (SPTExampleGroup *)currentGroup;
|
|
19
|
+
- (void)compile;
|
|
20
|
+
|
|
21
|
+
@end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#import "SPTSpec.h"
|
|
2
|
+
#import "SPTExampleGroup.h"
|
|
3
|
+
#import "SPTExample.h"
|
|
4
|
+
|
|
5
|
+
@implementation SPTSpec
|
|
6
|
+
|
|
7
|
+
- (id)init {
|
|
8
|
+
self = [super init];
|
|
9
|
+
if (self) {
|
|
10
|
+
self.rootGroup = [[SPTExampleGroup alloc] init];
|
|
11
|
+
self.rootGroup.root = self.rootGroup;
|
|
12
|
+
self.groupStack = [NSMutableArray arrayWithObject:self.rootGroup];
|
|
13
|
+
}
|
|
14
|
+
return self;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
- (SPTExampleGroup *)currentGroup {
|
|
18
|
+
return [self.groupStack lastObject];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
- (void)compile {
|
|
22
|
+
self.compiledExamples = [self.rootGroup compileExamplesWithNameStack:@[]];
|
|
23
|
+
for (SPTExample *example in self.compiledExamples) {
|
|
24
|
+
if (example.focused) {
|
|
25
|
+
self.hasFocusedExamples = YES;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#import <XCTest/XCTest.h>
|
|
2
|
+
#import "XCTestCase+Specta.h"
|
|
3
|
+
|
|
4
|
+
@class
|
|
5
|
+
SPTSpec
|
|
6
|
+
, SPTExample
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
@interface SPTXCTestCase : XCTestCase
|
|
10
|
+
|
|
11
|
+
@property (nonatomic, strong) NSInvocation *spt_invocation;
|
|
12
|
+
@property (nonatomic, strong) XCTestCaseRun *spt_run;
|
|
13
|
+
@property (nonatomic, assign) BOOL spt_skipped;
|
|
14
|
+
@property (nonatomic, assign, readonly, getter = spt_isPending) BOOL spt_pending;
|
|
15
|
+
|
|
16
|
+
+ (BOOL)spt_isDisabled;
|
|
17
|
+
+ (void)spt_setDisabled:(BOOL)disabled;
|
|
18
|
+
+ (BOOL)spt_focusedExamplesExist;
|
|
19
|
+
|
|
20
|
+
+ (SPTSpec *)spt_spec;
|
|
21
|
+
- (void)spt_setCurrentSpecWithFileName:(const char *)fileName lineNumber:(NSUInteger)lineNumber;
|
|
22
|
+
- (void)spt_defineSpec;
|
|
23
|
+
- (void)spt_unsetCurrentSpec;
|
|
24
|
+
- (void)spt_runExampleAtIndex:(NSUInteger)index;
|
|
25
|
+
- (SPTExample *)spt_getCurrentExample;
|
|
26
|
+
|
|
27
|
+
@end
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#import "SPTXCTestCase.h"
|
|
2
|
+
#import "SPTSpec.h"
|
|
3
|
+
#import "SPTExample.h"
|
|
4
|
+
#import "SPTSharedExampleGroups.h"
|
|
5
|
+
#import "SpectaUtility.h"
|
|
6
|
+
#import <objc/runtime.h>
|
|
7
|
+
|
|
8
|
+
@implementation SPTXCTestCase
|
|
9
|
+
|
|
10
|
+
+ (void)initialize {
|
|
11
|
+
[SPTSharedExampleGroups initialize];
|
|
12
|
+
SPTSpec *spec = [[SPTSpec alloc] init];
|
|
13
|
+
SPTXCTestCase *testCase = [[[self class] alloc] init];
|
|
14
|
+
objc_setAssociatedObject(self, "spt_spec", spec, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
15
|
+
[testCase spt_defineSpec];
|
|
16
|
+
[spec compile];
|
|
17
|
+
[super initialize];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
+ (SPTSpec *)spt_spec {
|
|
21
|
+
return objc_getAssociatedObject(self, "spt_spec");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
+ (BOOL)spt_isDisabled {
|
|
25
|
+
return [self spt_spec].disabled;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
+ (void)spt_setDisabled:(BOOL)disabled {
|
|
29
|
+
[self spt_spec].disabled = disabled;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
- (BOOL)spt_isPending {
|
|
33
|
+
SPTExample *example = [self spt_getCurrentExample];
|
|
34
|
+
return example == nil || example.pending;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
+ (NSArray *)spt_allSpecClasses {
|
|
38
|
+
static NSArray *allSpecClasses = nil;
|
|
39
|
+
static dispatch_once_t onceToken;
|
|
40
|
+
dispatch_once(&onceToken, ^{
|
|
41
|
+
|
|
42
|
+
NSMutableArray *specClasses = [[NSMutableArray alloc] init];
|
|
43
|
+
|
|
44
|
+
int numberOfClasses = objc_getClassList(NULL, 0);
|
|
45
|
+
if (numberOfClasses > 0) {
|
|
46
|
+
Class *classes = (Class *)malloc(sizeof(Class) * numberOfClasses);
|
|
47
|
+
numberOfClasses = objc_getClassList(classes, numberOfClasses);
|
|
48
|
+
|
|
49
|
+
for (int classIndex = 0; classIndex < numberOfClasses; classIndex++) {
|
|
50
|
+
Class aClass = classes[classIndex];
|
|
51
|
+
if (SPTIsSpecClass(aClass)) {
|
|
52
|
+
[specClasses addObject:aClass];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
free(classes);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
allSpecClasses = [specClasses copy];
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return allSpecClasses;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
+ (BOOL)spt_focusedExamplesExist {
|
|
66
|
+
for (Class specClass in [self spt_allSpecClasses]) {
|
|
67
|
+
SPTSpec *spec = [specClass spt_spec];
|
|
68
|
+
if (spec.disabled == NO && [spec hasFocusedExamples]) {
|
|
69
|
+
return YES;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return NO;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
- (void)spt_setCurrentSpecWithFileName:(const char *)fileName lineNumber:(NSUInteger)lineNumber {
|
|
77
|
+
SPTSpec *spec = [[self class] spt_spec];
|
|
78
|
+
spec.fileName = @(fileName);
|
|
79
|
+
spec.lineNumber = lineNumber;
|
|
80
|
+
[[NSThread currentThread] threadDictionary][SPTCurrentSpecKey] = spec;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
- (void)spt_defineSpec {}
|
|
84
|
+
|
|
85
|
+
- (void)spt_unsetCurrentSpec {
|
|
86
|
+
[[[NSThread currentThread] threadDictionary] removeObjectForKey:SPTCurrentSpecKey];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
- (void)spt_runExampleAtIndex:(NSUInteger)index {
|
|
90
|
+
[[NSThread currentThread] threadDictionary][SPTCurrentTestCaseKey] = self;
|
|
91
|
+
SPTExample *compiledExample = ([[self class] spt_spec].compiledExamples)[index];
|
|
92
|
+
if (!compiledExample.pending) {
|
|
93
|
+
if ([[self class] spt_isDisabled] == NO &&
|
|
94
|
+
(compiledExample.focused || [[self class] spt_focusedExamplesExist] == NO)) {
|
|
95
|
+
((SPTVoidBlock)compiledExample.block)();
|
|
96
|
+
} else {
|
|
97
|
+
self.spt_skipped = YES;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[[[NSThread currentThread] threadDictionary] removeObjectForKey:SPTCurrentTestCaseKey];
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
- (SPTExample *)spt_getCurrentExample {
|
|
105
|
+
if (!self.spt_invocation) {
|
|
106
|
+
return nil;
|
|
107
|
+
}
|
|
108
|
+
NSUInteger i;
|
|
109
|
+
[self.spt_invocation getArgument:&i atIndex:2];
|
|
110
|
+
return ([[self class] spt_spec].compiledExamples)[i];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
#pragma mark - XCTestCase overrides
|
|
114
|
+
|
|
115
|
+
+ (NSArray *)testInvocations {
|
|
116
|
+
NSMutableArray *invocations = [NSMutableArray array];
|
|
117
|
+
for(NSUInteger i = 0; i < [[self spt_spec].compiledExamples count]; i ++) {
|
|
118
|
+
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[self instanceMethodSignatureForSelector:@selector(spt_runExampleAtIndex:)]];
|
|
119
|
+
NSUInteger j = i;
|
|
120
|
+
[invocation setSelector:@selector(spt_runExampleAtIndex:)];
|
|
121
|
+
[invocation setArgument:&j atIndex:2];
|
|
122
|
+
[invocations addObject:invocation];
|
|
123
|
+
}
|
|
124
|
+
return invocations;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
- (void)setInvocation:(NSInvocation *)invocation {
|
|
128
|
+
self.spt_invocation = invocation;
|
|
129
|
+
[super setInvocation:invocation];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
- (NSString *)name {
|
|
133
|
+
NSString *specName = NSStringFromClass([self class]);
|
|
134
|
+
SPTExample *compiledExample = [self spt_getCurrentExample];
|
|
135
|
+
NSCharacterSet *charSet = [NSCharacterSet characterSetWithCharactersInString:@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"];
|
|
136
|
+
NSString *exampleName = [[compiledExample.name componentsSeparatedByCharactersInSet:[charSet invertedSet]] componentsJoinedByString:@"_"];
|
|
137
|
+
return [NSString stringWithFormat:@"-[%@ %@]", specName, exampleName];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
- (void)recordFailureWithDescription:(NSString *)description inFile:(NSString *)filename atLine:(NSUInteger)lineNumber expected:(BOOL)expected {
|
|
141
|
+
SPTXCTestCase *currentTestCase = SPTCurrentTestCase;
|
|
142
|
+
[currentTestCase.spt_run recordFailureInTest:currentTestCase withDescription:description inFile:filename atLine:lineNumber expected:expected];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
- (void)performTest:(XCTestRun *)run {
|
|
146
|
+
self.spt_run = (XCTestCaseRun *)run;
|
|
147
|
+
[super performTest:run];
|
|
148
|
+
self.spt_run = nil;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@end
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#import "SPTReporter.h"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Reporter that produces output identical to XCode's default output. Useful when integrating with 3rd-party tools that
|
|
5
|
+
* may not like SPTNestedReporter's indented output.
|
|
6
|
+
*/
|
|
7
|
+
@interface SPTXCTestReporter : SPTReporter
|
|
8
|
+
|
|
9
|
+
@end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#import "SPTXCTestReporter.h"
|
|
2
|
+
|
|
3
|
+
@implementation SPTXCTestReporter
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Intentionally left blank.
|
|
7
|
+
* This class is included for future-compatibility just in case we need to
|
|
8
|
+
* weak reporter output for users who want test output idential to XCTestLog.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
@end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
#import <XCTest/XCTest.h>
|
|
3
|
+
#import "SpectaSupport.h"
|
|
4
|
+
#import "SPTXCTestCase.h"
|
|
5
|
+
#import "SPTSpec.h"
|
|
6
|
+
#import "SPTExampleGroup.h"
|
|
7
|
+
#import "SPTSharedExampleGroups.h"
|
|
8
|
+
|
|
9
|
+
@interface Specta : NSObject
|
|
10
|
+
@end
|
|
11
|
+
|
|
12
|
+
#define SpecBegin(name) _SPTSpecBegin(name, __FILE__, __LINE__)
|
|
13
|
+
#define SpecEnd _SPTSpecEnd
|
|
14
|
+
|
|
15
|
+
#define SharedExamplesBegin(name) _SPTSharedExampleGroupsBegin(name)
|
|
16
|
+
#define SharedExamplesEnd _SPTSharedExampleGroupsEnd
|
|
17
|
+
#define SharedExampleGroupsBegin(name) _SPTSharedExampleGroupsBegin(name)
|
|
18
|
+
#define SharedExampleGroupsEnd _SPTSharedExampleGroupsEnd
|
|
19
|
+
|
|
20
|
+
#ifdef SPT_CEDAR_SYNTAX
|
|
21
|
+
# define SPEC_BEGIN(name) SpecBegin(name)
|
|
22
|
+
# define SPEC_END SpecEnd
|
|
23
|
+
# define SHARED_EXAMPLE_GROUPS_BEGIN(name) SharedExamplesBegin(name)
|
|
24
|
+
# define SHARED_EXAMPLE_GROUPS_END SharedExamplesEnd
|
|
25
|
+
# ifndef PENDING
|
|
26
|
+
# define PENDING nil
|
|
27
|
+
# endif
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
void SPTdescribe(NSString *name, BOOL focused, void (^block)());
|
|
31
|
+
void describe(NSString *name, void (^block)());
|
|
32
|
+
void fdescribe(NSString *name, void (^block)());
|
|
33
|
+
void context(NSString *name, void (^block)());
|
|
34
|
+
void fcontext(NSString *name, void (^block)());
|
|
35
|
+
|
|
36
|
+
void SPTexample(NSString *name, BOOL focused, id block);
|
|
37
|
+
void example(NSString *name, id block);
|
|
38
|
+
void fexample(NSString *name, id block);
|
|
39
|
+
void it(NSString *name, id block);
|
|
40
|
+
void fit(NSString *name, id block);
|
|
41
|
+
void specify(NSString *name, id block);
|
|
42
|
+
void fspecify(NSString *name, id block);
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
void SPTpending(NSString *name, ...);
|
|
46
|
+
#define xdescribe(...) SPTpending(__VA_ARGS__, nil)
|
|
47
|
+
#define xcontext(...) SPTpending(__VA_ARGS__, nil)
|
|
48
|
+
#define xexample(...) SPTpending(__VA_ARGS__, nil)
|
|
49
|
+
#define xit(...) SPTpending(__VA_ARGS__, nil)
|
|
50
|
+
#define xspecify(...) SPTpending(__VA_ARGS__, nil)
|
|
51
|
+
#define pending(...) SPTpending(__VA_ARGS__, nil)
|
|
52
|
+
|
|
53
|
+
void beforeAll(id block);
|
|
54
|
+
void afterAll(id block);
|
|
55
|
+
void beforeEach(id block);
|
|
56
|
+
void afterEach(id block);
|
|
57
|
+
void before(id block);
|
|
58
|
+
void after(id block);
|
|
59
|
+
|
|
60
|
+
void sharedExamplesFor(NSString *name, void (^block)(NSDictionary *data));
|
|
61
|
+
void sharedExamples(NSString *name, void (^block)(NSDictionary *data));
|
|
62
|
+
|
|
63
|
+
void SPTitShouldBehaveLike(const char *fileName, NSUInteger lineNumber, NSString *name, id dictionaryOrBlock);
|
|
64
|
+
void itShouldBehaveLike(NSString *name, id dictionaryOrBlockOrNil); // aid code completion
|
|
65
|
+
void itBehavesLike(NSString *name, id dictionaryOrBlockOrNil);
|
|
66
|
+
#define itShouldBehaveLike(...) SPTitShouldBehaveLike(__FILE__, __LINE__, __VA_ARGS__)
|
|
67
|
+
#define itBehavesLike(...) SPTitShouldBehaveLike(__FILE__, __LINE__, __VA_ARGS__)
|
|
68
|
+
|
|
69
|
+
void setAsyncSpecTimeout(NSTimeInterval timeout);
|
|
70
|
+
#define AsyncBlock (void (^done)(void))
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#import "Specta.h"
|
|
2
|
+
#import "SpectaTypes.h"
|
|
3
|
+
#import "SpectaUtility.h"
|
|
4
|
+
|
|
5
|
+
@implementation Specta
|
|
6
|
+
@end
|
|
7
|
+
|
|
8
|
+
void SPTdescribe(NSString *name, BOOL focused, void (^block)()) {
|
|
9
|
+
if (block) {
|
|
10
|
+
[SPTGroupStack addObject:[SPTCurrentGroup addExampleGroupWithName:name focused:focused]];
|
|
11
|
+
block();
|
|
12
|
+
[SPTGroupStack removeLastObject];
|
|
13
|
+
} else {
|
|
14
|
+
SPTexample(name, focused, nil);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
void describe(NSString *name, void (^block)()) {
|
|
19
|
+
SPTdescribe(name, NO, block);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
void fdescribe(NSString *name, void (^block)()) {
|
|
23
|
+
SPTdescribe(name, YES, block);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
void context(NSString *name, void (^block)()) {
|
|
27
|
+
SPTdescribe(name, NO, block);
|
|
28
|
+
}
|
|
29
|
+
void fcontext(NSString *name, void (^block)()) {
|
|
30
|
+
SPTdescribe(name, YES, block);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
void SPTexample(NSString *name, BOOL focused, id block) {
|
|
34
|
+
SPTReturnUnlessBlockOrNil(block);
|
|
35
|
+
[SPTCurrentGroup addExampleWithName:name block:block focused:focused];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
void example(NSString *name, id block) {
|
|
39
|
+
SPTexample(name, NO, block);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
void fexample(NSString *name, id block) {
|
|
43
|
+
SPTexample(name, YES, block);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
void it(NSString *name, id block) {
|
|
47
|
+
SPTexample(name, NO, block);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
void fit(NSString *name, id block) {
|
|
51
|
+
SPTexample(name, YES, block);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
void specify(NSString *name, id block) {
|
|
55
|
+
SPTexample(name, NO, block);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
void fspecify(NSString *name, id block) {
|
|
59
|
+
SPTexample(name, YES, block);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
void SPTpending(NSString *name, ...) {
|
|
63
|
+
SPTexample(name, NO, nil);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
void beforeAll(id block) {
|
|
67
|
+
SPTReturnUnlessBlockOrNil(block);
|
|
68
|
+
[SPTCurrentGroup addBeforeAllBlock:block];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
void afterAll(id block) {
|
|
72
|
+
SPTReturnUnlessBlockOrNil(block);
|
|
73
|
+
[SPTCurrentGroup addAfterAllBlock:block];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
void beforeEach(id block) {
|
|
77
|
+
SPTReturnUnlessBlockOrNil(block);
|
|
78
|
+
[SPTCurrentGroup addBeforeEachBlock:block];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
void afterEach(id block) {
|
|
82
|
+
SPTReturnUnlessBlockOrNil(block);
|
|
83
|
+
[SPTCurrentGroup addAfterEachBlock:block];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
void before(id block) {
|
|
87
|
+
beforeEach(block);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
void after(id block) {
|
|
91
|
+
afterEach(block);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
void sharedExamplesFor(NSString *name, void (^block)(NSDictionary *data)) {
|
|
95
|
+
[SPTSharedExampleGroups addSharedExampleGroupWithName:name block:block exampleGroup:SPTCurrentGroup];
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
void sharedExamples(NSString *name, void (^block)(NSDictionary *data)) {
|
|
99
|
+
sharedExamplesFor(name, block);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
void SPTitShouldBehaveLike(const char *fileName, NSUInteger lineNumber, NSString *name, id dictionaryOrBlock) {
|
|
103
|
+
SPTDictionaryBlock block = [SPTSharedExampleGroups sharedExampleGroupWithName:name exampleGroup:SPTCurrentGroup];
|
|
104
|
+
if (block) {
|
|
105
|
+
if (SPTIsBlock(dictionaryOrBlock)) {
|
|
106
|
+
id (^dataBlock)(void) = [dictionaryOrBlock copy];
|
|
107
|
+
|
|
108
|
+
describe(name, ^{
|
|
109
|
+
__block NSMutableDictionary *dataDict = [[NSMutableDictionary alloc] init];
|
|
110
|
+
|
|
111
|
+
beforeEach(^{
|
|
112
|
+
NSDictionary *blockData = dataBlock();
|
|
113
|
+
[dataDict removeAllObjects];
|
|
114
|
+
[dataDict addEntriesFromDictionary:blockData];
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
block(dataDict);
|
|
118
|
+
|
|
119
|
+
afterAll(^{
|
|
120
|
+
dataDict = nil;
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
} else {
|
|
124
|
+
NSDictionary *data = dictionaryOrBlock;
|
|
125
|
+
|
|
126
|
+
describe(name, ^{
|
|
127
|
+
block(data);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
} else {
|
|
131
|
+
SPTXCTestCase *currentTestCase = SPTCurrentTestCase;
|
|
132
|
+
if (currentTestCase) {
|
|
133
|
+
[currentTestCase recordFailureWithDescription:@"itShouldBehaveLike should not be invoked inside an example block!" inFile:@(fileName) atLine:lineNumber expected:NO];
|
|
134
|
+
} else {
|
|
135
|
+
it(name, ^{
|
|
136
|
+
[currentTestCase recordFailureWithDescription:[NSString stringWithFormat:@"Shared example group \"%@\" does not exist.", name] inFile:@(fileName) atLine:lineNumber expected:NO];
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
void setAsyncSpecTimeout(NSTimeInterval timeout) {
|
|
143
|
+
[SPTExampleGroup setAsyncSpecTimeout:timeout];
|
|
144
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#ifndef SPT_SUBCLASS
|
|
2
|
+
#define SPT_SUBCLASS SPTXCTestCase
|
|
3
|
+
#endif
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
#define _SPTSpecBegin(name, file, line) \
|
|
8
|
+
@interface name##Spec : SPT_SUBCLASS \
|
|
9
|
+
@end \
|
|
10
|
+
@implementation name##Spec \
|
|
11
|
+
- (void)spt_defineSpec { \
|
|
12
|
+
const char *specFileName = file; \
|
|
13
|
+
@try { \
|
|
14
|
+
[self spt_setCurrentSpecWithFileName:(file) lineNumber:(line)];
|
|
15
|
+
|
|
16
|
+
#define _SPTSpecEnd \
|
|
17
|
+
[self spt_unsetCurrentSpec]; \
|
|
18
|
+
} @catch(NSException *exception) { \
|
|
19
|
+
fprintf(stderr, "%s: An exception has occured outside of tests, aborting.\n\n%s (%s) \n", specFileName, [[exception name] UTF8String], [[exception reason] UTF8String]); \
|
|
20
|
+
if ([exception respondsToSelector:@selector(callStackSymbols)]) { \
|
|
21
|
+
NSArray *callStackSymbols = [exception callStackSymbols]; \
|
|
22
|
+
if (callStackSymbols) { \
|
|
23
|
+
NSString *callStack = [NSString stringWithFormat:@"\n Call Stack:\n %@\n", [callStackSymbols componentsJoinedByString:@"\n "]]; \
|
|
24
|
+
fprintf(stderr, "%s", [callStack UTF8String]); \
|
|
25
|
+
} \
|
|
26
|
+
} \
|
|
27
|
+
exit(1); \
|
|
28
|
+
} \
|
|
29
|
+
} \
|
|
30
|
+
@end
|
|
31
|
+
|
|
32
|
+
#define _SPTSharedExampleGroupsBegin(name) \
|
|
33
|
+
@interface name##SharedExampleGroups : SPTSharedExampleGroups \
|
|
34
|
+
@end \
|
|
35
|
+
@implementation name##SharedExampleGroups \
|
|
36
|
+
+ (void)defineSharedExampleGroups {
|
|
37
|
+
|
|
38
|
+
#define _SPTSharedExampleGroupsEnd \
|
|
39
|
+
} \
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
#undef _XCTRegisterFailure
|
|
43
|
+
#define _XCTRegisterFailure(condition, format...) \
|
|
44
|
+
({ \
|
|
45
|
+
_XCTFailureHandler((id)self, YES, __FILE__, __LINE__, condition, @"" format); \
|
|
46
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
extern NSString * const SPTCurrentSpecKey;
|
|
3
|
+
extern NSString * const SPTCurrentTestCaseKey;
|
|
4
|
+
|
|
5
|
+
#define SPTCurrentSpec [[NSThread currentThread] threadDictionary][SPTCurrentSpecKey]
|
|
6
|
+
#define SPTCurrentTestCase [[NSThread currentThread] threadDictionary][SPTCurrentTestCaseKey]
|
|
7
|
+
#define SPTCurrentGroup [SPTCurrentSpec currentGroup]
|
|
8
|
+
#define SPTGroupStack [SPTCurrentSpec groupStack]
|
|
9
|
+
|
|
10
|
+
#define SPTReturnUnlessBlockOrNil(block) if ((block) && !SPTIsBlock((block))) return;
|
|
11
|
+
#define SPTIsBlock(obj) [(obj) isKindOfClass:NSClassFromString(@"NSBlock")]
|
|
12
|
+
|
|
13
|
+
const char *SPTGetBlockSignature(id blockObject);
|
|
14
|
+
BOOL SPTIsSpecClass(Class aClass);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
#import "SpectaUtility.h"
|
|
2
|
+
#import "SPTXCTestCase.h"
|
|
3
|
+
#import <objc/runtime.h>
|
|
4
|
+
|
|
5
|
+
NSString * const SPTCurrentSpecKey = @"SPTCurrentSpec";
|
|
6
|
+
NSString * const SPTCurrentTestCaseKey = @"SPTCurrentTestCase";
|
|
7
|
+
|
|
8
|
+
// http://clang.llvm.org/docs/Block-ABI-Apple.html
|
|
9
|
+
struct SPTBlockLiteral {
|
|
10
|
+
void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock
|
|
11
|
+
int flags;
|
|
12
|
+
int reserved;
|
|
13
|
+
void (*invoke)(void *, ...);
|
|
14
|
+
struct Block_descriptor_1 {
|
|
15
|
+
unsigned long int reserved; // NULL
|
|
16
|
+
unsigned long int size; // sizeof(struct Block_literal_1)
|
|
17
|
+
// optional helper functions
|
|
18
|
+
void (*copy_helper)(void *dst, void *src); // IFF (1<<25)
|
|
19
|
+
void (*dispose_helper)(void *src); // IFF (1<<25)
|
|
20
|
+
// required ABI.2010.3.16
|
|
21
|
+
const char *signature; // IFF (1<<30)
|
|
22
|
+
} *descriptor;
|
|
23
|
+
// imported variables
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
enum {
|
|
27
|
+
SPT_BLOCK_HAS_COPY_DISPOSE = (1 << 25),
|
|
28
|
+
SPT_BLOCK_HAS_CTOR = (1 << 26), // helpers have C++ code
|
|
29
|
+
SPT_BLOCK_IS_GLOBAL = (1 << 28),
|
|
30
|
+
SPT_BLOCK_HAS_STRET = (1 << 29), // IFF BLOCK_HAS_SIGNATURE
|
|
31
|
+
SPT_BLOCK_HAS_SIGNATURE = (1 << 30),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const char *SPTGetBlockSignature(id blockObject) {
|
|
35
|
+
struct SPTBlockLiteral *block = (__bridge struct SPTBlockLiteral *)blockObject;
|
|
36
|
+
|
|
37
|
+
int flags = block->flags;
|
|
38
|
+
|
|
39
|
+
if (flags & SPT_BLOCK_HAS_SIGNATURE) {
|
|
40
|
+
void *signaturePtr = block->descriptor;
|
|
41
|
+
signaturePtr += sizeof(unsigned long int); // skip reserved
|
|
42
|
+
signaturePtr += sizeof(unsigned long int); // skip size
|
|
43
|
+
|
|
44
|
+
if (flags & SPT_BLOCK_HAS_COPY_DISPOSE) {
|
|
45
|
+
signaturePtr += sizeof(void(*)(void *dst, void *src)); // skip copy_helper
|
|
46
|
+
signaturePtr += sizeof(void(*)(void *src)); // skip dispose_helper
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return *(const char **)signaturePtr;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return NULL;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
BOOL SPTIsSpecClass(Class aClass) {
|
|
56
|
+
Class superclass = class_getSuperclass(aClass);
|
|
57
|
+
while (superclass != Nil) {
|
|
58
|
+
if (superclass == [SPTXCTestCase class]) {
|
|
59
|
+
return YES;
|
|
60
|
+
} else {
|
|
61
|
+
superclass = class_getSuperclass(superclass);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return NO;
|
|
65
|
+
}
|