├── Pods ├── Headers │ └── Private │ │ ├── Quick │ │ ├── Quick.h │ │ ├── World.h │ │ ├── QCKDSL.h │ │ ├── QuickSpec.h │ │ ├── World+DSL.h │ │ ├── QuickXCTestBase.h │ │ ├── NSString+QCKSelectorName.h │ │ ├── QuickConfiguration.h │ │ ├── QuickXCTestFactory.h │ │ ├── QuickRuntimeUtilities.h │ │ └── NSInvocation+QCKXProperties.h │ │ └── Nimble │ │ ├── DSL.h │ │ ├── Nimble.h │ │ └── NMBExceptionCapture.h ├── Target Support Files │ ├── Quick │ │ ├── Quick-prefix.pch │ │ ├── Quick.modulemap │ │ ├── Quick-dummy.m │ │ ├── Quick-umbrella.h │ │ ├── Quick.xcconfig │ │ └── Info.plist │ ├── Regex │ │ ├── Regex-prefix.pch │ │ ├── Regex.modulemap │ │ ├── Regex-dummy.m │ │ ├── Regex-umbrella.h │ │ ├── Regex.xcconfig │ │ └── Info.plist │ ├── Nimble │ │ ├── Nimble-prefix.pch │ │ ├── Nimble.modulemap │ │ ├── Nimble-dummy.m │ │ ├── Nimble-umbrella.h │ │ ├── Nimble.xcconfig │ │ └── Info.plist │ ├── Pods │ │ ├── Pods.modulemap │ │ ├── Pods-dummy.m │ │ ├── Pods-umbrella.h │ │ ├── Pods.debug.xcconfig │ │ ├── Pods.release.xcconfig │ │ ├── Info.plist │ │ ├── Pods-acknowledgements.markdown │ │ ├── Pods-acknowledgements.plist │ │ └── Pods-frameworks.sh │ └── Pods-FunkyTests │ │ ├── Pods-FunkyTests.modulemap │ │ ├── Pods-FunkyTests-dummy.m │ │ ├── Pods-FunkyTests-umbrella.h │ │ ├── Pods-FunkyTests.debug.xcconfig │ │ ├── Pods-FunkyTests.release.xcconfig │ │ ├── Info.plist │ │ └── Pods-FunkyTests-frameworks.sh ├── Quick │ ├── Quick │ │ ├── Reporter.swift │ │ ├── Bootstrap.swift │ │ ├── Environment.swift │ │ ├── Runners │ │ │ └── XCTest │ │ │ │ ├── XCTestRunner.swift │ │ │ │ ├── QuickXCTestBase.m │ │ │ │ ├── QuickXCTestBase.h │ │ │ │ ├── QuickXCTestFactory.m │ │ │ │ ├── QuickXCTestFactory.h │ │ │ │ ├── NSInvocation+QCKXProperties.h │ │ │ │ ├── NSInvocation+QCKXProperties.m │ │ │ │ ├── QuickRuntimeUtilities.m │ │ │ │ └── QuickRuntimeUtilities.h │ │ ├── Quick.h │ │ ├── NSString+QCKSelectorName.h │ │ ├── ExampleMetadata.swift │ │ ├── World.h │ │ ├── Callsite.swift │ │ ├── Hooks │ │ │ ├── SuiteHooks.swift │ │ │ ├── Closures.swift │ │ │ └── ExampleHooks.swift │ │ ├── Filter.swift │ │ ├── Configuration │ │ │ ├── QuickConfiguration.h │ │ │ └── QuickConfiguration.m │ │ ├── NSString+QCKSelectorName.m │ │ ├── DSL │ │ │ ├── World+DSL.h │ │ │ └── QCKDSL.m │ │ ├── QuickSpec.h │ │ ├── ExampleGroup.swift │ │ └── Example.swift │ └── README.md ├── Nimble │ └── Nimble │ │ ├── Nimble.h │ │ ├── Utils │ │ ├── Functional.swift │ │ ├── SourceLocation.swift │ │ ├── Stringers.swift │ │ └── Poll.swift │ │ ├── objc │ │ ├── NMBExceptionCapture.h │ │ └── NMBExceptionCapture.m │ │ ├── Matchers │ │ ├── BeNil.swift │ │ ├── Match.swift │ │ ├── BeIdenticalTo.swift │ │ ├── BeLessThan.swift │ │ ├── BeAKindOf.swift │ │ ├── BeAnInstanceOf.swift │ │ ├── BeGreaterThan.swift │ │ ├── BeLessThanOrEqual.swift │ │ ├── BeGreaterThanOrEqualTo.swift │ │ ├── HaveCount.swift │ │ ├── BeginWith.swift │ │ ├── EndWith.swift │ │ ├── MatcherProtocols.swift │ │ ├── BeLogical.swift │ │ └── AllPass.swift │ │ ├── Adapters │ │ ├── AssertionDispatcher.swift │ │ ├── AdapterProtocols.swift │ │ ├── NimbleXCTestHandler.swift │ │ └── AssertionRecorder.swift │ │ ├── DSL.swift │ │ ├── FailureMessage.swift │ │ ├── DSL+Wait.swift │ │ ├── Expectation.swift │ │ └── Wrappers │ │ ├── ObjCMatcher.swift │ │ └── MatcherFunc.swift ├── Local Podspecs │ ├── Regex.podspec.json │ ├── Nimble.podspec.json │ └── Quick.podspec.json ├── Manifest.lock └── Pods.xcodeproj │ └── xcshareddata │ └── xcschemes │ └── Regex.xcscheme ├── _build-experiment ├── .peru │ ├── cache │ │ ├── trees │ │ │ ├── HEAD │ │ │ ├── objects │ │ │ │ ├── 12 │ │ │ │ │ └── 3b549108c1dc5c60da829cf13754f538678a14 │ │ │ │ ├── 30 │ │ │ │ │ └── f4dcb94adb298815a18bfea47b1f0dfc4550c0 │ │ │ │ ├── 57 │ │ │ │ │ └── 3eff33977e7002bfff823a2b74fbf8d8f1612b │ │ │ │ ├── 78 │ │ │ │ │ └── c578511b589b6c0df78483c02f479e6e85cfd6 │ │ │ │ ├── 91 │ │ │ │ │ └── b951425a14782cd8e30cafb8496592cfd6bb13 │ │ │ │ ├── 96 │ │ │ │ │ └── e734250e43965e26225e43c91807f8a8c17313 │ │ │ │ ├── 4b │ │ │ │ │ └── 825dc642cb6eb9a060e54bf8d69288fbee4904 │ │ │ │ ├── 0c │ │ │ │ │ └── 982418d03b163f6b738457367798cc2a8ebb53 │ │ │ │ ├── 1c │ │ │ │ │ └── b37dc4104657d3262e25e97d1411041c7c6090 │ │ │ │ ├── 4f │ │ │ │ │ └── 33bd7e67797c73d73f258d88abb7cbaee8fce2 │ │ │ │ ├── 6e │ │ │ │ │ └── ebd1fce3ef158e60bbcd80b4053a99bdf32ad1 │ │ │ │ ├── 7d │ │ │ │ │ └── 3ee23be8fe51c5cb540fe932d6dfc7caa466c1 │ │ │ │ ├── 9a │ │ │ │ │ └── 130374376803ece514108ca61004a4d96558e4 │ │ │ │ ├── 9b │ │ │ │ │ └── 9e2f25d3e3bc1f6294cc68f3fdfb2fe696a092 │ │ │ │ ├── 9e │ │ │ │ │ └── bcb3845a42bf805a1282d78ab3500b15be0854 │ │ │ │ ├── a3 │ │ │ │ │ └── cd143a40e0267e4a0d1716fbc11ff069fe7371 │ │ │ │ ├── bd │ │ │ │ │ └── 01d8fa0da6220bf2e56f976785ea435a967dee │ │ │ │ ├── c2 │ │ │ │ │ └── bfeabe873a647cc6526ed020854a41dab919ea │ │ │ │ ├── ca │ │ │ │ │ ├── 7c13f6d14f436938b193ba7ecfb21fe2ee2c30 │ │ │ │ │ └── 88136baee2e8eea0b11d8f1fa998eb86dce07d │ │ │ │ ├── d1 │ │ │ │ │ └── 473a6f988f85faeb49028cdfa9258e69e3b76c │ │ │ │ ├── dc │ │ │ │ │ └── b678129eec0f0bfe5f53916531dd14122a6cfc │ │ │ │ ├── e6 │ │ │ │ │ ├── dc7296c1edfb35e808c8994b9e6e5339d5580c │ │ │ │ │ └── e458dcc13bc81c11693067f27c1be427dd6327 │ │ │ │ ├── ed │ │ │ │ │ └── fd2ecb6caa6d9d6a8dc2fad4788d78ad7e2635 │ │ │ │ ├── ee │ │ │ │ │ └── 3c04f21f9cb6d8c13ddcba220462ec25bdad88 │ │ │ │ └── fc │ │ │ │ │ └── 5575bd6010b84b09d2add37468e2d41fa0e1e4 │ │ │ ├── description │ │ │ ├── index │ │ │ ├── config │ │ │ ├── hooks │ │ │ │ ├── post-update.sample │ │ │ │ ├── pre-applypatch.sample │ │ │ │ ├── applypatch-msg.sample │ │ │ │ ├── commit-msg.sample │ │ │ │ ├── prepare-commit-msg.sample │ │ │ │ ├── pre-push.sample │ │ │ │ └── pre-commit.sample │ │ │ └── info │ │ │ │ └── exclude │ │ ├── keyval │ │ │ ├── 12d1166412d27fdb4ba63f2dc572d199d39f7600 │ │ │ ├── 21951ff9799f4e36f6ba0fb710897f375ce4c329 │ │ │ ├── 60a2fcdaead789c51c3d69b98285a59fbc0ae4e1 │ │ │ ├── cf65bb64d184b47fb96deb590ce6ab0628be8148 │ │ │ └── e86afab5086284b2eef22a5d283e8e3f1e6c9036 │ │ └── plugins │ │ │ └── git │ │ │ └── 098d4c9b6e37c040a449b7c12776a0b3a20e5385 │ │ │ └── https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit │ │ │ ├── HEAD │ │ │ ├── description │ │ │ ├── index │ │ │ ├── hooks │ │ │ ├── post-update.sample │ │ │ ├── pre-applypatch.sample │ │ │ ├── applypatch-msg.sample │ │ │ ├── commit-msg.sample │ │ │ ├── prepare-commit-msg.sample │ │ │ ├── pre-push.sample │ │ │ └── pre-commit.sample │ │ │ ├── config │ │ │ ├── info │ │ │ └── exclude │ │ │ ├── objects │ │ │ └── pack │ │ │ │ ├── pack-4441df4bcb74aaf709bcf995bdfa4385509944d5.idx │ │ │ │ └── pack-4441df4bcb74aaf709bcf995bdfa4385509944d5.pack │ │ │ ├── packed-refs │ │ │ └── FETCH_HEAD │ └── lastimports ├── test.rb ├── peru.yaml └── vendor │ └── LlamaKit │ └── Info.plist ├── .xctool-args ├── Funky.sublime-project ├── Funky.xcodeproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── Funky.xcworkspace └── contents.xcworkspacedata ├── Podfile ├── Funky ├── Funky.h └── Info.plist ├── src ├── Operators.ErrorIO.swift ├── Operators.apply.swift ├── Functions.Math.swift ├── Operators.fmap.swift ├── Operators.pipe.swift ├── Functions.Lazy.swift ├── NSError+Coalescing.swift ├── Functions.Result.swift ├── Operators.bind.swift ├── Functions.File.swift ├── Functions.ErrorIO.swift ├── Operators.compose.swift └── Operators.Misc.swift ├── Funky.podspec ├── FunkyTests ├── Info.plist ├── ErrorIOTests.swift ├── RegexTests.swift ├── FunkyTests.swift └── Functions.FunctionalTests.swift ├── Podfile.lock ├── LICENSE.md ├── Makefile ├── README.md └── .gitignore /Pods/Headers/Private/Quick/Quick.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/Quick.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Quick/World.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/World.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Nimble/DSL.h: -------------------------------------------------------------------------------- 1 | ../../../Nimble/Nimble/objc/DSL.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Nimble/Nimble.h: -------------------------------------------------------------------------------- 1 | ../../../Nimble/Nimble/Nimble.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Quick/QCKDSL.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/DSL/QCKDSL.h -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /Pods/Headers/Private/Quick/QuickSpec.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/QuickSpec.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Quick/World+DSL.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/DSL/World+DSL.h -------------------------------------------------------------------------------- /_build-experiment/.peru/lastimports: -------------------------------------------------------------------------------- 1 | 96e734250e43965e26225e43c91807f8a8c17313 -------------------------------------------------------------------------------- /Pods/Headers/Private/Nimble/NMBExceptionCapture.h: -------------------------------------------------------------------------------- 1 | ../../../Nimble/Nimble/objc/NMBExceptionCapture.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Quick/QuickXCTestBase.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/Runners/XCTest/QuickXCTestBase.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Quick/NSString+QCKSelectorName.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/NSString+QCKSelectorName.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Quick/QuickConfiguration.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/Configuration/QuickConfiguration.h -------------------------------------------------------------------------------- /Pods/Headers/Private/Quick/QuickXCTestFactory.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/Runners/XCTest/QuickXCTestFactory.h -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904: -------------------------------------------------------------------------------- 1 | x+)JMU0` 2 | , -------------------------------------------------------------------------------- /Pods/Headers/Private/Quick/QuickRuntimeUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/Runners/XCTest/QuickRuntimeUtilities.h -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Regex-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Nimble-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/keyval/12d1166412d27fdb4ba63f2dc572d199d39f7600: -------------------------------------------------------------------------------- 1 | 1cb37dc4104657d3262e25e97d1411041c7c6090 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/keyval/21951ff9799f4e36f6ba0fb710897f375ce4c329: -------------------------------------------------------------------------------- 1 | c2bfeabe873a647cc6526ed020854a41dab919ea -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/keyval/60a2fcdaead789c51c3d69b98285a59fbc0ae4e1: -------------------------------------------------------------------------------- 1 | 123b549108c1dc5c60da829cf13754f538678a14 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/keyval/cf65bb64d184b47fb96deb590ce6ab0628be8148: -------------------------------------------------------------------------------- 1 | 9ebcb3845a42bf805a1282d78ab3500b15be0854 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/keyval/e86afab5086284b2eef22a5d283e8e3f1e6c9036: -------------------------------------------------------------------------------- 1 | 96e734250e43965e26225e43c91807f8a8c17313 -------------------------------------------------------------------------------- /.xctool-args: -------------------------------------------------------------------------------- 1 | [ 2 | "-workspace", "Funky.xcworkspace", 3 | "-scheme", "Funky", 4 | "-configuration", "Debug" 5 | ] 6 | -------------------------------------------------------------------------------- /Pods/Headers/Private/Quick/NSInvocation+QCKXProperties.h: -------------------------------------------------------------------------------- 1 | ../../../Quick/Quick/Runners/XCTest/NSInvocation+QCKXProperties.h -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/index -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods { 2 | umbrella header "Pods-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick.modulemap: -------------------------------------------------------------------------------- 1 | framework module Quick { 2 | umbrella header "Quick-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Regex.modulemap: -------------------------------------------------------------------------------- 1 | framework module Regex { 2 | umbrella header "Regex-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Nimble.modulemap: -------------------------------------------------------------------------------- 1 | framework module Nimble { 2 | umbrella header "Nimble-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods : NSObject 3 | @end 4 | @implementation PodsDummy_Pods 5 | @end 6 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = true 5 | ignorecase = true 6 | precomposeunicode = true 7 | -------------------------------------------------------------------------------- /Funky.sublime-project: -------------------------------------------------------------------------------- 1 | { "folders": [ 2 | { "path": "./src", 3 | "name": "src" }, 4 | { "path": ".", 5 | "name": "Funky" } 6 | ] 7 | } 8 | 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Nimble-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Nimble : NSObject 3 | @end 4 | @implementation PodsDummy_Nimble 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Quick : NSObject 3 | @end 4 | @implementation PodsDummy_Quick 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Regex-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Regex : NSObject 3 | @end 4 | @implementation PodsDummy_Regex 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double PodsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char PodsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Regex-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double RegexVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char RegexVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-FunkyTests/Pods-FunkyTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_FunkyTests { 2 | umbrella header "Pods-FunkyTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-FunkyTests/Pods-FunkyTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_FunkyTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_FunkyTests 5 | @end 6 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/0c/982418d03b163f6b738457367798cc2a8ebb53: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/0c/982418d03b163f6b738457367798cc2a8ebb53 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/12/3b549108c1dc5c60da829cf13754f538678a14: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/12/3b549108c1dc5c60da829cf13754f538678a14 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/1c/b37dc4104657d3262e25e97d1411041c7c6090: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/1c/b37dc4104657d3262e25e97d1411041c7c6090 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/30/f4dcb94adb298815a18bfea47b1f0dfc4550c0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/30/f4dcb94adb298815a18bfea47b1f0dfc4550c0 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/4f/33bd7e67797c73d73f258d88abb7cbaee8fce2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/4f/33bd7e67797c73d73f258d88abb7cbaee8fce2 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/57/3eff33977e7002bfff823a2b74fbf8d8f1612b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/57/3eff33977e7002bfff823a2b74fbf8d8f1612b -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/6e/ebd1fce3ef158e60bbcd80b4053a99bdf32ad1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/6e/ebd1fce3ef158e60bbcd80b4053a99bdf32ad1 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/78/c578511b589b6c0df78483c02f479e6e85cfd6: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/78/c578511b589b6c0df78483c02f479e6e85cfd6 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/7d/3ee23be8fe51c5cb540fe932d6dfc7caa466c1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/7d/3ee23be8fe51c5cb540fe932d6dfc7caa466c1 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/91/b951425a14782cd8e30cafb8496592cfd6bb13: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/91/b951425a14782cd8e30cafb8496592cfd6bb13 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/96/e734250e43965e26225e43c91807f8a8c17313: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/96/e734250e43965e26225e43c91807f8a8c17313 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/9a/130374376803ece514108ca61004a4d96558e4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/9a/130374376803ece514108ca61004a4d96558e4 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/9b/9e2f25d3e3bc1f6294cc68f3fdfb2fe696a092: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/9b/9e2f25d3e3bc1f6294cc68f3fdfb2fe696a092 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/9e/bcb3845a42bf805a1282d78ab3500b15be0854: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/9e/bcb3845a42bf805a1282d78ab3500b15be0854 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/a3/cd143a40e0267e4a0d1716fbc11ff069fe7371: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/a3/cd143a40e0267e4a0d1716fbc11ff069fe7371 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/bd/01d8fa0da6220bf2e56f976785ea435a967dee: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/bd/01d8fa0da6220bf2e56f976785ea435a967dee -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/c2/bfeabe873a647cc6526ed020854a41dab919ea: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/c2/bfeabe873a647cc6526ed020854a41dab919ea -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/ca/7c13f6d14f436938b193ba7ecfb21fe2ee2c30: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/ca/7c13f6d14f436938b193ba7ecfb21fe2ee2c30 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/ca/88136baee2e8eea0b11d8f1fa998eb86dce07d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/ca/88136baee2e8eea0b11d8f1fa998eb86dce07d -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/d1/473a6f988f85faeb49028cdfa9258e69e3b76c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/d1/473a6f988f85faeb49028cdfa9258e69e3b76c -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/dc/b678129eec0f0bfe5f53916531dd14122a6cfc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/dc/b678129eec0f0bfe5f53916531dd14122a6cfc -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/e6/dc7296c1edfb35e808c8994b9e6e5339d5580c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/e6/dc7296c1edfb35e808c8994b9e6e5339d5580c -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/e6/e458dcc13bc81c11693067f27c1be427dd6327: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/e6/e458dcc13bc81c11693067f27c1be427dd6327 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/ed/fd2ecb6caa6d9d6a8dc2fad4788d78ad7e2635: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/ed/fd2ecb6caa6d9d6a8dc2fad4788d78ad7e2635 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/ee/3c04f21f9cb6d8c13ddcba220462ec25bdad88: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/ee/3c04f21f9cb6d8c13ddcba220462ec25bdad88 -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/objects/fc/5575bd6010b84b09d2add37468e2d41fa0e1e4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/trees/objects/fc/5575bd6010b84b09d2add37468e2d41fa0e1e4 -------------------------------------------------------------------------------- /Pods/Quick/Quick/Reporter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Reporter.swift 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | -------------------------------------------------------------------------------- /_build-experiment/test.rb: -------------------------------------------------------------------------------- 1 | 2 | require './build-tools' 3 | 4 | 5 | project = loadProject name: 'Funky' 6 | 7 | project.addSubmodule 'LlamaKit', globs: ['vendor/LlamaKit/*.swift'] 8 | project.save() 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Funky.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Nimble.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "NMBExceptionCapture.h" 3 | #import "DSL.h" 4 | 5 | FOUNDATION_EXPORT double NimbleVersionNumber; 6 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[]; -------------------------------------------------------------------------------- /Pods/Quick/Quick/Bootstrap.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Bootstrap.swift 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Environment.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Environment.swift 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/28/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-FunkyTests/Pods-FunkyTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_FunkyTestsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_FunkyTestsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Runners/XCTest/XCTestRunner.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XCTestRunner.swift 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Utils/Functional.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | internal func all(array: [T], fn: (T) -> Bool) -> Bool { 4 | for item in array { 5 | if !fn(item) { 6 | return false 7 | } 8 | } 9 | return true 10 | } 11 | 12 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/objc/NMBExceptionCapture.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface NMBExceptionCapture : NSObject 4 | 5 | - (id)initWithHandler:(void(^)(NSException *))handler finally:(void(^)())finally; 6 | - (void)tryBlock:(void(^)())unsafeBlock; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Nimble-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "Nimble.h" 4 | #import "DSL.h" 5 | #import "NMBExceptionCapture.h" 6 | 7 | FOUNDATION_EXPORT double NimbleVersionNumber; 8 | FOUNDATION_EXPORT const unsigned char NimbleVersionString[]; 9 | 10 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /Funky.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Runners/XCTest/QuickXCTestBase.m: -------------------------------------------------------------------------------- 1 | // 2 | // QuickXCTestBase.m 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | #import "QuickXCTestBase.h" 10 | 11 | @implementation QuickXCTestBase 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "QuickConfiguration.h" 4 | #import "QCKDSL.h" 5 | #import "Quick.h" 6 | #import "QuickSpec.h" 7 | 8 | FOUNDATION_EXPORT double QuickVersionNumber; 9 | FOUNDATION_EXPORT const unsigned char QuickVersionString[]; 10 | 11 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/index -------------------------------------------------------------------------------- /Pods/Quick/Quick/Runners/XCTest/QuickXCTestBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // QuickXCTestBase.h 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QuickXCTestBase : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Runners/XCTest/QuickXCTestFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // QuickXCTestFactory.m 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | #import "QuickXCTestFactory.h" 10 | 11 | @implementation QuickXCTestFactory 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Runners/XCTest/QuickXCTestFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // QuickXCTestFactory.h 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QuickXCTestFactory : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Runners/XCTest/NSInvocation+QCKXProperties.h: -------------------------------------------------------------------------------- 1 | // 2 | // QCKXProperties.h 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QCKXProperties : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Runners/XCTest/NSInvocation+QCKXProperties.m: -------------------------------------------------------------------------------- 1 | // 2 | // QCKXProperties.m 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | #import "NSInvocation+QCKXProperties.h" 10 | 11 | @implementation QCKXProperties 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Runners/XCTest/QuickRuntimeUtilities.m: -------------------------------------------------------------------------------- 1 | // 2 | // QuickRuntimeUtilities.m 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | #import "QuickRuntimeUtilities.h" 10 | 11 | @implementation QuickRuntimeUtilities 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Runners/XCTest/QuickRuntimeUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // QuickRuntimeUtilities.h 3 | // Quick 4 | // 5 | // Created by Jeff Hui on 10/29/15. 6 | // Copyright © 2015 Brian Ivan Gesiak. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QuickRuntimeUtilities : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Regex.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Regex" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Quick/Quick/Quick.h: -------------------------------------------------------------------------------- 1 | #import 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 | #import "QuickSpec.h" 10 | #import "QCKDSL.h" 11 | #import "QuickConfiguration.h" 12 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.10' 2 | use_frameworks! 3 | 4 | # pod 'Regex', '~> 0.1.x' 5 | pod 'Regex', :path => '~/projects/_swift/Regex' 6 | 7 | target :FunkyTests do 8 | pod 'Quick', :git => 'https://github.com/Quick/Quick.git', :branch => 'master' 9 | pod 'Nimble', :git => 'https://github.com/Quick/Nimble.git', :branch => 'master' 10 | end 11 | 12 | 13 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = true 5 | ignorecase = true 6 | precomposeunicode = true 7 | [remote "origin"] 8 | url = https://github.com/LlamaKit/LlamaKit 9 | fetch = +refs/*:refs/* 10 | mirror = true 11 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /_build-experiment/peru.yaml: -------------------------------------------------------------------------------- 1 | imports: 2 | LlamaKit: vendor/LlamaKit 3 | 4 | git module LlamaKit: 5 | url: https://github.com/LlamaKit/LlamaKit 6 | files: Result.swift # only copy these files. Can be a list of files. Accepts * and ** globs. 7 | export: LlamaKit/ # this sets the root of the submodule, i.e., these directories are erased from the path -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/objects/pack/pack-4441df4bcb74aaf709bcf995bdfa4385509944d5.idx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/objects/pack/pack-4441df4bcb74aaf709bcf995bdfa4385509944d5.idx -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/objects/pack/pack-4441df4bcb74aaf709bcf995bdfa4385509944d5.pack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brynbellomy/Funky/HEAD/_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/objects/pack/pack-4441df4bcb74aaf709bcf995bdfa4385509944d5.pack -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Quick.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | ENABLE_BITCODE = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Quick" "${PODS_ROOT}/Headers/Public" 6 | OTHER_LDFLAGS = -framework "XCTest" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_ROOT = ${SRCROOT} 9 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Utils/SourceLocation.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | 4 | public class SourceLocation : NSObject { 5 | public let file: String 6 | public let line: UInt 7 | 8 | override init() { 9 | file = "Unknown File" 10 | line = 0 11 | } 12 | 13 | init(file: String, line: UInt) { 14 | self.file = file 15 | self.line = line 16 | } 17 | 18 | override public var description: String { 19 | return "\(file):\(line)" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | test -x "$GIT_DIR/hooks/pre-commit" && 13 | exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Nimble.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | ENABLE_BITCODE = NO 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Nimble" "${PODS_ROOT}/Headers/Public" 6 | OTHER_LDFLAGS = -weak-lswiftXCTest -weak_framework "XCTest" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_ROOT = ${SRCROOT} 9 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | test -x "$GIT_DIR/hooks/commit-msg" && 14 | exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /Funky/Funky.h: -------------------------------------------------------------------------------- 1 | // 2 | // Funky.h 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 5. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Funky. 12 | FOUNDATION_EXPORT double FunkyVersionNumber; 13 | 14 | //! Project version string for Funky. 15 | FOUNDATION_EXPORT const unsigned char FunkyVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Regex.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Regex" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 9 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods.release.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Regex.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Regex" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods 9 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | test -x "$GIT_DIR/hooks/pre-commit" && 13 | exec "$GIT_DIR/hooks/pre-commit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/NSString+QCKSelectorName.h: -------------------------------------------------------------------------------- 1 | #import 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 18 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | test -x "$GIT_DIR/hooks/commit-msg" && 14 | exec "$GIT_DIR/hooks/commit-msg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /src/Operators.ErrorIO.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.ErrorIO.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 14. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | infix operator <~ { associativity left } 13 | 14 | public func <~ (lhs:ErrorIO, rhs:NSError) -> ErrorIO { 15 | lhs.append(rhs) 16 | return lhs 17 | } 18 | 19 | public func <~ (lhs:ErrorIO, rhs:String) -> ErrorIO { 20 | lhs.append(ErrorIO.defaultError(message:rhs)) 21 | return lhs 22 | } 23 | 24 | public func <~ (lhs:ErrorIO, rhs:ErrorIO) -> ErrorIO { 25 | lhs.extend(rhs) 26 | return lhs 27 | } 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/BeNil.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual value is nil. 4 | public func beNil() -> MatcherFunc { 5 | return MatcherFunc { actualExpression, failureMessage in 6 | failureMessage.postfixMessage = "be nil" 7 | let actualValue = try actualExpression.evaluate() 8 | return actualValue == nil 9 | } 10 | } 11 | 12 | extension NMBObjCMatcher { 13 | public class func beNilMatcher() -> NMBObjCMatcher { 14 | return NMBObjCMatcher { actualExpression, failureMessage in 15 | return try! beNil().matches(actualExpression, failureMessage: failureMessage) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/ExampleMetadata.swift: -------------------------------------------------------------------------------- 1 | /** 2 | A class that encapsulates information about an example, 3 | including the index at which the example was executed, as 4 | well as the example itself. 5 | */ 6 | final public class ExampleMetadata: NSObject { 7 | /** 8 | The example for which this metadata was collected. 9 | */ 10 | public let example: Example 11 | 12 | /** 13 | The index at which this example was executed in the 14 | test suite. 15 | */ 16 | public let exampleIndex: Int 17 | 18 | internal init(example: Example, exampleIndex: Int) { 19 | self.example = example 20 | self.exampleIndex = exampleIndex 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/World.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class ExampleGroup; 4 | @class ExampleMetadata; 5 | 6 | SWIFT_CLASS("_TtC5Quick5World") 7 | @interface World 8 | 9 | @property (nonatomic) ExampleGroup * __nullable currentExampleGroup; 10 | @property (nonatomic) ExampleMetadata * __nullable currentExampleMetadata; 11 | @property (nonatomic) BOOL isRunningAdditionalSuites; 12 | + (World * __nonnull)sharedWorld; 13 | - (void)configure:(void (^ __nonnull)(Configuration * __nonnull))closure; 14 | - (void)finalizeConfiguration; 15 | - (ExampleGroup * __nonnull)rootExampleGroupForSpecClass:(Class __nonnull)cls; 16 | - (NSArray * __nonnull)examplesForSpecClass:(Class __nonnull)specClass; 17 | @end 18 | -------------------------------------------------------------------------------- /Funky.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'Funky' 3 | s.version = '0.3.0' 4 | s.summary = 'Functional programming tools and experiments (in Swift). Lots of functions.' 5 | s.license = { :type => 'MIT', :file => 'LICENSE.md' } 6 | s.homepage = 'https://brynbellomy.github.io/Funky' 7 | s.documentation_url = 'https://brynbellomy.github.io/Funky' 8 | s.authors = { 'bryn austin bellomy' => 'bryn.bellomy@gmail.com' } 9 | 10 | s.ios.deployment_target = '8.0' 11 | s.osx.deployment_target = '10.10' 12 | s.source_files = 'src/*.swift' 13 | s.requires_arc = true 14 | 15 | s.dependency 'Regex', '0.3.0' 16 | 17 | s.source = { :git => 'https://github.com/brynbellomy/Funky.git', :tag => s.version } 18 | end 19 | -------------------------------------------------------------------------------- /Pods/Local Podspecs/Regex.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Regex", 3 | "version": "0.2.1", 4 | "license": { 5 | "type": "MIT", 6 | "file": "LICENSE.md" 7 | }, 8 | "homepage": "https://github.com/brynbellomy/Regex", 9 | "authors": { 10 | "bryn austin bellomy": "bryn.bellomy@gmail.com" 11 | }, 12 | "summary": "Regular expression class (in Swift). Wraps NSRegularExpression.", 13 | "documentation_url": "http://brynbellomy.github.io/Regex/index.html", 14 | "platforms": { 15 | "ios": "8.0", 16 | "osx": "10.10" 17 | }, 18 | "source_files": "src/*.swift", 19 | "requires_arc": true, 20 | "source": { 21 | "git": "https://github.com/brynbellomy/Regex.git", 22 | "tag": "0.2.1" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-FunkyTests/Pods-FunkyTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Nimble.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Quick.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Regex.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Nimble" -framework "Quick" -framework "Regex" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-FunkyTests 9 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-FunkyTests/Pods-FunkyTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Nimble.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Quick.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Regex.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "Nimble" -framework "Quick" -framework "Regex" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-FunkyTests 9 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Adapters/AssertionDispatcher.swift: -------------------------------------------------------------------------------- 1 | 2 | /// AssertionDispatcher allows multiple AssertionHandlers to receive 3 | /// assertion messages. 4 | /// 5 | /// @warning Does not fully dispatch if one of the handlers raises an exception. 6 | /// This is possible with XCTest-based assertion handlers. 7 | /// 8 | public class AssertionDispatcher: AssertionHandler { 9 | let handlers: [AssertionHandler] 10 | 11 | public init(handlers: [AssertionHandler]) { 12 | self.handlers = handlers 13 | } 14 | 15 | public func assert(assertion: Bool, message: FailureMessage, location: SourceLocation) { 16 | for handler in handlers { 17 | handler.assert(assertion, message: message, location: location) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Adapters/AdapterProtocols.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Protocol for the assertion handler that Nimble uses for all expectations. 4 | public protocol AssertionHandler { 5 | func assert(assertion: Bool, message: FailureMessage, location: SourceLocation) 6 | } 7 | 8 | /// Global backing interface for assertions that Nimble creates. 9 | /// Defaults to a private test handler that passes through to XCTest. 10 | /// 11 | /// If XCTest is not available, you must assign your own assertion handler 12 | /// before using any matchers, otherwise Nimble will abort the program. 13 | /// 14 | /// @see AssertionHandler 15 | public var NimbleAssertionHandler: AssertionHandler = { () -> AssertionHandler in 16 | return isXCTestAvailable() ? NimbleXCTestHandler() : NimbleXCTestUnavailableHandler() 17 | }() 18 | -------------------------------------------------------------------------------- /src/Operators.apply.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.apply.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | 11 | /** 12 | apply operator (applicative functors) ((A -> B)? <| A?) 13 | */ 14 | infix operator <*> { associativity left precedence 101 } 15 | 16 | 17 | public func <*> 18 | 19 | (f: (A -> B)?, maybeValue: A?) -> B? 20 | { 21 | switch f 22 | { 23 | case .Some(let fx): return fx <^> maybeValue 24 | case .None: return .None 25 | } 26 | } 27 | 28 | 29 | public func <*> 30 | 31 | (f: Result B, E>, values: Result) -> Result 32 | { 33 | return f.flatMap { fn in values.flatMap(fn >>> success) } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/Functions.Math.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.Math.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 13. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | /** 13 | Returns a random Float value between min and max (inclusive). 14 | 15 | - parameter min: 16 | - parameter max: 17 | - returns: Random number 18 | */ 19 | public func random(min: Float = 0, max: Float) -> Float 20 | { 21 | let diff = max - min 22 | let rand = Float(arc4random() % (UInt32(RAND_MAX) + 1)) 23 | return ((rand / Float(RAND_MAX)) * diff) + min 24 | } 25 | 26 | 27 | public func sum 28 | (nums: S) -> S.Generator.Element 29 | { 30 | return nums.reduce(0) { $0.0 + $0.1 } 31 | } 32 | -------------------------------------------------------------------------------- /FunkyTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/Operators.fmap.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.fmap.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | fmap operator (functors) (A -> B <^> A?) 12 | */ 13 | infix operator <^> { associativity left precedence 101 } 14 | 15 | public func <^> 16 | 17 | (f: A -> B, maybeValue: A?) -> B? 18 | { 19 | switch maybeValue 20 | { 21 | case .Some(let x): return f(x) 22 | case .None: return .None 23 | } 24 | } 25 | 26 | public func <^> 27 | 28 | (f: A -> B, values: [A]) -> [B] 29 | { 30 | return values.map(f) 31 | } 32 | 33 | 34 | public func <^> 35 | 36 | (f: A -> B, values: Result) -> Result 37 | { 38 | return values.map(f) 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Callsite.swift: -------------------------------------------------------------------------------- 1 | /** 2 | An object encapsulating the file and line number at which 3 | a particular example is defined. 4 | */ 5 | final public class Callsite: NSObject { 6 | /** 7 | The absolute path of the file in which an example is defined. 8 | */ 9 | public let file: String 10 | 11 | /** 12 | The line number on which an example is defined. 13 | */ 14 | public let line: UInt 15 | 16 | internal init(file: String, line: UInt) { 17 | self.file = file 18 | self.line = line 19 | } 20 | } 21 | 22 | /** 23 | Returns a boolean indicating whether two Callsite objects are equal. 24 | If two callsites are in the same file and on the same line, they must be equal. 25 | */ 26 | public func ==(lhs: Callsite, rhs: Callsite) -> Bool { 27 | return lhs.file == rhs.file && lhs.line == rhs.line 28 | } 29 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/objc/NMBExceptionCapture.m: -------------------------------------------------------------------------------- 1 | #import "NMBExceptionCapture.h" 2 | 3 | @interface NMBExceptionCapture () 4 | @property (nonatomic, copy) void(^handler)(NSException *exception); 5 | @property (nonatomic, copy) void(^finally)(); 6 | @end 7 | 8 | @implementation NMBExceptionCapture 9 | 10 | - (id)initWithHandler:(void(^)(NSException *))handler finally:(void(^)())finally { 11 | self = [super init]; 12 | if (self) { 13 | self.handler = handler; 14 | self.finally = finally; 15 | } 16 | return self; 17 | } 18 | 19 | - (void)tryBlock:(void(^)())unsafeBlock { 20 | @try { 21 | unsafeBlock(); 22 | } 23 | @catch (NSException *exception) { 24 | if (self.handler) { 25 | self.handler(exception); 26 | } 27 | } 28 | @finally { 29 | if (self.finally) { 30 | self.finally(); 31 | } 32 | } 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Nimble/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 3.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Quick/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.8.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Regex/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.2.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-FunkyTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Local Podspecs/Nimble.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Nimble", 3 | "version": "3.0.0", 4 | "summary": "A Matcher Framework for Swift and Objective-C", 5 | "description": "Use Nimble to express the expected outcomes of Swift or Objective-C expressions. Inspired by Cedar.", 6 | "homepage": "https://github.com/Quick/Nimble", 7 | "license": { 8 | "type": "Apache 2.0", 9 | "file": "LICENSE.md" 10 | }, 11 | "authors": "Quick Contributors", 12 | "platforms": { 13 | "ios": "7.0", 14 | "osx": "10.9", 15 | "tvos": "9.0" 16 | }, 17 | "source": { 18 | "git": "https://github.com/Quick/Nimble.git", 19 | "tag": "v3.0.0" 20 | }, 21 | "source_files": [ 22 | "Nimble", 23 | "Nimble/**/*.{swift,h,m}" 24 | ], 25 | "weak_frameworks": "XCTest", 26 | "requires_arc": true, 27 | "pod_target_xcconfig": { 28 | "ENABLE_BITCODE": "NO", 29 | "OTHER_LDFLAGS": "-weak-lswiftXCTest", 30 | "FRAMEWORK_SEARCH_PATHS": "$(inherited) \"$(PLATFORM_DIR)/Developer/Library/Frameworks\"" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Funky/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 bryn austin bellomy. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Nimble (3.0.0) 3 | - Quick (0.8.0) 4 | - Regex (0.2.1) 5 | 6 | DEPENDENCIES: 7 | - Nimble (from `https://github.com/Quick/Nimble.git`, branch `master`) 8 | - Quick (from `https://github.com/Quick/Quick.git`, branch `master`) 9 | - Regex (from `~/projects/_swift/Regex`) 10 | 11 | EXTERNAL SOURCES: 12 | Nimble: 13 | :branch: master 14 | :git: https://github.com/Quick/Nimble.git 15 | Quick: 16 | :branch: master 17 | :git: https://github.com/Quick/Quick.git 18 | Regex: 19 | :path: "~/projects/_swift/Regex" 20 | 21 | CHECKOUT OPTIONS: 22 | Nimble: 23 | :commit: 13d4a2bca41d41e53b1c9681bc2039e5f5bca5fe 24 | :git: https://github.com/Quick/Nimble.git 25 | Quick: 26 | :commit: a98f8e37867462c8f00fea1a7b255d12f5a4b611 27 | :git: https://github.com/Quick/Quick.git 28 | 29 | SPEC CHECKSUMS: 30 | Nimble: 4c353d43735b38b545cbb4cb91504588eb5de926 31 | Quick: 563d0f6ec5f72e394645adb377708639b7dd38ab 32 | Regex: 14d9745c19442ccdf920234e50d463ba659f58c4 33 | 34 | COCOAPODS: 0.39.0 35 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Nimble (3.0.0) 3 | - Quick (0.8.0) 4 | - Regex (0.2.1) 5 | 6 | DEPENDENCIES: 7 | - Nimble (from `https://github.com/Quick/Nimble.git`, branch `master`) 8 | - Quick (from `https://github.com/Quick/Quick.git`, branch `master`) 9 | - Regex (from `~/projects/_swift/Regex`) 10 | 11 | EXTERNAL SOURCES: 12 | Nimble: 13 | :branch: master 14 | :git: https://github.com/Quick/Nimble.git 15 | Quick: 16 | :branch: master 17 | :git: https://github.com/Quick/Quick.git 18 | Regex: 19 | :path: "~/projects/_swift/Regex" 20 | 21 | CHECKOUT OPTIONS: 22 | Nimble: 23 | :commit: 13d4a2bca41d41e53b1c9681bc2039e5f5bca5fe 24 | :git: https://github.com/Quick/Nimble.git 25 | Quick: 26 | :commit: a98f8e37867462c8f00fea1a7b255d12f5a4b611 27 | :git: https://github.com/Quick/Quick.git 28 | 29 | SPEC CHECKSUMS: 30 | Nimble: 4c353d43735b38b545cbb4cb91504588eb5de926 31 | Quick: 563d0f6ec5f72e394645adb377708639b7dd38ab 32 | Regex: 14d9745c19442ccdf920234e50d463ba659f58c4 33 | 34 | COCOAPODS: 0.39.0 35 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Hooks/SuiteHooks.swift: -------------------------------------------------------------------------------- 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 | } 35 | -------------------------------------------------------------------------------- /Pods/Local Podspecs/Quick.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Quick", 3 | "version": "0.8.0", 4 | "summary": "The Swift (and Objective-C) testing framework.", 5 | "description": "Quick is a behavior-driven development framework for Swift and Objective-C. Inspired by RSpec, Specta, and Ginkgo.", 6 | "homepage": "https://github.com/Quick/Quick", 7 | "license": { 8 | "type": "Apache 2.0", 9 | "file": "LICENSE" 10 | }, 11 | "authors": "Quick Contributors", 12 | "platforms": { 13 | "ios": "7.0", 14 | "osx": "10.9", 15 | "tvos": "9.0" 16 | }, 17 | "source": { 18 | "git": "https://github.com/Quick/Quick.git", 19 | "tag": "v0.8.0" 20 | }, 21 | "source_files": [ 22 | "Quick", 23 | "Quick/**/*.{swift,h,m}" 24 | ], 25 | "public_header_files": [ 26 | "Quick/Configuration/QuickConfiguration.h", 27 | "Quick/DSL/QCKDSL.h", 28 | "Quick/Quick.h", 29 | "Quick/QuickSpec.h" 30 | ], 31 | "frameworks": "XCTest", 32 | "requires_arc": true, 33 | "pod_target_xcconfig": { 34 | "ENABLE_BITCODE": "NO" 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Filter.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /** 4 | A mapping of string keys to booleans that can be used to 5 | filter examples or example groups. For example, a "focused" 6 | example would have the flags [Focused: true]. 7 | */ 8 | public typealias FilterFlags = [String: Bool] 9 | 10 | /** 11 | A namespace for filter flag keys, defined primarily to make the 12 | keys available in Objective-C. 13 | */ 14 | final public class Filter: NSObject { 15 | /** 16 | Example and example groups with [Focused: true] are included in test runs, 17 | excluding all other examples without this flag. Use this to only run one or 18 | two tests that you're currently focusing on. 19 | */ 20 | public class var focused: String { 21 | return "focused" 22 | } 23 | 24 | /** 25 | Example and example groups with [Pending: true] are excluded from test runs. 26 | Use this to temporarily suspend examples that you know do not pass yet. 27 | */ 28 | public class var pending: String { 29 | return "pending" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Operators.pipe.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.pipe.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | 11 | infix operator |> { associativity left } 12 | infix operator <| { associativity left precedence 101 } 13 | 14 | 15 | 16 | /** The pipe-forward operator. */ 17 | public func |> 18 | 19 | (t: T, f: T -> U) 20 | -> U 21 | { 22 | return f(t) 23 | } 24 | 25 | 26 | 27 | /** The pipe-backward operator. */ 28 | public func <| 29 | 30 | (f: T -> U, t: T) 31 | -> U 32 | { 33 | return f(t) 34 | } 35 | 36 | 37 | 38 | 39 | // @@TODO: figure out a different operator for this 40 | public func <| 41 | 42 | (f: (T -> U)?, t: T) 43 | -> U? 44 | { 45 | return f.map { fn in fn(t) } 46 | } 47 | 48 | 49 | // @@TODO: figure out a different operator for this 50 | public func <| 51 | 52 | (f: Result U, E>, t: T) 53 | -> Result 54 | { 55 | return f.map { fn in fn(t) } 56 | } 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/Match.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual string satisfies the regular expression 4 | /// described by the expected string. 5 | public func match(expectedValue: String?) -> NonNilMatcherFunc { 6 | return NonNilMatcherFunc { actualExpression, failureMessage in 7 | failureMessage.postfixMessage = "match <\(stringify(expectedValue))>" 8 | 9 | if let actual = try actualExpression.evaluate() { 10 | if let regexp = expectedValue { 11 | return actual.rangeOfString(regexp, options: .RegularExpressionSearch) != nil 12 | } 13 | } 14 | 15 | return false 16 | } 17 | } 18 | 19 | extension NMBObjCMatcher { 20 | public class func matchMatcher(expected: NSString) -> NMBMatcher { 21 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 22 | let actual = actualExpression.cast { $0 as? String } 23 | return try! match(expected.description).matches(actual, failureMessage: failureMessage) 24 | } 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 bryn austin bellomy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /_build-experiment/vendor/LlamaKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | CFBundleDevelopmentRegion 7 | en 8 | CFBundleExecutable 9 | $(EXECUTABLE_NAME) 10 | CFBundleIdentifier 11 | org.illumntr.$(PRODUCT_NAME:rfc1034identifier) 12 | CFBundleInfoDictionaryVersion 13 | 6.0 14 | CFBundleName 15 | $(PRODUCT_NAME) 16 | CFBundlePackageType 17 | FMWK 18 | CFBundleShortVersionString 19 | 1.0 20 | CFBundleSignature 21 | ???? 22 | CFBundleVersion 23 | $(CURRENT_PROJECT_VERSION) 24 | NSHumanReadableCopyright 25 | Copyright © 2015 bryn austin bellomy. All rights reserved. 26 | NSPrincipalClass 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PRODUCT_NAME=Funky 2 | XCTOOL=/usr/local/bin/xctool -scheme $(PRODUCT_NAME) -workspace $(PRODUCT_NAME).xcworkspace -reporter pretty 3 | 4 | DOCS_OUTPUT_DIR=~/projects/_swift/_docs/$(PRODUCT_NAME) 5 | GITHUB_URL=https://github.com/brynbellomy/$(PRODUCT_NAME) 6 | PODSPEC_PATH=./$(PRODUCT_NAME).podspec 7 | SRC_ROOT=. 8 | 9 | all: build 10 | 11 | docs: .FORCE-DOCS 12 | 13 | .FORCE-DOCS: 14 | mkdir -p $(DOCS_OUTPUT_DIR) 15 | 16 | jazzy -o $(DOCS_OUTPUT_DIR) \ 17 | -a 'bryn austin bellomy' \ 18 | -u 'https://github.com/brynbellomy' \ 19 | -m $(PRODUCT_NAME) \ 20 | -g $(GITHUB_URL) \ 21 | --source-directory $(SRC_ROOT) 22 | 23 | 24 | # --podspec $(PODSPEC_PATH) \ 25 | 26 | build: build/Products/Debug/$(PRODUCT_NAME).framework 27 | 28 | test: 29 | $(XCTOOL) test 30 | 31 | clean: 32 | rm -rf ./build 33 | pod clean 34 | 35 | build/Products/Debug/$(PRODUCT_NAME).framework: 36 | $(XCTOOL) build 37 | 38 | # $(XCTOOL) build -reporter json-compilation-database > ./compile_commands.json 39 | 40 | # build/Products/Debug/$(PRODUCT_NAME).framework: 41 | # $(XCTOOL) build \ 42 | # | NODE_PATH=/usr/local/lib/node_modules \ 43 | # /usr/local/bin/node ./format-build-json.js -------------------------------------------------------------------------------- /Pods/Quick/Quick/Hooks/Closures.swift: -------------------------------------------------------------------------------- 1 | // MARK: Example Hooks 2 | 3 | /** 4 | A closure executed before an example is run. 5 | */ 6 | public typealias BeforeExampleClosure = () -> () 7 | 8 | /** 9 | A closure executed before an example is run. The closure is given example metadata, 10 | which contains information about the example that is about to be run. 11 | */ 12 | public typealias BeforeExampleWithMetadataClosure = (exampleMetadata: ExampleMetadata) -> () 13 | 14 | /** 15 | A closure executed after an example is run. 16 | */ 17 | public typealias AfterExampleClosure = BeforeExampleClosure 18 | 19 | /** 20 | A closure executed after an example is run. The closure is given example metadata, 21 | which contains information about the example that has just finished running. 22 | */ 23 | public typealias AfterExampleWithMetadataClosure = BeforeExampleWithMetadataClosure 24 | 25 | // MARK: Suite Hooks 26 | 27 | /** 28 | A closure executed before any examples are run. 29 | */ 30 | public typealias BeforeSuiteClosure = () -> () 31 | 32 | /** 33 | A closure executed after all examples have finished running. 34 | */ 35 | public typealias AfterSuiteClosure = BeforeSuiteClosure 36 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/BeIdenticalTo.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | 4 | /// A Nimble matcher that succeeds when the actual value is the same instance 5 | /// as the expected instance. 6 | public func beIdenticalTo(expected: T?) -> NonNilMatcherFunc { 7 | return NonNilMatcherFunc { actualExpression, failureMessage in 8 | let actual = try actualExpression.evaluate() 9 | failureMessage.actualValue = "\(identityAsString(actual))" 10 | failureMessage.postfixMessage = "be identical to \(identityAsString(expected))" 11 | return actual === expected && actual !== nil 12 | } 13 | } 14 | 15 | public func ===(lhs: Expectation, rhs: T?) { 16 | lhs.to(beIdenticalTo(rhs)) 17 | } 18 | public func !==(lhs: Expectation, rhs: T?) { 19 | lhs.toNot(beIdenticalTo(rhs)) 20 | } 21 | 22 | extension NMBObjCMatcher { 23 | public class func beIdenticalToMatcher(expected: NSObject?) -> NMBObjCMatcher { 24 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 25 | return try! beIdenticalTo(expected).matches(actualExpression, failureMessage: failureMessage) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Configuration/QuickConfiguration.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @class Configuration; 4 | 5 | /** 6 | Subclass QuickConfiguration and override the +[QuickConfiguration configure:] 7 | method in order to configure how Quick behaves when running specs, or to define 8 | shared examples that are used across spec files. 9 | */ 10 | @interface QuickConfiguration : NSObject 11 | 12 | /** 13 | This method is executed on each subclass of this class before Quick runs 14 | any examples. You may override this method on as many subclasses as you like, but 15 | there is no guarantee as to the order in which these methods are executed. 16 | 17 | You can override this method in order to: 18 | 19 | 1. Configure how Quick behaves, by modifying properties on the Configuration object. 20 | Setting the same properties in several methods has undefined behavior. 21 | 22 | 2. Define shared examples using `sharedExamples`. 23 | 24 | @param configuration A mutable object that is used to configure how Quick behaves on 25 | a framework level. For details on all the options, see the 26 | documentation in Configuration.swift. 27 | */ 28 | + (void)configure:(Configuration *)configuration; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Funky 3 | 4 | The documentation (courtesy of [realm/jazzy](https://github.com/realm/jazzy)) is available here: 5 | 6 | Master branch is currently compatible with: **Swift 2.2**. 7 | 8 | Funky is a bunch of functional programming stuff for Swift. I intend to de-jankify this README + repo in the near future, so bear with me. 9 | 10 | This is my way of learning about FP and really shouldn't be considered safe for production. I haven't finished writing tests for all of the included functions, and I would gladly welcome pull requests. 11 | 12 | README coming soon. (Honestly it's just a **shitload** of basic functions for basic types, collections (including strings), for `LlamaKit`'s `Result` type, etc. Use whatever seems useful.) 13 | 14 | # install 15 | 16 | Make sure you have the latest pre-release version of [CocoaPods](http://cocoapods.org) (`gem install cocoapods --pre`), which has Swift support. At the time of this writing, that would be `0.36.0.beta.1`. 17 | 18 | Add to your `Podfile`: 19 | 20 | ```ruby 21 | pod 'Funky' 22 | ``` 23 | 24 | And then from the shell: 25 | 26 | ```sh 27 | $ pod install 28 | ``` 29 | 30 | 31 | # contributors / authors 32 | 33 | 34 | bryn austin bellomy < > 35 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Hooks/ExampleHooks.swift: -------------------------------------------------------------------------------- 1 | /** 2 | A container for closures to be executed before and after each example. 3 | */ 4 | final internal class ExampleHooks { 5 | 6 | internal var befores: [BeforeExampleWithMetadataClosure] = [] 7 | internal var afters: [AfterExampleWithMetadataClosure] = [] 8 | 9 | internal func appendBefore(closure: BeforeExampleWithMetadataClosure) { 10 | befores.append(closure) 11 | } 12 | 13 | internal func appendBefore(closure: BeforeExampleClosure) { 14 | befores.append { (exampleMetadata: ExampleMetadata) in closure() } 15 | } 16 | 17 | internal func appendAfter(closure: AfterExampleWithMetadataClosure) { 18 | afters.append(closure) 19 | } 20 | 21 | internal func appendAfter(closure: AfterExampleClosure) { 22 | afters.append { (exampleMetadata: ExampleMetadata) in closure() } 23 | } 24 | 25 | internal func executeBefores(exampleMetadata: ExampleMetadata) { 26 | for before in befores { 27 | before(exampleMetadata: exampleMetadata) 28 | } 29 | } 30 | 31 | internal func executeAfters(exampleMetadata: ExampleMetadata) { 32 | for after in afters { 33 | after(exampleMetadata: exampleMetadata) 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Regex 5 | 6 | Copyright (c) 2015 bryn austin bellomy 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 13 | 14 | Generated by CocoaPods - http://cocoapods.org 15 | -------------------------------------------------------------------------------- /src/Functions.Lazy.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// Functions.Lazy.swift 3 | //// Funky 4 | //// 5 | //// Created by bryn austin bellomy on 2015 Jun 3. 6 | //// Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | //// 8 | // 9 | //public struct Lazy 10 | //{ 11 | // public static func partition 12 | // (seq: S, predicate: S.Generator.Element -> Bool) 13 | // -> (LazySequence>, LazySequence>) 14 | // { 15 | // let pass = seq.lazy.filter { predicate($0) == true } .map { $0 } 16 | // let fail = seq.lazy.filter { predicate($0) == false } 17 | // return (AnySequence(pass).lazy, AnySequence(fail).lazy) 18 | // } 19 | // 20 | // 21 | // /** 22 | // Decomposes a `Dictionary` into a lazy sequence of key-value tuples. 23 | // */ 24 | // public static func pairs 25 | // (dict:[K: V]) -> LazySequence> 26 | // { 27 | // var gen = dict.lazy.generate() 28 | // return AnySequence(gen).lazy 29 | // } 30 | // 31 | // 32 | // public static func selectWhere 33 | // (predicate: S.Generator.Element -> Bool) (seq: S) -> LazySequence> 34 | // { 35 | // return lazy(AnySequence(lazy(seq).filter(predicate))) 36 | // } 37 | // 38 | // 39 | //} 40 | // 41 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/hooks/prepare-commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare the commit log message. 4 | # Called by "git commit" with the name of the file that has the 5 | # commit message, followed by the description of the commit 6 | # message's source. The hook's purpose is to edit the commit 7 | # message file. If the hook fails with a non-zero status, 8 | # the commit is aborted. 9 | # 10 | # To enable this hook, rename this file to "prepare-commit-msg". 11 | 12 | # This hook includes three examples. The first comments out the 13 | # "Conflicts:" part of a merge commit. 14 | # 15 | # The second includes the output of "git diff --name-status -r" 16 | # into the message, just before the "git status" output. It is 17 | # commented because it doesn't cope with --amend or with squashed 18 | # commits. 19 | # 20 | # The third example adds a Signed-off-by line to the message, that can 21 | # still be edited. This is rarely a good idea. 22 | 23 | case "$2,$3" in 24 | merge,) 25 | /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; 26 | 27 | # ,|template,) 28 | # /usr/bin/perl -i.bak -pe ' 29 | # print "\n" . `git diff --cached --name-status -r` 30 | # if /^#/ && $first++ == 0' "$1" ;; 31 | 32 | *) ;; 33 | esac 34 | 35 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 36 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 37 | -------------------------------------------------------------------------------- /src/NSError+Coalescing.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// NSError+Coalescing.swift 3 | //// Funky 4 | //// 5 | //// Created by bryn austin bellomy on 2014 Dec 9. 6 | //// Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | //// 8 | // 9 | // 10 | //public extension NSError 11 | //{ 12 | // public class func multiError(errors:[NSError]) -> NSError 13 | // { 14 | // var errorIO = ErrorIO() 15 | // errorIO.extend(errors) 16 | // return NSError(domain:"com.illumntr.multi-error", code:1, userInfo: [Keys.IsMultiError: true, Keys.ErrorIO: errorIO]) 17 | // } 18 | // 19 | // public var errorIO: ErrorIO? { return userInfo?[Keys.ErrorIO] as? ErrorIO } 20 | // 21 | // public class func coalesce(errors:[NSError]) -> NSError 22 | // { 23 | // return errors |> reducer([NSError]()) { (var into, error) in 24 | // if let io = error.errorIO { 25 | // into.extend(io) 26 | // } 27 | // else { 28 | // into.append(error) 29 | // } 30 | // return into 31 | // } 32 | // 33 | // |> { NSError.multiError($0) } 34 | // } 35 | // 36 | // 37 | // private struct Keys { 38 | // static let IsMultiError = "is multi error" 39 | // static let ErrorIO = "ErrorIO" 40 | // } 41 | //} 42 | // 43 | // 44 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/DSL.swift: -------------------------------------------------------------------------------- 1 | /// Make an expectation on a given actual value. The value given is lazily evaluated. 2 | public func expect(@autoclosure(escaping) expression: () throws -> T?, file: String = __FILE__, line: UInt = __LINE__) -> Expectation { 3 | return Expectation( 4 | expression: Expression( 5 | expression: expression, 6 | location: SourceLocation(file: file, line: line), 7 | isClosure: true)) 8 | } 9 | 10 | /// Make an expectation on a given actual value. The closure is lazily invoked. 11 | public func expect(file: String = __FILE__, line: UInt = __LINE__, expression: () throws -> T?) -> Expectation { 12 | return Expectation( 13 | expression: Expression( 14 | expression: expression, 15 | location: SourceLocation(file: file, line: line), 16 | isClosure: true)) 17 | } 18 | 19 | /// Always fails the test with a message and a specified location. 20 | public func fail(message: String, location: SourceLocation) { 21 | NimbleAssertionHandler.assert(false, message: FailureMessage(stringValue: message), location: location) 22 | } 23 | 24 | /// Always fails the test with a message. 25 | public func fail(message: String, file: String = __FILE__, line: UInt = __LINE__) { 26 | fail(message, location: SourceLocation(file: file, line: line)) 27 | } 28 | 29 | /// Always fails the test. 30 | public func fail(file: String = __FILE__, line: UInt = __LINE__) { 31 | fail("fail() always fails", file: file, line: line) 32 | } 33 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/hooks/prepare-commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare the commit log message. 4 | # Called by "git commit" with the name of the file that has the 5 | # commit message, followed by the description of the commit 6 | # message's source. The hook's purpose is to edit the commit 7 | # message file. If the hook fails with a non-zero status, 8 | # the commit is aborted. 9 | # 10 | # To enable this hook, rename this file to "prepare-commit-msg". 11 | 12 | # This hook includes three examples. The first comments out the 13 | # "Conflicts:" part of a merge commit. 14 | # 15 | # The second includes the output of "git diff --name-status -r" 16 | # into the message, just before the "git status" output. It is 17 | # commented because it doesn't cope with --amend or with squashed 18 | # commits. 19 | # 20 | # The third example adds a Signed-off-by line to the message, that can 21 | # still be edited. This is rarely a good idea. 22 | 23 | case "$2,$3" in 24 | merge,) 25 | /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; 26 | 27 | # ,|template,) 28 | # /usr/bin/perl -i.bak -pe ' 29 | # print "\n" . `git diff --cached --name-status -r` 30 | # if /^#/ && $first++ == 0' "$1" ;; 31 | 32 | *) ;; 33 | esac 34 | 35 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 36 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 37 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/hooks/pre-push.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # An example hook script to verify what is about to be pushed. Called by "git 4 | # push" after it has checked the remote status, but before anything has been 5 | # pushed. If this script exits with a non-zero status nothing will be pushed. 6 | # 7 | # This hook is called with the following parameters: 8 | # 9 | # $1 -- Name of the remote to which the push is being done 10 | # $2 -- URL to which the push is being done 11 | # 12 | # If pushing without using a named remote those arguments will be equal. 13 | # 14 | # Information about the commits which are being pushed is supplied as lines to 15 | # the standard input in the form: 16 | # 17 | # 18 | # 19 | # This sample shows how to prevent push of commits where the log message starts 20 | # with "WIP" (work in progress). 21 | 22 | remote="$1" 23 | url="$2" 24 | 25 | z40=0000000000000000000000000000000000000000 26 | 27 | IFS=' ' 28 | while read local_ref local_sha remote_ref remote_sha 29 | do 30 | if [ "$local_sha" = $z40 ] 31 | then 32 | # Handle delete 33 | : 34 | else 35 | if [ "$remote_sha" = $z40 ] 36 | then 37 | # New branch, examine all commits 38 | range="$local_sha" 39 | else 40 | # Update to existing branch, examine new commits 41 | range="$remote_sha..$local_sha" 42 | fi 43 | 44 | # Check for WIP commit 45 | commit=`git rev-list -n 1 --grep '^WIP' "$range"` 46 | if [ -n "$commit" ] 47 | then 48 | echo >&2 "Found WIP commit in $local_ref, not pushing" 49 | exit 1 50 | fi 51 | fi 52 | done 53 | 54 | exit 0 55 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/BeLessThan.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual value is less than the expected value. 4 | public func beLessThan(expectedValue: T?) -> NonNilMatcherFunc { 5 | return NonNilMatcherFunc { actualExpression, failureMessage in 6 | failureMessage.postfixMessage = "be less than <\(stringify(expectedValue))>" 7 | return try actualExpression.evaluate() < expectedValue 8 | } 9 | } 10 | 11 | /// A Nimble matcher that succeeds when the actual value is less than the expected value. 12 | public func beLessThan(expectedValue: NMBComparable?) -> NonNilMatcherFunc { 13 | return NonNilMatcherFunc { actualExpression, failureMessage in 14 | failureMessage.postfixMessage = "be less than <\(stringify(expectedValue))>" 15 | let actualValue = try actualExpression.evaluate() 16 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == NSComparisonResult.OrderedAscending 17 | return matches 18 | } 19 | } 20 | 21 | public func <(lhs: Expectation, rhs: T) { 22 | lhs.to(beLessThan(rhs)) 23 | } 24 | 25 | public func <(lhs: Expectation, rhs: NMBComparable?) { 26 | lhs.to(beLessThan(rhs)) 27 | } 28 | 29 | extension NMBObjCMatcher { 30 | public class func beLessThanMatcher(expected: NMBComparable?) -> NMBObjCMatcher { 31 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 32 | let expr = actualExpression.cast { $0 as! NMBComparable? } 33 | return try! beLessThan(expected).matches(expr, failureMessage: failureMessage) 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/BeAKindOf.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // A Nimble matcher that catches attempts to use beAKindOf with non Objective-C types 4 | public func beAKindOf(expectedClass: Any) -> NonNilMatcherFunc { 5 | return NonNilMatcherFunc {actualExpression, failureMessage in 6 | failureMessage.stringValue = "beAKindOf only works on Objective-C types since" 7 | + " the Swift compiler will automatically type check Swift-only types." 8 | + " This expectation is redundant." 9 | return false 10 | } 11 | } 12 | 13 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class. 14 | /// @see beAnInstanceOf if you want to match against the exact class 15 | public func beAKindOf(expectedClass: AnyClass) -> NonNilMatcherFunc { 16 | return NonNilMatcherFunc { actualExpression, failureMessage in 17 | let instance = try actualExpression.evaluate() 18 | if let validInstance = instance { 19 | failureMessage.actualValue = "<\(NSStringFromClass(validInstance.dynamicType)) instance>" 20 | } else { 21 | failureMessage.actualValue = "" 22 | } 23 | failureMessage.postfixMessage = "be a kind of \(NSStringFromClass(expectedClass))" 24 | return instance != nil && instance!.isKindOfClass(expectedClass) 25 | } 26 | } 27 | 28 | extension NMBObjCMatcher { 29 | public class func beAKindOfMatcher(expected: AnyClass) -> NMBMatcher { 30 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 31 | return try! beAKindOf(expected).matches(actualExpression, failureMessage: failureMessage) 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/hooks/pre-push.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # An example hook script to verify what is about to be pushed. Called by "git 4 | # push" after it has checked the remote status, but before anything has been 5 | # pushed. If this script exits with a non-zero status nothing will be pushed. 6 | # 7 | # This hook is called with the following parameters: 8 | # 9 | # $1 -- Name of the remote to which the push is being done 10 | # $2 -- URL to which the push is being done 11 | # 12 | # If pushing without using a named remote those arguments will be equal. 13 | # 14 | # Information about the commits which are being pushed is supplied as lines to 15 | # the standard input in the form: 16 | # 17 | # 18 | # 19 | # This sample shows how to prevent push of commits where the log message starts 20 | # with "WIP" (work in progress). 21 | 22 | remote="$1" 23 | url="$2" 24 | 25 | z40=0000000000000000000000000000000000000000 26 | 27 | IFS=' ' 28 | while read local_ref local_sha remote_ref remote_sha 29 | do 30 | if [ "$local_sha" = $z40 ] 31 | then 32 | # Handle delete 33 | : 34 | else 35 | if [ "$remote_sha" = $z40 ] 36 | then 37 | # New branch, examine all commits 38 | range="$local_sha" 39 | else 40 | # Update to existing branch, examine new commits 41 | range="$remote_sha..$local_sha" 42 | fi 43 | 44 | # Check for WIP commit 45 | commit=`git rev-list -n 1 --grep '^WIP' "$range"` 46 | if [ -n "$commit" ] 47 | then 48 | echo >&2 "Found WIP commit in $local_ref, not pushing" 49 | exit 1 50 | fi 51 | fi 52 | done 53 | 54 | exit 0 55 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Adapters/NimbleXCTestHandler.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import XCTest 3 | 4 | /// Default handler for Nimble. This assertion handler passes failures along to 5 | /// XCTest. 6 | public class NimbleXCTestHandler : AssertionHandler { 7 | public func assert(assertion: Bool, message: FailureMessage, location: SourceLocation) { 8 | if !assertion { 9 | XCTFail("\(message.stringValue)\n", file: location.file, line: location.line) 10 | } 11 | } 12 | } 13 | 14 | /// Alternative handler for Nimble. This assertion handler passes failures along 15 | /// to XCTest by attempting to reduce the failure message size. 16 | public class NimbleShortXCTestHandler: AssertionHandler { 17 | public func assert(assertion: Bool, message: FailureMessage, location: SourceLocation) { 18 | if !assertion { 19 | let msg: String 20 | if let actual = message.actualValue { 21 | msg = "got: \(actual) \(message.postfixActual)" 22 | } else { 23 | msg = "expected \(message.to) \(message.postfixMessage)" 24 | } 25 | XCTFail("\(msg)\n", file: location.file, line: location.line) 26 | } 27 | } 28 | } 29 | 30 | /// Fallback handler in case XCTest is unavailable. This assertion handler will abort 31 | /// the program if it is invoked. 32 | class NimbleXCTestUnavailableHandler : AssertionHandler { 33 | func assert(assertion: Bool, message: FailureMessage, location: SourceLocation) { 34 | fatalError("XCTest is not available and no custom assertion handler was configured. Aborting.") 35 | } 36 | } 37 | 38 | func isXCTestAvailable() -> Bool { 39 | return NSClassFromString("XCTestCase") != nil 40 | } 41 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/BeAnInstanceOf.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | // A Nimble matcher that catches attempts to use beAnInstanceOf with non Objective-C types 4 | public func beAnInstanceOf(expectedClass: Any) -> NonNilMatcherFunc { 5 | return NonNilMatcherFunc {actualExpression, failureMessage in 6 | failureMessage.stringValue = "beAnInstanceOf only works on Objective-C types since" 7 | + " the Swift compiler will automatically type check Swift-only types." 8 | + " This expectation is redundant." 9 | return false 10 | } 11 | } 12 | 13 | /// A Nimble matcher that succeeds when the actual value is an instance of the given class. 14 | /// @see beAKindOf if you want to match against subclasses 15 | public func beAnInstanceOf(expectedClass: AnyClass) -> NonNilMatcherFunc { 16 | return NonNilMatcherFunc { actualExpression, failureMessage in 17 | let instance = try actualExpression.evaluate() 18 | if let validInstance = instance { 19 | failureMessage.actualValue = "<\(NSStringFromClass(validInstance.dynamicType)) instance>" 20 | } else { 21 | failureMessage.actualValue = "" 22 | } 23 | failureMessage.postfixMessage = "be an instance of \(NSStringFromClass(expectedClass))" 24 | return instance != nil && instance!.isMemberOfClass(expectedClass) 25 | } 26 | } 27 | 28 | extension NMBObjCMatcher { 29 | public class func beAnInstanceOfMatcher(expected: AnyClass) -> NMBMatcher { 30 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 31 | return try! beAnInstanceOf(expected).matches(actualExpression, failureMessage: failureMessage) 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/BeGreaterThan.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | 4 | /// A Nimble matcher that succeeds when the actual value is greater than the expected value. 5 | public func beGreaterThan(expectedValue: T?) -> NonNilMatcherFunc { 6 | return NonNilMatcherFunc { actualExpression, failureMessage in 7 | failureMessage.postfixMessage = "be greater than <\(stringify(expectedValue))>" 8 | return try actualExpression.evaluate() > expectedValue 9 | } 10 | } 11 | 12 | /// A Nimble matcher that succeeds when the actual value is greater than the expected value. 13 | public func beGreaterThan(expectedValue: NMBComparable?) -> NonNilMatcherFunc { 14 | return NonNilMatcherFunc { actualExpression, failureMessage in 15 | failureMessage.postfixMessage = "be greater than <\(stringify(expectedValue))>" 16 | let actualValue = try actualExpression.evaluate() 17 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == NSComparisonResult.OrderedDescending 18 | return matches 19 | } 20 | } 21 | 22 | public func >(lhs: Expectation, rhs: T) { 23 | lhs.to(beGreaterThan(rhs)) 24 | } 25 | 26 | public func >(lhs: Expectation, rhs: NMBComparable?) { 27 | lhs.to(beGreaterThan(rhs)) 28 | } 29 | 30 | extension NMBObjCMatcher { 31 | public class func beGreaterThanMatcher(expected: NMBComparable?) -> NMBObjCMatcher { 32 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 33 | let expr = actualExpression.cast { $0 as? NMBComparable } 34 | return try! beGreaterThan(expected).matches(expr, failureMessage: failureMessage) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/NSString+QCKSelectorName.m: -------------------------------------------------------------------------------- 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 34 | -------------------------------------------------------------------------------- /src/Functions.Result.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.Result.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 April 18. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | 11 | /** 12 | This function simply calls `result.isSuccess()` but is more convenient in functional pipelines. 13 | */ 14 | public func isSuccess (result:Result) -> Bool { 15 | return result.isSuccess 16 | } 17 | 18 | 19 | /** 20 | This function simply calls `!result.isSuccess()` but is more convenient in functional pipelines. 21 | */ 22 | public func isFailure (result:Result) -> Bool { 23 | return !isSuccess(result) 24 | } 25 | 26 | 27 | /** 28 | This function simply calls `result.value()` but is more convenient in functional pipelines. 29 | */ 30 | public func unwrapValue (result: Result) -> T? { 31 | return result.value 32 | } 33 | 34 | 35 | /** 36 | This function simply calls `result.error()` but is more convenient in functional pipelines. 37 | */ 38 | public func unwrapError (result: Result) -> E? { 39 | return result.error 40 | } 41 | 42 | 43 | public func selectFailures 44 | 45 | (array: [Result]) -> [E] 46 | { 47 | return array |> mapFilter { $0.error } 48 | } 49 | 50 | 51 | public func rejectFailures 52 | (source: [Result]) -> [T] 53 | { 54 | return source |> rejectIf({ !$0.isSuccess }) 55 | |> mapFilter(unwrapValue) 56 | } 57 | 58 | 59 | public func rejectFailuresAndDispose 60 | (disposal:E -> Void) (source: [Result]) -> [T] 61 | { 62 | return source |> rejectIfAndDispose({ !isSuccess($0) })({ disposal($0.error!) }) 63 | |> mapFilter(unwrapValue) 64 | } 65 | 66 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/BeLessThanOrEqual.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual value is less than 4 | /// or equal to the expected value. 5 | public func beLessThanOrEqualTo(expectedValue: T?) -> NonNilMatcherFunc { 6 | return NonNilMatcherFunc { actualExpression, failureMessage in 7 | failureMessage.postfixMessage = "be less than or equal to <\(stringify(expectedValue))>" 8 | return try actualExpression.evaluate() <= expectedValue 9 | } 10 | } 11 | 12 | /// A Nimble matcher that succeeds when the actual value is less than 13 | /// or equal to the expected value. 14 | public func beLessThanOrEqualTo(expectedValue: T?) -> NonNilMatcherFunc { 15 | return NonNilMatcherFunc { actualExpression, failureMessage in 16 | failureMessage.postfixMessage = "be less than or equal to <\(stringify(expectedValue))>" 17 | let actualValue = try actualExpression.evaluate() 18 | return actualValue != nil && actualValue!.NMB_compare(expectedValue) != NSComparisonResult.OrderedDescending 19 | } 20 | } 21 | 22 | public func <=(lhs: Expectation, rhs: T) { 23 | lhs.to(beLessThanOrEqualTo(rhs)) 24 | } 25 | 26 | public func <=(lhs: Expectation, rhs: T) { 27 | lhs.to(beLessThanOrEqualTo(rhs)) 28 | } 29 | 30 | extension NMBObjCMatcher { 31 | public class func beLessThanOrEqualToMatcher(expected: NMBComparable?) -> NMBObjCMatcher { 32 | return NMBObjCMatcher(canMatchNil:false) { actualExpression, failureMessage in 33 | let expr = actualExpression.cast { $0 as? NMBComparable } 34 | return try! beLessThanOrEqualTo(expected).matches(expr, failureMessage: failureMessage) 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Operators.bind.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.bind.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | 11 | /** 12 | bind operators (A? |> A -> B?) 13 | */ 14 | infix operator >>- { associativity left precedence 150 } 15 | infix operator -<< { associativity left precedence 150 } 16 | 17 | 18 | public func >>- 19 | (maybeValue: A?, f: A -> B?) -> B? 20 | { 21 | return maybeValue.flatMap(f) 22 | } 23 | 24 | 25 | public func >>- 26 | (wrapped: [A], f: A -> [B]) -> [B] 27 | { 28 | return wrapped.map(f).reduce([], combine: +) 29 | } 30 | 31 | 32 | public func >>- 33 | 34 | (maybeValue: Result, f: A -> Result) -> Result 35 | { 36 | switch maybeValue { 37 | case .Success(let box): return f(box.unbox) 38 | case .Failure(let err): return Result.Failure(err) 39 | } 40 | } 41 | 42 | 43 | public func >>- 44 | (maybeValue: Result<(), E>, f: () -> Result<(), E>) -> Result<(), E> 45 | { 46 | switch maybeValue { 47 | case .Success: return f() 48 | case .Failure(let box): return Result.Failure(box) 49 | } 50 | } 51 | 52 | 53 | public func >>- 54 | (maybeValue: Result, f: () -> Result) -> Result 55 | { 56 | switch maybeValue { 57 | case .Success: return f() 58 | case .Failure(let err): return Result.Failure(err) 59 | } 60 | } 61 | 62 | 63 | public func -<< (f:A -> Result, maybeValue:Result) -> Result 64 | { 65 | 66 | switch maybeValue { 67 | case .Success(let box): return f(box.unbox) 68 | case .Failure(let err): return Result.Failure(err) 69 | } 70 | } 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Gemfile 2 | Gemfile.lock 3 | 4 | 5 | # Created by https://www.gitignore.io 6 | 7 | ### SublimeText ### 8 | # cache files for sublime text 9 | *.tmlanguage.cache 10 | *.tmPreferences.cache 11 | *.stTheme.cache 12 | 13 | # workspace files are user-specific 14 | *.sublime-workspace 15 | 16 | # project files should be checked into the repository, unless a significant 17 | # proportion of contributors will probably not be using SublimeText 18 | # *.sublime-project 19 | 20 | # sftp configuration file 21 | sftp-config.json 22 | 23 | 24 | ### Swift ### 25 | # Xcode 26 | # 27 | build/ 28 | *.pbxuser 29 | !default.pbxuser 30 | *.mode1v3 31 | !default.mode1v3 32 | *.mode2v3 33 | !default.mode2v3 34 | *.perspectivev3 35 | !default.perspectivev3 36 | xcuserdata 37 | *.xccheckout 38 | *.moved-aside 39 | DerivedData 40 | *.hmap 41 | *.ipa 42 | *.xcuserstate 43 | 44 | # CocoaPods 45 | # 46 | # We recommend against adding the Pods directory to your .gitignore. However 47 | # you should judge for yourself, the pros and cons are mentioned at: 48 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 49 | # 50 | # Pods/ 51 | 52 | 53 | ### Xcode ### 54 | build/ 55 | *.pbxuser 56 | !default.pbxuser 57 | *.mode1v3 58 | !default.mode1v3 59 | *.mode2v3 60 | !default.mode2v3 61 | *.perspectivev3 62 | !default.perspectivev3 63 | xcuserdata 64 | *.xccheckout 65 | *.moved-aside 66 | DerivedData 67 | *.xcuserstate 68 | 69 | 70 | ### OSX ### 71 | .DS_Store 72 | .AppleDouble 73 | .LSOverride 74 | 75 | # Icon must end with two \r 76 | Icon 77 | 78 | # Thumbnails 79 | ._* 80 | 81 | # Files that might appear on external disk 82 | .Spotlight-V100 83 | .Trashes 84 | 85 | # Directories potentially created on remote AFP share 86 | .AppleDB 87 | .AppleDesktop 88 | Network Trash Folder 89 | Temporary Items 90 | .apdisk 91 | 92 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/trees/hooks/pre-commit.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed. 4 | # Called by "git commit" with no arguments. The hook should 5 | # exit with non-zero status after issuing an appropriate message if 6 | # it wants to stop the commit. 7 | # 8 | # To enable this hook, rename this file to "pre-commit". 9 | 10 | if git rev-parse --verify HEAD >/dev/null 2>&1 11 | then 12 | against=HEAD 13 | else 14 | # Initial commit: diff against an empty tree object 15 | against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 16 | fi 17 | 18 | # If you want to allow non-ASCII filenames set this variable to true. 19 | allownonascii=$(git config --bool hooks.allownonascii) 20 | 21 | # Redirect output to stderr. 22 | exec 1>&2 23 | 24 | # Cross platform projects tend to avoid non-ASCII filenames; prevent 25 | # them from being added to the repository. We exploit the fact that the 26 | # printable range starts at the space character and ends with tilde. 27 | if [ "$allownonascii" != "true" ] && 28 | # Note that the use of brackets around a tr range is ok here, (it's 29 | # even required, for portability to Solaris 10's /usr/bin/tr), since 30 | # the square bracket bytes happen to fall in the designated range. 31 | test $(git diff --cached --name-only --diff-filter=A -z $against | 32 | LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 33 | then 34 | cat <<\EOF 35 | Error: Attempt to add a non-ASCII file name. 36 | 37 | This can cause problems if you want to work with people on other platforms. 38 | 39 | To be portable it is advisable to rename the file. 40 | 41 | If you know what you are doing you can disable this check using: 42 | 43 | git config hooks.allownonascii true 44 | EOF 45 | exit 1 46 | fi 47 | 48 | # If there are whitespace errors, print the offending file names and fail. 49 | exec git diff-index --check --cached $against -- 50 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/BeGreaterThanOrEqualTo.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual value is greater than 4 | /// or equal to the expected value. 5 | public func beGreaterThanOrEqualTo(expectedValue: T?) -> NonNilMatcherFunc { 6 | return NonNilMatcherFunc { actualExpression, failureMessage in 7 | failureMessage.postfixMessage = "be greater than or equal to <\(stringify(expectedValue))>" 8 | let actualValue = try actualExpression.evaluate() 9 | return actualValue >= expectedValue 10 | } 11 | } 12 | 13 | /// A Nimble matcher that succeeds when the actual value is greater than 14 | /// or equal to the expected value. 15 | public func beGreaterThanOrEqualTo(expectedValue: T?) -> NonNilMatcherFunc { 16 | return NonNilMatcherFunc { actualExpression, failureMessage in 17 | failureMessage.postfixMessage = "be greater than or equal to <\(stringify(expectedValue))>" 18 | let actualValue = try actualExpression.evaluate() 19 | let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) != NSComparisonResult.OrderedAscending 20 | return matches 21 | } 22 | } 23 | 24 | public func >=(lhs: Expectation, rhs: T) { 25 | lhs.to(beGreaterThanOrEqualTo(rhs)) 26 | } 27 | 28 | public func >=(lhs: Expectation, rhs: T) { 29 | lhs.to(beGreaterThanOrEqualTo(rhs)) 30 | } 31 | 32 | extension NMBObjCMatcher { 33 | public class func beGreaterThanOrEqualToMatcher(expected: NMBComparable?) -> NMBObjCMatcher { 34 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 35 | let expr = actualExpression.cast { $0 as? NMBComparable } 36 | return try! beGreaterThanOrEqualTo(expected).matches(expr, failureMessage: failureMessage) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Utils/Stringers.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | 4 | internal func identityAsString(value: AnyObject?) -> String { 5 | if value == nil { 6 | return "nil" 7 | } 8 | return NSString(format: "<%p>", unsafeBitCast(value!, Int.self)).description 9 | } 10 | 11 | internal func arrayAsString(items: [T], joiner: String = ", ") -> String { 12 | return items.reduce("") { accum, item in 13 | let prefix = (accum.isEmpty ? "" : joiner) 14 | return accum + prefix + "\(stringify(item))" 15 | } 16 | } 17 | 18 | @objc internal protocol NMBStringer { 19 | func NMB_stringify() -> String 20 | } 21 | 22 | internal func stringify(value: S) -> String { 23 | var generator = value.generate() 24 | var strings = [String]() 25 | var value: S.Generator.Element? 26 | repeat { 27 | value = generator.next() 28 | if value != nil { 29 | strings.append(stringify(value)) 30 | } 31 | } while value != nil 32 | let str = strings.joinWithSeparator(", ") 33 | return "[\(str)]" 34 | } 35 | 36 | extension NSArray : NMBStringer { 37 | func NMB_stringify() -> String { 38 | let str = self.componentsJoinedByString(", ") 39 | return "[\(str)]" 40 | } 41 | } 42 | 43 | internal func stringify(value: T) -> String { 44 | if let value = value as? Double { 45 | return NSString(format: "%.4f", (value)).description 46 | } 47 | return String(value) 48 | } 49 | 50 | internal func stringify(value: NMBDoubleConvertible) -> String { 51 | if let value = value as? Double { 52 | return NSString(format: "%.4f", (value)).description 53 | } 54 | return value.stringRepresentation 55 | } 56 | 57 | internal func stringify(value: T?) -> String { 58 | if let unboxed = value { 59 | return stringify(unboxed) 60 | } 61 | return "nil" 62 | } 63 | -------------------------------------------------------------------------------- /FunkyTests/ErrorIOTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ErrorIOTests.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 15. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Quick 11 | import Nimble 12 | import Funky 13 | 14 | enum TestError : ErrorType { 15 | case Error 16 | } 17 | 18 | class ErrorIOTests: QuickSpec 19 | { 20 | override func spec() 21 | { 22 | describe("an ErrorIO") { 23 | describe("newly initialized") { 24 | let err = ErrorIO() 25 | 26 | it("should contain no child errors") { 27 | expect(err.errors.count) == 0 28 | } 29 | } 30 | 31 | 32 | describe("initialized with an array literal of NSErrors") { 33 | let err: ErrorIO = [ TestError.Error, TestError.Error ] 34 | 35 | it("should add the errors to errors") { 36 | expect(err.errors.count) == 2 37 | } 38 | } 39 | 40 | 41 | describe("when individual NSErrors are added to it with the <~ operator") { 42 | let err = ErrorIO() 43 | err <~ NSError(domain: "", code: 0, userInfo: nil) 44 | err <~ NSError(domain: "", code: 0, userInfo: nil) 45 | 46 | it("should add them to errors") { 47 | expect(err.errors.count) == 2 48 | } 49 | } 50 | 51 | describe("when individual Strings are added to it with the <~ operator") { 52 | let err = ErrorIO() 53 | err <~ "some error" 54 | err <~ "some other error" 55 | 56 | it("should add them to errors") { 57 | expect(err.errors.count) == 2 58 | } 59 | } 60 | } 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/hooks/pre-commit.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed. 4 | # Called by "git commit" with no arguments. The hook should 5 | # exit with non-zero status after issuing an appropriate message if 6 | # it wants to stop the commit. 7 | # 8 | # To enable this hook, rename this file to "pre-commit". 9 | 10 | if git rev-parse --verify HEAD >/dev/null 2>&1 11 | then 12 | against=HEAD 13 | else 14 | # Initial commit: diff against an empty tree object 15 | against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 16 | fi 17 | 18 | # If you want to allow non-ASCII filenames set this variable to true. 19 | allownonascii=$(git config --bool hooks.allownonascii) 20 | 21 | # Redirect output to stderr. 22 | exec 1>&2 23 | 24 | # Cross platform projects tend to avoid non-ASCII filenames; prevent 25 | # them from being added to the repository. We exploit the fact that the 26 | # printable range starts at the space character and ends with tilde. 27 | if [ "$allownonascii" != "true" ] && 28 | # Note that the use of brackets around a tr range is ok here, (it's 29 | # even required, for portability to Solaris 10's /usr/bin/tr), since 30 | # the square bracket bytes happen to fall in the designated range. 31 | test $(git diff --cached --name-only --diff-filter=A -z $against | 32 | LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 33 | then 34 | cat <<\EOF 35 | Error: Attempt to add a non-ASCII file name. 36 | 37 | This can cause problems if you want to work with people on other platforms. 38 | 39 | To be portable it is advisable to rename the file. 40 | 41 | If you know what you are doing you can disable this check using: 42 | 43 | git config hooks.allownonascii true 44 | EOF 45 | exit 1 46 | fi 47 | 48 | # If there are whitespace errors, print the offending file names and fail. 49 | exec git diff-index --check --cached $against -- 50 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/FailureMessage.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Encapsulates the failure message that matchers can report to the end user. 4 | /// 5 | /// This is shared state between Nimble and matchers that mutate this value. 6 | public class FailureMessage: NSObject { 7 | public var expected: String = "expected" 8 | public var actualValue: String? = "" // empty string -> use default; nil -> exclude 9 | public var to: String = "to" 10 | public var postfixMessage: String = "match" 11 | public var postfixActual: String = "" 12 | public var userDescription: String? = nil 13 | 14 | public var stringValue: String { 15 | get { 16 | if let value = _stringValueOverride { 17 | return value 18 | } else { 19 | return computeStringValue() 20 | } 21 | } 22 | set { 23 | _stringValueOverride = newValue 24 | } 25 | } 26 | 27 | internal var _stringValueOverride: String? 28 | 29 | public override init() { 30 | } 31 | 32 | public init(stringValue: String) { 33 | _stringValueOverride = stringValue 34 | } 35 | 36 | internal func stripNewlines(str: String) -> String { 37 | var lines: [String] = (str as NSString).componentsSeparatedByString("\n") as [String] 38 | let whitespace = NSCharacterSet.whitespaceAndNewlineCharacterSet() 39 | lines = lines.map { line in line.stringByTrimmingCharactersInSet(whitespace) } 40 | return lines.joinWithSeparator("") 41 | } 42 | 43 | internal func computeStringValue() -> String { 44 | var value = "\(expected) \(to) \(postfixMessage)" 45 | if let actualValue = actualValue { 46 | value = "\(expected) \(to) \(postfixMessage), got \(actualValue)\(postfixActual)" 47 | } 48 | value = stripNewlines(value) 49 | 50 | if let userDescription = userDescription { 51 | return "\(userDescription)\n\(value)" 52 | } 53 | 54 | return value 55 | } 56 | } -------------------------------------------------------------------------------- /Pods/Quick/Quick/DSL/World+DSL.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface World (SWIFT_EXTENSION(Quick)) 4 | - (void)beforeSuite:(void (^ __nonnull)(void))closure; 5 | - (void)afterSuite:(void (^ __nonnull)(void))closure; 6 | - (void)sharedExamples:(NSString * __nonnull)name closure:(void (^ __nonnull)(NSDictionary * __nonnull (^ __nonnull)(void)))closure; 7 | - (void)describe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 8 | - (void)context:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 9 | - (void)fdescribe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 10 | - (void)xdescribe:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags closure:(void (^ __nonnull)(void))closure; 11 | - (void)beforeEach:(void (^ __nonnull)(void))closure; 12 | - (void)beforeEachWithMetadata:(void (^ __nonnull)(ExampleMetadata * __nonnull))closure; 13 | - (void)afterEach:(void (^ __nonnull)(void))closure; 14 | - (void)afterEachWithMetadata:(void (^ __nonnull)(ExampleMetadata * __nonnull))closure; 15 | - (void)itWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure; 16 | - (void)fitWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure; 17 | - (void)xitWithDescription:(NSString * __nonnull)description flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line closure:(void (^ __nonnull)(void))closure; 18 | - (void)itBehavesLikeSharedExampleNamed:(NSString * __nonnull)name sharedExampleContext:(NSDictionary * __nonnull (^ __nonnull)(void))sharedExampleContext flags:(NSDictionary * __nonnull)flags file:(NSString * __nonnull)file line:(NSUInteger)line; 19 | - (void)pending:(NSString * __nonnull)description closure:(void (^ __nonnull)(void))closure; 20 | @end 21 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/QuickSpec.h: -------------------------------------------------------------------------------- 1 | #import 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 49 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/DSL+Wait.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Only classes, protocols, methods, properties, and subscript declarations can be 4 | /// bridges to Objective-C via the @objc keyword. This class encapsulates callback-style 5 | /// asynchronous waiting logic so that it may be called from Objective-C and Swift. 6 | internal class NMBWait: NSObject { 7 | internal class func until(timeout timeout: NSTimeInterval, file: String = __FILE__, line: UInt = __LINE__, action: (() -> Void) -> Void) -> Void { 8 | var completed = false 9 | var token: dispatch_once_t = 0 10 | let result = pollBlock(pollInterval: 0.01, timeoutInterval: timeout) { 11 | dispatch_once(&token) { 12 | dispatch_async(dispatch_get_main_queue()) { 13 | action() { completed = true } 14 | } 15 | } 16 | return completed 17 | } 18 | switch (result) { 19 | case .Failure: 20 | let pluralize = (timeout == 1 ? "" : "s") 21 | fail("Waited more than \(timeout) second\(pluralize)", file: file, line: line) 22 | case .Timeout: 23 | fail("Stall on main thread - too much enqueued on main run loop before waitUntil executes.", file: file, line: line) 24 | case let .ErrorThrown(error): 25 | // Technically, we can never reach this via a public API call 26 | fail("Unexpected error thrown: \(error)", file: file, line: line) 27 | case .Success: 28 | break 29 | } 30 | } 31 | 32 | @objc(untilFile:line:action:) 33 | internal class func until(file: String = __FILE__, line: UInt = __LINE__, action: (() -> Void) -> Void) -> Void { 34 | until(timeout: 1, file: file, line: line, action: action) 35 | } 36 | } 37 | 38 | /// Wait asynchronously until the done closure is called. 39 | /// 40 | /// This will advance the run loop. 41 | public func waitUntil(timeout timeout: NSTimeInterval = 1, file: String = __FILE__, line: UInt = __LINE__, action: (() -> Void) -> Void) -> Void { 42 | NMBWait.until(timeout: timeout, file: file, line: line, action: action) 43 | } -------------------------------------------------------------------------------- /src/Functions.File.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.File.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Feb 9. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | private let kPathSeparator: Character = "/" 12 | 13 | // 14 | // MARK: - File functions 15 | // 16 | 17 | /** 18 | Equivalent to the Unix `basename` command. Returns the last path component of `path`. 19 | */ 20 | public func basename(path:String) -> String { 21 | return (path as NSString).lastPathComponent 22 | } 23 | 24 | 25 | /** 26 | Equivalent to the Unix `extname` command. Returns the path extension of `path`. 27 | */ 28 | public func extname(path:String) -> String { 29 | return (path as NSString).pathExtension 30 | } 31 | 32 | 33 | /** 34 | Equivalent to the Unix `dirname` command. Returns the parent directory of the 35 | file or directory residing at `path`. 36 | */ 37 | public func dirname(path:String) -> String { 38 | return (path as NSString).stringByDeletingLastPathComponent 39 | } 40 | 41 | 42 | /** 43 | Returns an array of the individual components of `path`. The path separator is 44 | assumed to be `/`, as Swift currently only runs on OSX/iOS. 45 | */ 46 | public func pathComponents(path:String) -> [String] { 47 | return path.characters.split { $0 == kPathSeparator }.map(String.init) 48 | } 49 | 50 | 51 | /** 52 | Returns the relative path (`from` -> `to`). 53 | */ 54 | public func relativePath(from from:String, to:String) -> String 55 | { 56 | let fromParts = pathComponents(from) 57 | let toParts = pathComponents(to) 58 | 59 | // let sharedParts = zipseq(fromParts, toParts) 60 | // |> takeWhile(==) 61 | // |> mapTo(takeLeft) 62 | 63 | let relativeFromParts = Array(fromParts.suffix(Int.max)) 64 | let relativeToParts = Array(toParts.suffix(Int.max)) 65 | 66 | var relativeParts: [String] = [] 67 | for _ in relativeFromParts { 68 | relativeParts.append("..") 69 | } 70 | 71 | relativeParts.appendContentsOf(relativeToParts) 72 | 73 | return relativeParts |> joinWith("\(kPathSeparator)") 74 | } 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /Pods/Quick/README.md: -------------------------------------------------------------------------------- 1 | ![](http://f.cl.ly/items/0r1E192C1R0b2g2Q3h2w/QuickLogo_Color.png) 2 | 3 | Quick is a behavior-driven development framework for Swift and Objective-C. 4 | Inspired by [RSpec](https://github.com/rspec/rspec), [Specta](https://github.com/specta/specta), and [Ginkgo](https://github.com/onsi/ginkgo). 5 | 6 | ![](https://raw.githubusercontent.com/Quick/Assets/master/Screenshots/QuickSpec%20screenshot.png) 7 | 8 | ```swift 9 | // Swift 10 | 11 | import Quick 12 | import Nimble 13 | 14 | class TableOfContentsSpec: QuickSpec { 15 | override func spec() { 16 | describe("the 'Documentation' directory") { 17 | it("has everything you need to get started") { 18 | let sections = Directory("Documentation").sections 19 | expect(sections).to(contain("Organized Tests with Quick Examples and Example Groups")) 20 | expect(sections).to(contain("Installing Quick")) 21 | } 22 | 23 | context("if it doesn't have what you're looking for") { 24 | it("needs to be updated") { 25 | let you = You(awesome: true) 26 | expect{you.submittedAnIssue}.toEventually(beTruthy()) 27 | } 28 | } 29 | } 30 | } 31 | } 32 | ``` 33 | #### Nimble 34 | Quick comes together with [Nimble](https://github.com/Quick/Nimble) — a matcher framework for your tests. You can learn why `XCTAssert()` statements make your expectations unclear and how to fix that using Nimble assertions [here](./Documentation/NimbleAssertions.md). 35 | 36 | ## Documentation 37 | 38 | All documentation can be found in the [Documentation folder](./Documentation), including [detailed installation instructions](./Documentation/InstallingQuick.md) for CocoaPods, Carthage, Git submodules, and more. For example, you can install Quick and [Nimble](https://github.com/Quick/Nimble) using CocoaPods by adding the following to your Podfile: 39 | 40 | ```rb 41 | # Podfile 42 | 43 | use_frameworks! 44 | 45 | def testing_pods 46 | pod 'Quick', '~> 0.8.0' 47 | pod 'Nimble', '3.0.0' 48 | end 49 | 50 | target 'MyTests' do 51 | testing_pods 52 | end 53 | 54 | target 'MyUITests' do 55 | testing_pods 56 | end 57 | ``` 58 | 59 | ## License 60 | 61 | Apache 2.0 license. See the `LICENSE` file for details. 62 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/packed-refs: -------------------------------------------------------------------------------- 1 | # pack-refs with: peeled fully-peeled 2 | e28d7f6e82fbd5dcd5388b36e2acf4eedb44b4e8 refs/heads/master 3 | c05ae1402ee66a7adf17bec1f89900c8457bcfbd refs/heads/parameterize 4 | 8a79bc3cd65080e856a1c13d5c3e7ee5f512fbf5 refs/pull/12/head 5 | 145b748fd48872a202f8902818e6436181d7ee20 refs/pull/13/head 6 | d46e21711cf3994ea0ff3ba6283de614a32ec468 refs/pull/14/head 7 | ff409f32b8fef4dd37bab55aa259fab2196a81fd refs/pull/16/head 8 | 87e5f119c4091afe761513228bf7edbedd7176b7 refs/pull/16/merge 9 | ff409f32b8fef4dd37bab55aa259fab2196a81fd refs/pull/17/head 10 | 5c9d5da0fea3ea4fc3981e620c0fef1c2b3473b8 refs/pull/19/head 11 | 78c3afb965505b3264c444ecfa547cfdcbf2a020 refs/pull/2/head 12 | 284ff17ec83c3b736be6c1fc43c593e77c73d37c refs/pull/2/merge 13 | 077e33f598b431045383e5275e566b677632552e refs/pull/20/head 14 | 8fd774e983be3d1340ce8eedb700be049d841dc3 refs/pull/21/head 15 | 9861edfefc72379b5fc39ffe767294e1ed72f1ae refs/pull/22/head 16 | add7eecd5663a5ce1b44b103227bd008b1220799 refs/pull/23/head 17 | 3f323e6ab1c4787c21a9601bb4e426ce4e3b87b5 refs/pull/23/merge 18 | 2cf57d57a066e64abae61e7dde061cf6ca31ac47 refs/pull/24/head 19 | 49b8d41c454d7edf1b2b8382a115e0487acc74cd refs/pull/24/merge 20 | c74d8a2f0dd149655103e98189aaab04118a1060 refs/pull/25/head 21 | 95a8e3aee83a609f16d5c0bd4a9f4727fe2f8ad7 refs/pull/25/merge 22 | 5c12af1d0c90270639ba55aa2df21e51e55d16cf refs/pull/26/head 23 | 7569c59f49b0d4033a06409745a44f8566189e98 refs/pull/27/head 24 | 5b9d9a4db21dc8e9ac1f5f59f3b8d93f92a90eee refs/pull/3/head 25 | 75ef680700daf6cbeda8e500e192ecfad3d41d96 refs/pull/32/head 26 | 3341557a76a09fa99a7317a5b565d811d4e9dfb8 refs/pull/32/merge 27 | 88b48f87fba8e2b8ad628f0a7afd7c002d01d16c refs/pull/34/head 28 | 743d7575469cbf400c8fba8fc3d9697834bd9dd4 refs/pull/34/merge 29 | 64da818e2b6c9caaaa6a58455df8ea78aba91c9f refs/pull/8/head 30 | 8bb6db48794a1eb369822cf9e376a76517248649 refs/pull/8/merge 31 | bee25134a85d3184537e3d5acbdb1879c0c3aa44 refs/tags/0.2.0 32 | 7f09e45344aa58afb58a672f356404ba50abbc96 refs/tags/v0.1.0 33 | e37b966998df6ca05445c0b5d9c6c9560f1e7b61 refs/tags/v0.5.0 34 | e28d7f6e82fbd5dcd5388b36e2acf4eedb44b4e8 refs/tags/v0.6.0 35 | -------------------------------------------------------------------------------- /src/Functions.ErrorIO.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.ErrorIO.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 14. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | public func coalesce 13 | 14 | (arr: [Result]) -> Result<[T], ErrorIO> 15 | { 16 | let failures = selectFailures(arr) 17 | if failures.count > 0 { 18 | let errorIO = failures.reduce(ErrorIO(), combine: <~) 19 | return errorIO |> asResult 20 | } 21 | else { 22 | return success(rejectFailures(arr)) 23 | } 24 | } 25 | 26 | public func coalesce2 27 | 28 | (arr: [(Result, Result)]) -> Result<[(T, U)], ErrorIO> 29 | { 30 | let errorIO = arr |> reducer(ErrorIO()) { (into, each) in 31 | let (left, right) = each 32 | 33 | if let error = left.error { into <~ error } 34 | if let error = right.error { into <~ error } 35 | return into 36 | } 37 | 38 | if errorIO.hasErrors { 39 | return errorIO.asResult() 40 | } 41 | else { 42 | return arr.map { ($0.0.value!, $0.1.value!) } |> success 43 | } 44 | } 45 | 46 | 47 | public func failure (message: String, file: String = __FILE__, line: Int = __LINE__) -> Result { 48 | // let err = ErrorIO.defaultError(message, file:file, line:line) 49 | // let res: Result = err |> asResult 50 | return ErrorIO.defaultError(message:message, file:file, line:line) 51 | .asResult() 52 | } 53 | 54 | public func failure (nserror:NSError, file: String = __FILE__, line: Int = __LINE__) -> Result { 55 | // let err = ErrorIO.defaultError(message, file:file, line:line) 56 | // let res: Result = err |> asResult 57 | let err = ErrorIO() 58 | err <~ nserror 59 | return err.asResult() 60 | } 61 | 62 | 63 | public func asResult (error:E) -> Result { 64 | return Result.Failure(Box(error)) 65 | } 66 | 67 | 68 | //public func failure (file: String = __FILE__, line: Int = __LINE__) -> Result { 69 | // return failure("", file: file, line: line) 70 | //} 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2015 bryn austin bellomy 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | 25 | Title 26 | Regex 27 | Type 28 | PSGroupSpecifier 29 | 30 | 31 | FooterText 32 | Generated by CocoaPods - http://cocoapods.org 33 | Title 34 | 35 | Type 36 | PSGroupSpecifier 37 | 38 | 39 | StringsTable 40 | Acknowledgements 41 | Title 42 | Acknowledgements 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/HaveCount.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A Nimble matcher that succeeds when the actual CollectionType's count equals 4 | /// the expected value 5 | public func haveCount(expectedValue: T.Index.Distance) -> NonNilMatcherFunc { 6 | return NonNilMatcherFunc { actualExpression, failureMessage in 7 | if let actualValue = try actualExpression.evaluate() { 8 | failureMessage.postfixMessage = "have \(actualValue) with count \(expectedValue)" 9 | let result = expectedValue == actualValue.count 10 | failureMessage.actualValue = "\(actualValue.count)" 11 | return result 12 | } else { 13 | return false 14 | } 15 | } 16 | } 17 | 18 | /// A Nimble matcher that succeeds when the actual collection's count equals 19 | /// the expected value 20 | public func haveCount(expectedValue: Int) -> MatcherFunc { 21 | return MatcherFunc { actualExpression, failureMessage in 22 | if let actualValue = try actualExpression.evaluate() { 23 | failureMessage.postfixMessage = "have \(actualValue) with count \(expectedValue)" 24 | let result = expectedValue == actualValue.count 25 | failureMessage.actualValue = "\(actualValue.count)" 26 | return result 27 | } else { 28 | return false 29 | } 30 | } 31 | } 32 | 33 | extension NMBObjCMatcher { 34 | public class func haveCountMatcher(expected: NSNumber) -> NMBObjCMatcher { 35 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 36 | let location = actualExpression.location 37 | let actualValue = try! actualExpression.evaluate() 38 | if let value = actualValue as? NMBCollection { 39 | let expr = Expression(expression: ({ value as NMBCollection}), location: location) 40 | return try! haveCount(expected.integerValue).matches(expr, failureMessage: failureMessage) 41 | } else if let actualValue = actualValue { 42 | failureMessage.postfixMessage = "get type of NSArray, NSSet, NSDictionary, or NSHashTable" 43 | failureMessage.actualValue = "\(NSStringFromClass(actualValue.dynamicType))" 44 | } 45 | return false 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcshareddata/xcschemes/Regex.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /FunkyTests/RegexTests.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// RegexTests.swift 3 | //// Funky 4 | //// 5 | //// Created by John Holdsworth on 26/06/2014. 6 | //// Copyright (c) 2014 John Holdsworth. All rights reserved. 7 | //// 8 | // 9 | //import Foundation 10 | //import XCTest 11 | //import Funky 12 | // 13 | // 14 | //class RegexTests: XCTestCase 15 | //{ 16 | // func testExample() 17 | // { 18 | // let input = "The quick brown fox jumps over the lazy dog." 19 | // XCTAssert(input["quick .* fox"].match() == "quick brown fox") 20 | // 21 | // if let noMatch = input["quick orange fox"].match() { 22 | // XCTAssert(false, "non-match fail") 23 | // } 24 | // else { 25 | // XCTAssert(true, "non-match pass") 26 | // } 27 | // 28 | // var match: [String] = input["the .* dog"].matches() 29 | // XCTAssert(match == ["the lazy dog"]) 30 | // XCTAssert(input["quick brown (\\w+)"][1] == "fox") 31 | // XCTAssert(input["(the lazy) (cat)?"].groups()[2] == "_") 32 | // 33 | // let groups = input["the (.*?) (fox|dog)", .CaseInsensitive].allGroups() 34 | // XCTAssert(groups == [["The quick brown fox", "quick brown", "fox"], 35 | // ["the lazy dog", "lazy", "dog"]], "groups match") 36 | // 37 | // let minput = NSMutableString(string:input) 38 | // 39 | // minput["(the) (\\w+)"] ~= "$1 very $2" 40 | // XCTAssert(minput == "The quick brown fox jumps over the very lazy dog.", "replace pass") 41 | // 42 | // minput["(fox|dog)"] ~= ["$0", "brown $1"] 43 | // XCTAssert(minput == "The quick brown fox jumps over the very lazy brown dog.", "replace array pass") 44 | // 45 | // minput["(\\w)(\\w+)"] ~= { (groups:[String]) in groups[1].uppercaseString + groups[2] } 46 | // XCTAssert(minput == "The Quick Brown Fox Jumps Over The Very Lazy Brown Dog.", "block pass") 47 | // 48 | // minput["Quick (\\w+)"][1] = "Red $1" 49 | // XCTAssert(minput == "The Quick Red Brown Fox Jumps Over The Very Lazy Brown Dog.", "group replace pass") 50 | // 51 | // var str: String = minput as! String 52 | // str += minput as! String 53 | // 54 | // let props = "name1=value1\nname2='value2\nvalue2\n'\n" 55 | // let dict = props["(\\w+)=('[^']*'|.*)"].dictionary() 56 | // XCTAssert(dict == ["name1": "value1", "name2": "'value2\nvalue2\n'"]) 57 | // } 58 | //} 59 | // 60 | // 61 | // 62 | // 63 | // 64 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Utils/Poll.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | internal enum PollResult : BooleanType { 4 | case Success, Failure, Timeout 5 | case ErrorThrown(ErrorType) 6 | 7 | var boolValue : Bool { 8 | switch (self) { 9 | case .Success: 10 | return true 11 | default: 12 | return false 13 | } 14 | } 15 | } 16 | 17 | internal class RunPromise { 18 | var token: dispatch_once_t = 0 19 | var didFinish = false 20 | var didFail = false 21 | 22 | init() {} 23 | 24 | func succeed() { 25 | dispatch_once(&self.token) { 26 | self.didFinish = false 27 | } 28 | } 29 | 30 | func fail(block: () -> Void) { 31 | dispatch_once(&self.token) { 32 | self.didFail = true 33 | block() 34 | } 35 | } 36 | } 37 | 38 | let killQueue = dispatch_queue_create("nimble.waitUntil.queue", DISPATCH_QUEUE_SERIAL) 39 | 40 | internal func stopRunLoop(runLoop: NSRunLoop, delay: NSTimeInterval) -> RunPromise { 41 | let promise = RunPromise() 42 | let killTimeOffset = Int64(CDouble(delay) * CDouble(NSEC_PER_SEC)) 43 | let killTime = dispatch_time(DISPATCH_TIME_NOW, killTimeOffset) 44 | dispatch_after(killTime, killQueue) { 45 | promise.fail { 46 | CFRunLoopStop(runLoop.getCFRunLoop()) 47 | } 48 | } 49 | return promise 50 | } 51 | 52 | internal func pollBlock(pollInterval pollInterval: NSTimeInterval, timeoutInterval: NSTimeInterval, expression: () throws -> Bool) -> PollResult { 53 | let runLoop = NSRunLoop.mainRunLoop() 54 | 55 | let promise = stopRunLoop(runLoop, delay: min(timeoutInterval, 0.2)) 56 | 57 | let startDate = NSDate() 58 | 59 | // trigger run loop to make sure enqueued tasks don't block our assertion polling 60 | // the stop run loop task above will abort us if necessary 61 | runLoop.runUntilDate(startDate) 62 | dispatch_sync(killQueue) { 63 | promise.succeed() 64 | } 65 | 66 | if promise.didFail { 67 | return .Timeout 68 | } 69 | 70 | var pass = false 71 | do { 72 | repeat { 73 | pass = try expression() 74 | if pass { 75 | break 76 | } 77 | 78 | let runDate = NSDate().dateByAddingTimeInterval(pollInterval) 79 | runLoop.runUntilDate(runDate) 80 | } while(NSDate().timeIntervalSinceDate(startDate) < timeoutInterval) 81 | } catch let error { 82 | return .ErrorThrown(error) 83 | } 84 | 85 | return pass ? .Success : .Failure 86 | } 87 | -------------------------------------------------------------------------------- /FunkyTests/FunkyTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FunkyTests.swift 3 | // FunkyTests 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 5. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import XCTest 11 | import Funky 12 | 13 | class FunkyTests: XCTestCase 14 | { 15 | func testExample() 16 | { 17 | var funcWasCalled = false 18 | func missingValueError(value:String) -> Result { 19 | funcWasCalled = true 20 | return failure("missing value '\(value)'") 21 | } 22 | 23 | let result: Result = success(123) //failure("some failure") 24 | 25 | let asdf = result ?± failure("different failure") 26 | 27 | // if let desc = asdf.error?.localizedDescription { 28 | // XCTAssert(desc == "some failure", "failure message was '\(desc)'") 29 | // } 30 | 31 | XCTAssert(asdf.value! == 123, "value was \(asdf.value)") 32 | XCTAssert(funcWasCalled == false, "function was called") 33 | } 34 | 35 | 36 | func assertRGBA(rgba: (r:CGFloat, g:CGFloat, b:CGFloat, a:CGFloat), isEqualTo t:(CGFloat, CGFloat, CGFloat, CGFloat)) { 37 | XCTAssertEqualWithAccuracy(rgba.r, CGFloat(t.0), accuracy: 0.000001) 38 | XCTAssertEqualWithAccuracy(rgba.g, CGFloat(t.1), accuracy: 0.000001) 39 | XCTAssertEqualWithAccuracy(rgba.b, CGFloat(t.2), accuracy: 0.000001) 40 | XCTAssertEqualWithAccuracy(rgba.a, CGFloat(t.3), accuracy: 0.000001) 41 | } 42 | 43 | func test_rgbaFromHexCode() { 44 | let color = rgbaFromHexCode("#ff0000") 45 | let norm = color! |> normalizeRGBA(colors:255) 46 | NSLog("cccolor = \(color) (normalized = \(norm))") 47 | assertRGBA(norm, isEqualTo:(1, 0, 0, 1)) 48 | assertRGBA(rgbaFromHexCode("#00ff00")! |> normalizeRGBA(colors:255), isEqualTo:(0, 1, 0, 1)) 49 | assertRGBA(rgbaFromHexCode("#0000ff")! |> normalizeRGBA(colors:255), isEqualTo:(0, 0, 1, 1)) 50 | 51 | assertRGBA(rgbaFromHexCode("#ff000000")! |> normalizeRGBA(colors:255), isEqualTo:(1, 0, 0, 0)) 52 | assertRGBA(rgbaFromHexCode("#00ff00ff")! |> normalizeRGBA(colors:255), isEqualTo:(0, 1, 0, 1)) 53 | assertRGBA(rgbaFromHexCode("#0000ff00")! |> normalizeRGBA(colors:255), isEqualTo:(0, 0, 1, 0)) 54 | } 55 | 56 | func test_rgbaFromRGBAString() { 57 | assertRGBA(rgbaFromRGBAString("rgba(0.1, 0.9, 0.2, 0.9)")!, isEqualTo:(0.1, 0.9, 0.2, 0.9)) 58 | assertRGBA(rgbaFromRGBAString("rgba(0.1,0.9,0.2,0.9)")! , isEqualTo:(0.1, 0.9, 0.2, 0.9)) 59 | } 60 | } 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/BeginWith.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | 4 | /// A Nimble matcher that succeeds when the actual sequence's first element 5 | /// is equal to the expected value. 6 | public func beginWith(startingElement: T) -> NonNilMatcherFunc { 7 | return NonNilMatcherFunc { actualExpression, failureMessage in 8 | failureMessage.postfixMessage = "begin with <\(startingElement)>" 9 | if let actualValue = try actualExpression.evaluate() { 10 | var actualGenerator = actualValue.generate() 11 | return actualGenerator.next() == startingElement 12 | } 13 | return false 14 | } 15 | } 16 | 17 | /// A Nimble matcher that succeeds when the actual collection's first element 18 | /// is equal to the expected object. 19 | public func beginWith(startingElement: AnyObject) -> NonNilMatcherFunc { 20 | return NonNilMatcherFunc { actualExpression, failureMessage in 21 | failureMessage.postfixMessage = "begin with <\(startingElement)>" 22 | let collection = try actualExpression.evaluate() 23 | return collection != nil && collection!.indexOfObject(startingElement) == 0 24 | } 25 | } 26 | 27 | /// A Nimble matcher that succeeds when the actual string contains expected substring 28 | /// where the expected substring's location is zero. 29 | public func beginWith(startingSubstring: String) -> NonNilMatcherFunc { 30 | return NonNilMatcherFunc { actualExpression, failureMessage in 31 | failureMessage.postfixMessage = "begin with <\(startingSubstring)>" 32 | if let actual = try actualExpression.evaluate() { 33 | let range = actual.rangeOfString(startingSubstring) 34 | return range != nil && range!.startIndex == actual.startIndex 35 | } 36 | return false 37 | } 38 | } 39 | 40 | extension NMBObjCMatcher { 41 | public class func beginWithMatcher(expected: AnyObject) -> NMBObjCMatcher { 42 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 43 | let actual = try! actualExpression.evaluate() 44 | if let _ = actual as? String { 45 | let expr = actualExpression.cast { $0 as? String } 46 | return try! beginWith(expected as! String).matches(expr, failureMessage: failureMessage) 47 | } else { 48 | let expr = actualExpression.cast { $0 as? NMBOrderedCollection } 49 | return try! beginWith(expected).matches(expr, failureMessage: failureMessage) 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/Operators.compose.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.compose.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | infix operator >>> { associativity right precedence 170 } 11 | infix operator />> { associativity right precedence 170 } 12 | infix operator |>> { associativity left precedence 170 } 13 | infix operator • { associativity left } 14 | 15 | 16 | 17 | /// Returns the left-to-right composition of unary `g` on unary `f`. 18 | /// 19 | /// This is the function such that `(f >>> g)(x)` = `g(f(x))`. 20 | public func >>> (f: T -> U, g: U -> V) -> T -> V { 21 | return { g(f($0)) } 22 | } 23 | 24 | /// Returns the left-to-right composition of unary `g` on binary `f`. 25 | /// 26 | /// This is the function such that `(f >>> g)(x, y)` = `g(f(x, y))`. 27 | public func >>> (f: (T, U) -> V, g: V -> W) -> (T, U) -> W { 28 | return { g(f($0, $1)) } 29 | } 30 | 31 | /// Returns the left-to-right composition of binary `g` on unary `f`. 32 | /// 33 | /// This is the function such that `(f >>> g)(x, y)` = `g(f(x), y)`. 34 | public func >>> (f: T -> U, g: (U, V) -> W) -> (T, V) -> W { 35 | return { g(f($0), $1) } 36 | } 37 | 38 | // MARK: - Left-to-right composition 39 | public func />> 40 | 41 | (f: T -> Result, g: U -> Result) 42 | -> T -> Result 43 | { 44 | return { f($0).flatMap { x in g(x) } } 45 | } 46 | 47 | public func />> 48 | 49 | (f: T -> Result, g: Result -> V) 50 | -> T -> V 51 | { 52 | return { g(f($0)) } 53 | } 54 | 55 | public func />> 56 | 57 | (f: T -> Result, g: U -> V) 58 | -> T -> Result 59 | { 60 | return { f($0).flatMap { x in success(g(x)) } } 61 | } 62 | 63 | public func >>> 64 | 65 | (f: T -> U, g: U -> Void) 66 | -> T -> Void 67 | { 68 | return { f($0) |> g } 69 | } 70 | 71 | 72 | public func |>> 73 | 74 | (f: T -> Result, g: Result -> Void) 75 | -> T -> Void 76 | { 77 | return { f($0) |> g } 78 | } 79 | 80 | 81 | /** 82 | The function composition operator. 83 | 84 | - parameter g: The outer function, called second and passed the return value of f(x). 85 | - parameter f: The inner function, called first and passed some value x. 86 | - returns: A function that takes some argument x, calls g(f(x)), and returns the value. 87 | */ 88 | public func • 89 | 90 | (g: U -> V, f: T -> U) 91 | -> T -> V 92 | { 93 | return { x in g(f(x)) } 94 | } 95 | 96 | 97 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Expectation.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | internal func expressionMatches(expression: Expression, matcher: U, to: String, description: String?) -> (Bool, FailureMessage) { 4 | let msg = FailureMessage() 5 | msg.userDescription = description 6 | msg.to = to 7 | do { 8 | let pass = try matcher.matches(expression, failureMessage: msg) 9 | if msg.actualValue == "" { 10 | msg.actualValue = "<\(stringify(try expression.evaluate()))>" 11 | } 12 | return (pass, msg) 13 | } catch let error { 14 | msg.actualValue = "an unexpected error thrown: <\(error)>" 15 | return (false, msg) 16 | } 17 | } 18 | 19 | internal func expressionDoesNotMatch(expression: Expression, matcher: U, toNot: String, description: String?) -> (Bool, FailureMessage) { 20 | let msg = FailureMessage() 21 | msg.userDescription = description 22 | msg.to = toNot 23 | do { 24 | let pass = try matcher.doesNotMatch(expression, failureMessage: msg) 25 | if msg.actualValue == "" { 26 | msg.actualValue = "<\(stringify(try expression.evaluate()))>" 27 | } 28 | return (pass, msg) 29 | } catch let error { 30 | msg.actualValue = "an unexpected error thrown: <\(error)>" 31 | return (false, msg) 32 | } 33 | } 34 | 35 | public struct Expectation { 36 | let expression: Expression 37 | 38 | public func verify(pass: Bool, _ message: FailureMessage) { 39 | NimbleAssertionHandler.assert(pass, message: message, location: expression.location) 40 | } 41 | 42 | /// Tests the actual value using a matcher to match. 43 | public func to(matcher: U, description: String? = nil) { 44 | let (pass, msg) = expressionMatches(expression, matcher: matcher, to: "to", description: description) 45 | verify(pass, msg) 46 | } 47 | 48 | /// Tests the actual value using a matcher to not match. 49 | public func toNot(matcher: U, description: String? = nil) { 50 | let (pass, msg) = expressionDoesNotMatch(expression, matcher: matcher, toNot: "to not", description: description) 51 | verify(pass, msg) 52 | } 53 | 54 | /// Tests the actual value using a matcher to not match. 55 | /// 56 | /// Alias to toNot(). 57 | public func notTo(matcher: U, description: String? = nil) { 58 | toNot(matcher, description: description) 59 | } 60 | 61 | // see: 62 | // - AsyncMatcherWrapper for extension 63 | // - NMBExpectation for Objective-C interface 64 | } 65 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/EndWith.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | 4 | /// A Nimble matcher that succeeds when the actual sequence's last element 5 | /// is equal to the expected value. 6 | public func endWith(endingElement: T) -> NonNilMatcherFunc { 7 | return NonNilMatcherFunc { actualExpression, failureMessage in 8 | failureMessage.postfixMessage = "end with <\(endingElement)>" 9 | 10 | if let actualValue = try actualExpression.evaluate() { 11 | var actualGenerator = actualValue.generate() 12 | var lastItem: T? 13 | var item: T? 14 | repeat { 15 | lastItem = item 16 | item = actualGenerator.next() 17 | } while(item != nil) 18 | 19 | return lastItem == endingElement 20 | } 21 | return false 22 | } 23 | } 24 | 25 | /// A Nimble matcher that succeeds when the actual collection's last element 26 | /// is equal to the expected object. 27 | public func endWith(endingElement: AnyObject) -> NonNilMatcherFunc { 28 | return NonNilMatcherFunc { actualExpression, failureMessage in 29 | failureMessage.postfixMessage = "end with <\(endingElement)>" 30 | let collection = try actualExpression.evaluate() 31 | return collection != nil && collection!.indexOfObject(endingElement) == collection!.count - 1 32 | } 33 | } 34 | 35 | 36 | /// A Nimble matcher that succeeds when the actual string contains the expected substring 37 | /// where the expected substring's location is the actual string's length minus the 38 | /// expected substring's length. 39 | public func endWith(endingSubstring: String) -> NonNilMatcherFunc { 40 | return NonNilMatcherFunc { actualExpression, failureMessage in 41 | failureMessage.postfixMessage = "end with <\(endingSubstring)>" 42 | if let collection = try actualExpression.evaluate() { 43 | let range = collection.rangeOfString(endingSubstring) 44 | return range != nil && range!.endIndex == collection.endIndex 45 | } 46 | return false 47 | } 48 | } 49 | 50 | extension NMBObjCMatcher { 51 | public class func endWithMatcher(expected: AnyObject) -> NMBObjCMatcher { 52 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 53 | let actual = try! actualExpression.evaluate() 54 | if let _ = actual as? String { 55 | let expr = actualExpression.cast { $0 as? String } 56 | return try! endWith(expected as! String).matches(expr, failureMessage: failureMessage) 57 | } else { 58 | let expr = actualExpression.cast { $0 as? NMBOrderedCollection } 59 | return try! endWith(expected).matches(expr, failureMessage: failureMessage) 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/DSL/QCKDSL.m: -------------------------------------------------------------------------------- 1 | #import "QCKDSL.h" 2 | #import "World.h" 3 | #import "World+DSL.h" 4 | 5 | void qck_beforeSuite(QCKDSLEmptyBlock closure) { 6 | [[World sharedWorld] beforeSuite:closure]; 7 | } 8 | 9 | void qck_afterSuite(QCKDSLEmptyBlock closure) { 10 | [[World sharedWorld] afterSuite:closure]; 11 | } 12 | 13 | void qck_sharedExamples(NSString *name, QCKDSLSharedExampleBlock closure) { 14 | [[World sharedWorld] sharedExamples:name closure:closure]; 15 | } 16 | 17 | void qck_describe(NSString *description, QCKDSLEmptyBlock closure) { 18 | [[World sharedWorld] describe:description flags:@{} closure:closure]; 19 | } 20 | 21 | void qck_context(NSString *description, QCKDSLEmptyBlock closure) { 22 | qck_describe(description, closure); 23 | } 24 | 25 | void qck_beforeEach(QCKDSLEmptyBlock closure) { 26 | [[World sharedWorld] beforeEach:closure]; 27 | } 28 | 29 | void qck_beforeEachWithMetadata(QCKDSLExampleMetadataBlock closure) { 30 | [[World sharedWorld] beforeEachWithMetadata:closure]; 31 | } 32 | 33 | void qck_afterEach(QCKDSLEmptyBlock closure) { 34 | [[World sharedWorld] afterEach:closure]; 35 | } 36 | 37 | void qck_afterEachWithMetadata(QCKDSLExampleMetadataBlock closure) { 38 | [[World sharedWorld] afterEachWithMetadata:closure]; 39 | } 40 | 41 | QCKItBlock qck_it_builder(NSDictionary *flags, NSString *file, NSUInteger line) { 42 | return ^(NSString *description, QCKDSLEmptyBlock closure) { 43 | [[World sharedWorld] itWithDescription:description 44 | flags:flags 45 | file:file 46 | line:line 47 | closure:closure]; 48 | }; 49 | } 50 | 51 | QCKItBehavesLikeBlock qck_itBehavesLike_builder(NSDictionary *flags, NSString *file, NSUInteger line) { 52 | return ^(NSString *name, QCKDSLSharedExampleContext context) { 53 | [[World sharedWorld] itBehavesLikeSharedExampleNamed:name 54 | sharedExampleContext:context 55 | flags:flags 56 | file:file 57 | line:line]; 58 | }; 59 | } 60 | 61 | void qck_pending(NSString *description, QCKDSLEmptyBlock closure) { 62 | [[World sharedWorld] pending:description closure:closure]; 63 | } 64 | 65 | void qck_xdescribe(NSString *description, QCKDSLEmptyBlock closure) { 66 | [[World sharedWorld] xdescribe:description flags:@{} closure:closure]; 67 | } 68 | 69 | void qck_xcontext(NSString *description, QCKDSLEmptyBlock closure) { 70 | qck_xdescribe(description, closure); 71 | } 72 | 73 | void qck_fdescribe(NSString *description, QCKDSLEmptyBlock closure) { 74 | [[World sharedWorld] fdescribe:description flags:@{} closure:closure]; 75 | } 76 | 77 | void qck_fcontext(NSString *description, QCKDSLEmptyBlock closure) { 78 | qck_fdescribe(description, closure); 79 | } 80 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Configuration/QuickConfiguration.m: -------------------------------------------------------------------------------- 1 | #import "QuickConfiguration.h" 2 | #import "World.h" 3 | #import 4 | 5 | typedef void (^QCKClassEnumerationBlock)(Class klass); 6 | 7 | /** 8 | Finds all direct subclasses of the given class and passes them to the block provided. 9 | The classes are iterated over in the order that objc_getClassList returns them. 10 | 11 | @param klass The base class to find subclasses of. 12 | @param block A block that takes a Class. This block will be executed once for each subclass of klass. 13 | */ 14 | void qck_enumerateSubclasses(Class klass, QCKClassEnumerationBlock block) { 15 | Class *classes = NULL; 16 | int classesCount = objc_getClassList(NULL, 0); 17 | 18 | if (classesCount > 0) { 19 | classes = (Class *)calloc(sizeof(Class), classesCount); 20 | classesCount = objc_getClassList(classes, classesCount); 21 | 22 | Class subclass, superclass; 23 | for(int i = 0; i < classesCount; i++) { 24 | subclass = classes[i]; 25 | superclass = class_getSuperclass(subclass); 26 | if (superclass == klass && block) { 27 | block(subclass); 28 | } 29 | } 30 | 31 | free(classes); 32 | } 33 | } 34 | 35 | @implementation QuickConfiguration 36 | 37 | #pragma mark - Object Lifecycle 38 | 39 | /** 40 | QuickConfiguration is not meant to be instantiated; it merely provides a hook 41 | for users to configure how Quick behaves. Raise an exception if an instance of 42 | QuickConfiguration is created. 43 | */ 44 | - (instancetype)init { 45 | NSString *className = NSStringFromClass([self class]); 46 | NSString *selectorName = NSStringFromSelector(@selector(configure:)); 47 | [NSException raise:NSInternalInconsistencyException 48 | format:@"%@ is not meant to be instantiated; " 49 | @"subclass %@ and override %@ to configure Quick.", 50 | className, className, selectorName]; 51 | return nil; 52 | } 53 | 54 | #pragma mark - NSObject Overrides 55 | 56 | /** 57 | Hook into when QuickConfiguration is initialized in the runtime in order to 58 | call +[QuickConfiguration configure:] on each of its subclasses. 59 | */ 60 | + (void)initialize { 61 | // Only enumerate over the subclasses of QuickConfiguration, not any of its subclasses. 62 | if ([self class] == [QuickConfiguration class]) { 63 | 64 | // Only enumerate over subclasses once, even if +[QuickConfiguration initialize] 65 | // were to be called several times. This is necessary because +[QuickSpec initialize] 66 | // manually calls +[QuickConfiguration initialize]. 67 | static dispatch_once_t onceToken; 68 | dispatch_once(&onceToken, ^{ 69 | qck_enumerateSubclasses([QuickConfiguration class], ^(__unsafe_unretained Class klass) { 70 | [[World sharedWorld] configure:^(Configuration *configuration) { 71 | [klass configure:configuration]; 72 | }]; 73 | }); 74 | [[World sharedWorld] finalizeConfiguration]; 75 | }); 76 | } 77 | } 78 | 79 | #pragma mark - Public Interface 80 | 81 | + (void)configure:(Configuration *)configuration { } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /FunkyTests/Functions.FunctionalTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.FunctionalTests.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 15. 6 | // Copyright (c) 2015 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Quick 11 | import Nimble 12 | import Funky 13 | 14 | 15 | 16 | class FunctionsFunctionalTests: QuickSpec 17 | { 18 | override func spec() 19 | { 20 | describe("toCollection()") { 21 | it("should collect the elements of a finite sequence into a collection in the order that they were generated") { 22 | let seq = AnySequence([5, 4, 3, 2, 1]) 23 | let collected: [Int] = seq |> toCollection 24 | expect(collected) == [5, 4, 3, 2, 1] 25 | } 26 | } 27 | 28 | describe("partition()") { 29 | it("should collect a sequence and split its elements into two arrays based on the return value of predicate(elem)") { 30 | let arr = [1, 2, 3, 4, 5, 6, 7, 8] 31 | let (passing, failing) = arr |> partition { $0 % 2 == 0 } 32 | expect(passing) == [2, 4, 6, 8] 33 | expect(failing) == [1, 3, 5, 7] 34 | } 35 | } 36 | 37 | describe("zipseq()") { 38 | it("should zip sequences A and B into a sequence of tuples (elementA, elementB)") { 39 | let one = AnySequence([2, 4, 6, 8]) 40 | let two = AnySequence([20, 40, 60, 80]) 41 | let zipped = zipseq(one, two) 42 | let expected = [(2, 20), (4, 40), (6, 60), (8, 80)] 43 | let areEqual = equalSequences(zipped |> toArray, expected, equalTuples) 44 | expect(areEqual) == true 45 | 46 | } 47 | } 48 | 49 | // describe("take(Int)(SequenceType)") { 50 | // it("should take n elements of the provided sequence, even if the sequence is infinite") { 51 | // var gen = anyGenerator { _ in "xyzzy" } 52 | // let arr = GeneratorSequence(gen) |> take(5) |> toArray 53 | // expect(arr.count) == 5 54 | // expect(arr[0]) == "xyzzy" 55 | // expect(arr[4]) == "xyzzy" 56 | // } 57 | // } 58 | 59 | describe("setValueForKeypath()") { 60 | it("should set a value in a nested tree of string-keyed dictionaries") { 61 | let dict = [ 62 | "an object": [ 63 | "one": 111, 64 | "two": 222, 65 | "three": 333, 66 | ] 67 | ] 68 | 69 | let maybeChanged = setValueForKeypath(dict, keypath: ["an object", "two"], value: Int(5432)) 70 | 71 | expect(maybeChanged.isSuccess).to(beTrue()) 72 | expect(maybeChanged.value).toNot(beNil()) 73 | 74 | let changed = maybeChanged.value! 75 | if let anObject = changed["an object"] as? [String: AnyObject] 76 | { 77 | if let value = anObject["two"] as? Int { 78 | expect(value) == 5432 79 | } 80 | else { expect(1).to(equal(2)) } // there's gotta be a better way to do this 81 | } 82 | else { expect(1).to(equal(2)) } 83 | } 84 | } 85 | } 86 | } 87 | 88 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Wrappers/ObjCMatcher.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public typealias MatcherBlock = (actualExpression: Expression, failureMessage: FailureMessage) -> Bool 4 | public typealias FullMatcherBlock = (actualExpression: Expression, failureMessage: FailureMessage, shouldNotMatch: Bool) -> Bool 5 | 6 | public class NMBObjCMatcher : NSObject, NMBMatcher { 7 | let _match: MatcherBlock 8 | let _doesNotMatch: MatcherBlock 9 | let canMatchNil: Bool 10 | 11 | public init(canMatchNil: Bool, matcher: MatcherBlock, notMatcher: MatcherBlock) { 12 | self.canMatchNil = canMatchNil 13 | self._match = matcher 14 | self._doesNotMatch = notMatcher 15 | } 16 | 17 | public convenience init(matcher: MatcherBlock) { 18 | self.init(canMatchNil: true, matcher: matcher) 19 | } 20 | 21 | public convenience init(canMatchNil: Bool, matcher: MatcherBlock) { 22 | self.init(canMatchNil: canMatchNil, matcher: matcher, notMatcher: ({ actualExpression, failureMessage in 23 | return !matcher(actualExpression: actualExpression, failureMessage: failureMessage) 24 | })) 25 | } 26 | 27 | public convenience init(matcher: FullMatcherBlock) { 28 | self.init(canMatchNil: true, matcher: matcher) 29 | } 30 | 31 | public convenience init(canMatchNil: Bool, matcher: FullMatcherBlock) { 32 | self.init(canMatchNil: canMatchNil, matcher: ({ actualExpression, failureMessage in 33 | return matcher(actualExpression: actualExpression, failureMessage: failureMessage, shouldNotMatch: false) 34 | }), notMatcher: ({ actualExpression, failureMessage in 35 | return matcher(actualExpression: actualExpression, failureMessage: failureMessage, shouldNotMatch: true) 36 | })) 37 | } 38 | 39 | private func canMatch(actualExpression: Expression, failureMessage: FailureMessage) -> Bool { 40 | do { 41 | if !canMatchNil { 42 | if try actualExpression.evaluate() == nil { 43 | failureMessage.postfixActual = " (use beNil() to match nils)" 44 | return false 45 | } 46 | } 47 | } catch let error { 48 | failureMessage.actualValue = "an unexpected error thrown: \(error)" 49 | return false 50 | } 51 | return true 52 | } 53 | 54 | public func matches(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool { 55 | let expr = Expression(expression: actualBlock, location: location) 56 | let result = _match( 57 | actualExpression: expr, 58 | failureMessage: failureMessage) 59 | if self.canMatch(Expression(expression: actualBlock, location: location), failureMessage: failureMessage) { 60 | return result 61 | } else { 62 | return false 63 | } 64 | } 65 | 66 | public func doesNotMatch(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool { 67 | let expr = Expression(expression: actualBlock, location: location) 68 | let result = _doesNotMatch( 69 | actualExpression: expr, 70 | failureMessage: failureMessage) 71 | if self.canMatch(Expression(expression: actualBlock, location: location), failureMessage: failureMessage) { 72 | return result 73 | } else { 74 | return false 75 | } 76 | } 77 | } 78 | 79 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/ExampleGroup.swift: -------------------------------------------------------------------------------- 1 | /** 2 | Example groups are logical groupings of examples, defined with 3 | the `describe` and `context` functions. Example groups can share 4 | setup and teardown code. 5 | */ 6 | final public class ExampleGroup: NSObject { 7 | weak internal var parent: ExampleGroup? 8 | internal let hooks = ExampleHooks() 9 | 10 | private let internalDescription: String 11 | private let flags: FilterFlags 12 | private let isInternalRootExampleGroup: Bool 13 | private var childGroups = [ExampleGroup]() 14 | private var childExamples = [Example]() 15 | 16 | internal init(description: String, flags: FilterFlags, isInternalRootExampleGroup: Bool = false) { 17 | self.internalDescription = description 18 | self.flags = flags 19 | self.isInternalRootExampleGroup = isInternalRootExampleGroup 20 | } 21 | 22 | public override var description: String { 23 | return internalDescription 24 | } 25 | 26 | /** 27 | Returns a list of examples that belong to this example group, 28 | or to any of its descendant example groups. 29 | */ 30 | public var examples: [Example] { 31 | var examples = childExamples 32 | for group in childGroups { 33 | examples.appendContentsOf(group.examples) 34 | } 35 | return examples 36 | } 37 | 38 | internal var name: String? { 39 | if let parent = parent { 40 | switch(parent.name) { 41 | case .Some(let name): return "\(name), \(description)" 42 | case .None: return description 43 | } 44 | } else { 45 | return isInternalRootExampleGroup ? nil : description 46 | } 47 | } 48 | 49 | internal var filterFlags: FilterFlags { 50 | var aggregateFlags = flags 51 | walkUp() { (group: ExampleGroup) -> () in 52 | for (key, value) in group.flags { 53 | aggregateFlags[key] = value 54 | } 55 | } 56 | return aggregateFlags 57 | } 58 | 59 | internal var befores: [BeforeExampleWithMetadataClosure] { 60 | var closures = Array(hooks.befores.reverse()) 61 | walkUp() { (group: ExampleGroup) -> () in 62 | closures.appendContentsOf(Array(group.hooks.befores.reverse())) 63 | } 64 | return Array(closures.reverse()) 65 | } 66 | 67 | internal var afters: [AfterExampleWithMetadataClosure] { 68 | var closures = hooks.afters 69 | walkUp() { (group: ExampleGroup) -> () in 70 | closures.appendContentsOf(group.hooks.afters) 71 | } 72 | return closures 73 | } 74 | 75 | internal func walkDownExamples(callback: (example: Example) -> ()) { 76 | for example in childExamples { 77 | callback(example: example) 78 | } 79 | for group in childGroups { 80 | group.walkDownExamples(callback) 81 | } 82 | } 83 | 84 | internal func appendExampleGroup(group: ExampleGroup) { 85 | group.parent = self 86 | childGroups.append(group) 87 | } 88 | 89 | internal func appendExample(example: Example) { 90 | example.group = self 91 | childExamples.append(example) 92 | } 93 | 94 | private func walkUp(callback: (group: ExampleGroup) -> ()) { 95 | var group = self 96 | while let parent = group.parent { 97 | callback(group: parent) 98 | group = parent 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /src/Operators.Misc.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.misc.swift 3 | // Funky 4 | // 5 | // Created by bryn austin bellomy on 2015 Jan 6. 6 | // Copyright (c) 2014 bryn austin bellomy. All rights reserved. 7 | // 8 | 9 | 10 | 11 | infix operator =?? { associativity left precedence 99 } 12 | infix operator ??= { associativity left precedence 99 } 13 | infix operator ?± { associativity right precedence 110 } 14 | 15 | // look, i made a face operator! 16 | // prefix operator °¿° {} 17 | 18 | 19 | /** 20 | The set-if-non-nil operator. Will only set `lhs` to `rhs` if `rhs` is non-nil. 21 | */ 22 | public func =?? (inout lhs:T, maybeRhs: T?) { 23 | if let rhs = maybeRhs { 24 | lhs = rhs 25 | } 26 | } 27 | 28 | 29 | /** 30 | The set-if-non-nil operator. Will only set `lhs` to `rhs` if `rhs` is non-nil. 31 | */ 32 | public func =?? (inout lhs:T?, maybeRhs: T?) { 33 | if let rhs = maybeRhs { 34 | lhs = rhs 35 | } 36 | } 37 | 38 | 39 | /** 40 | The set-if-non-failure operator. Will only set `lhs` to `rhs` if `rhs` is not a `Result.Failure`. 41 | */ 42 | public func =?? (inout lhs:T, result: Result) { 43 | lhs =?? result.value 44 | } 45 | 46 | 47 | /** 48 | The set-if-non-failure operator. Will only set `lhs` to `rhs` if `rhs` is not a `Result.Failure`. 49 | */ 50 | public func =?? (inout lhs:T?, result: Result) { 51 | lhs =?? result.value 52 | } 53 | 54 | 55 | /** 56 | The initialize-if-nil operator. Will only set `lhs` to `rhs` if `lhs` is nil. 57 | */ 58 | public func ??= (inout lhs:T?, @autoclosure rhs: () -> T) 59 | { 60 | if lhs == nil { 61 | lhs = rhs() 62 | } 63 | } 64 | 65 | 66 | /** 67 | The initialize-if-nil operator. Will only set `lhs` to `rhs` if `lhs` is nil. 68 | */ 69 | public func ??= (inout lhs:T?, @autoclosure rhs: () -> T?) 70 | { 71 | if lhs == nil { 72 | lhs = rhs() 73 | } 74 | } 75 | 76 | 77 | 78 | 79 | 80 | 81 | //public func |> (lhs: T -> Result, rhs: U -> Void) -> T -> Result { 82 | // return { arg in lhs(arg).map { rhs($0); return $0 } } 83 | //} 84 | 85 | 86 | 87 | 88 | 89 | 90 | /** 91 | Nil coalescing operator for `Result`. 92 | */ 93 | public func ?± 94 | (lhs: T?, @autoclosure rhs: () -> Result) -> Result 95 | { 96 | if let lhs = lhs { 97 | return success(lhs) 98 | } 99 | else { 100 | return rhs() 101 | } 102 | } 103 | 104 | public func ?± 105 | (lhs: Result, @autoclosure rhs: () -> Result) -> Result 106 | { 107 | switch lhs { 108 | case .Success: return lhs 109 | case .Failure: return rhs() 110 | } 111 | } 112 | 113 | 114 | 115 | 116 | 117 | postfix operator ‡ {} 118 | 119 | 120 | /** 121 | The reverse-args-and-curry operator (type shift+option+7). Useful in bringing the Swift stdlib collection functions into use in functional pipelines. 122 | 123 | For example: `let lowercaseStrings = someStrings |> mapTo { $0.lowercaseString }` 124 | */ 125 | 126 | //public postfix func ‡ 127 | // 128 | // (f: (T, U, V) -> R) -> V -> ((T, U) -> R) { 129 | // return { v in { t, u in f(t, u, v) }} 130 | //} 131 | 132 | 133 | public postfix func ‡ 134 | 135 | (f: (T, U) -> R) -> U -> T -> R { 136 | // @@XYZZY 137 | // return currySwap(f) 138 | return { x in { y in f(y, x) }} 139 | } 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/MatcherProtocols.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// Implement this protocol to implement a custom matcher for Swift 4 | public protocol Matcher { 5 | typealias ValueType 6 | func matches(actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool 7 | func doesNotMatch(actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool 8 | } 9 | 10 | /// Objective-C interface to the Swift variant of Matcher. 11 | @objc public protocol NMBMatcher { 12 | func matches(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool 13 | func doesNotMatch(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool 14 | } 15 | 16 | /// Protocol for types that support contain() matcher. 17 | @objc public protocol NMBContainer { 18 | func containsObject(object: AnyObject!) -> Bool 19 | } 20 | extension NSArray : NMBContainer {} 21 | extension NSSet : NMBContainer {} 22 | extension NSHashTable : NMBContainer {} 23 | 24 | /// Protocol for types that support only beEmpty(), haveCount() matchers 25 | @objc public protocol NMBCollection { 26 | var count: Int { get } 27 | } 28 | extension NSSet : NMBCollection {} 29 | extension NSDictionary : NMBCollection {} 30 | extension NSHashTable : NMBCollection {} 31 | extension NSMapTable : NMBCollection {} 32 | 33 | /// Protocol for types that support beginWith(), endWith(), beEmpty() matchers 34 | @objc public protocol NMBOrderedCollection : NMBCollection { 35 | func indexOfObject(object: AnyObject!) -> Int 36 | } 37 | extension NSArray : NMBOrderedCollection {} 38 | 39 | /// Protocol for types to support beCloseTo() matcher 40 | @objc public protocol NMBDoubleConvertible { 41 | var doubleValue: CDouble { get } 42 | } 43 | extension NSNumber : NMBDoubleConvertible { 44 | } 45 | 46 | private let dateFormatter: NSDateFormatter = { 47 | let formatter = NSDateFormatter() 48 | formatter.dateFormat = "yyyy-MM-dd HH:mm:ss.SSSS" 49 | formatter.locale = NSLocale(localeIdentifier: "en_US_POSIX") 50 | 51 | return formatter 52 | }() 53 | 54 | extension NSDate: NMBDoubleConvertible { 55 | public var doubleValue: CDouble { 56 | get { 57 | return self.timeIntervalSinceReferenceDate 58 | } 59 | } 60 | } 61 | 62 | 63 | extension NMBDoubleConvertible { 64 | public var stringRepresentation: String { 65 | get { 66 | if let date = self as? NSDate { 67 | return dateFormatter.stringFromDate(date) 68 | } 69 | 70 | if let debugStringConvertible = self as? CustomDebugStringConvertible { 71 | return debugStringConvertible.debugDescription 72 | } 73 | 74 | if let stringConvertible = self as? CustomStringConvertible { 75 | return stringConvertible.description 76 | } 77 | 78 | return "" 79 | } 80 | } 81 | } 82 | 83 | /// Protocol for types to support beLessThan(), beLessThanOrEqualTo(), 84 | /// beGreaterThan(), beGreaterThanOrEqualTo(), and equal() matchers. 85 | /// 86 | /// Types that conform to Swift's Comparable protocol will work implicitly too 87 | @objc public protocol NMBComparable { 88 | func NMB_compare(otherObject: NMBComparable!) -> NSComparisonResult 89 | } 90 | extension NSNumber : NMBComparable { 91 | public func NMB_compare(otherObject: NMBComparable!) -> NSComparisonResult { 92 | return compare(otherObject as! NSNumber) 93 | } 94 | } 95 | extension NSString : NMBComparable { 96 | public func NMB_compare(otherObject: NMBComparable!) -> NSComparisonResult { 97 | return compare(otherObject as! String) 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods/Pods-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "Pods/Regex.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "Pods/Regex.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /Pods/Quick/Quick/Example.swift: -------------------------------------------------------------------------------- 1 | private var numberOfExamplesRun = 0 2 | 3 | /** 4 | Examples, defined with the `it` function, use assertions to 5 | demonstrate how code should behave. These are like "tests" in XCTest. 6 | */ 7 | final public class Example: NSObject { 8 | /** 9 | A boolean indicating whether the example is a shared example; 10 | i.e.: whether it is an example defined with `itBehavesLike`. 11 | */ 12 | public var isSharedExample = false 13 | 14 | /** 15 | The site at which the example is defined. 16 | This must be set correctly in order for Xcode to highlight 17 | the correct line in red when reporting a failure. 18 | */ 19 | public var callsite: Callsite 20 | 21 | weak internal var group: ExampleGroup? 22 | 23 | private let internalDescription: String 24 | private let closure: () -> () 25 | private let flags: FilterFlags 26 | 27 | internal init(description: String, callsite: Callsite, flags: FilterFlags, closure: () -> ()) { 28 | self.internalDescription = description 29 | self.closure = closure 30 | self.callsite = callsite 31 | self.flags = flags 32 | } 33 | 34 | public override var description: String { 35 | return internalDescription 36 | } 37 | 38 | /** 39 | The example name. A name is a concatenation of the name of 40 | the example group the example belongs to, followed by the 41 | description of the example itself. 42 | 43 | The example name is used to generate a test method selector 44 | to be displayed in Xcode's test navigator. 45 | */ 46 | public var name: String { 47 | switch group!.name { 48 | case .Some(let groupName): return "\(groupName), \(description)" 49 | case .None: return description 50 | } 51 | } 52 | 53 | /** 54 | Executes the example closure, as well as all before and after 55 | closures defined in the its surrounding example groups. 56 | */ 57 | public func run() { 58 | let world = World.sharedWorld() 59 | 60 | if numberOfExamplesRun == 0 { 61 | world.suiteHooks.executeBefores() 62 | } 63 | 64 | let exampleMetadata = ExampleMetadata(example: self, exampleIndex: numberOfExamplesRun) 65 | world.currentExampleMetadata = exampleMetadata 66 | 67 | world.exampleHooks.executeBefores(exampleMetadata) 68 | for before in group!.befores { 69 | before(exampleMetadata: exampleMetadata) 70 | } 71 | 72 | closure() 73 | 74 | for after in group!.afters { 75 | after(exampleMetadata: exampleMetadata) 76 | } 77 | world.exampleHooks.executeAfters(exampleMetadata) 78 | 79 | ++numberOfExamplesRun 80 | 81 | if !world.isRunningAdditionalSuites && numberOfExamplesRun >= world.exampleCount { 82 | world.suiteHooks.executeAfters() 83 | } 84 | } 85 | 86 | /** 87 | Evaluates the filter flags set on this example and on the example groups 88 | this example belongs to. Flags set on the example are trumped by flags on 89 | the example group it belongs to. Flags on inner example groups are trumped 90 | by flags on outer example groups. 91 | */ 92 | internal var filterFlags: FilterFlags { 93 | var aggregateFlags = flags 94 | for (key, value) in group!.filterFlags { 95 | aggregateFlags[key] = value 96 | } 97 | return aggregateFlags 98 | } 99 | } 100 | 101 | /** 102 | Returns a boolean indicating whether two Example objects are equal. 103 | If two examples are defined at the exact same callsite, they must be equal. 104 | */ 105 | public func ==(lhs: Example, rhs: Example) -> Bool { 106 | return lhs.callsite == rhs.callsite 107 | } 108 | -------------------------------------------------------------------------------- /_build-experiment/.peru/cache/plugins/git/098d4c9b6e37c040a449b7c12776a0b3a20e5385/https%3A%2F%2Fgithub.com%2FLlamaKit%2FLlamaKit/FETCH_HEAD: -------------------------------------------------------------------------------- 1 | e28d7f6e82fbd5dcd5388b36e2acf4eedb44b4e8 not-for-merge branch 'master' of https://github.com/LlamaKit/LlamaKit 2 | c05ae1402ee66a7adf17bec1f89900c8457bcfbd not-for-merge branch 'parameterize' of https://github.com/LlamaKit/LlamaKit 3 | 8a79bc3cd65080e856a1c13d5c3e7ee5f512fbf5 not-for-merge 'refs/pull/12/head' of https://github.com/LlamaKit/LlamaKit 4 | 145b748fd48872a202f8902818e6436181d7ee20 not-for-merge 'refs/pull/13/head' of https://github.com/LlamaKit/LlamaKit 5 | d46e21711cf3994ea0ff3ba6283de614a32ec468 not-for-merge 'refs/pull/14/head' of https://github.com/LlamaKit/LlamaKit 6 | ff409f32b8fef4dd37bab55aa259fab2196a81fd not-for-merge 'refs/pull/16/head' of https://github.com/LlamaKit/LlamaKit 7 | 87e5f119c4091afe761513228bf7edbedd7176b7 not-for-merge 'refs/pull/16/merge' of https://github.com/LlamaKit/LlamaKit 8 | ff409f32b8fef4dd37bab55aa259fab2196a81fd not-for-merge 'refs/pull/17/head' of https://github.com/LlamaKit/LlamaKit 9 | 5c9d5da0fea3ea4fc3981e620c0fef1c2b3473b8 not-for-merge 'refs/pull/19/head' of https://github.com/LlamaKit/LlamaKit 10 | 78c3afb965505b3264c444ecfa547cfdcbf2a020 not-for-merge 'refs/pull/2/head' of https://github.com/LlamaKit/LlamaKit 11 | 284ff17ec83c3b736be6c1fc43c593e77c73d37c not-for-merge 'refs/pull/2/merge' of https://github.com/LlamaKit/LlamaKit 12 | 077e33f598b431045383e5275e566b677632552e not-for-merge 'refs/pull/20/head' of https://github.com/LlamaKit/LlamaKit 13 | 8fd774e983be3d1340ce8eedb700be049d841dc3 not-for-merge 'refs/pull/21/head' of https://github.com/LlamaKit/LlamaKit 14 | 9861edfefc72379b5fc39ffe767294e1ed72f1ae not-for-merge 'refs/pull/22/head' of https://github.com/LlamaKit/LlamaKit 15 | add7eecd5663a5ce1b44b103227bd008b1220799 not-for-merge 'refs/pull/23/head' of https://github.com/LlamaKit/LlamaKit 16 | 3f323e6ab1c4787c21a9601bb4e426ce4e3b87b5 not-for-merge 'refs/pull/23/merge' of https://github.com/LlamaKit/LlamaKit 17 | 2cf57d57a066e64abae61e7dde061cf6ca31ac47 not-for-merge 'refs/pull/24/head' of https://github.com/LlamaKit/LlamaKit 18 | 49b8d41c454d7edf1b2b8382a115e0487acc74cd not-for-merge 'refs/pull/24/merge' of https://github.com/LlamaKit/LlamaKit 19 | c74d8a2f0dd149655103e98189aaab04118a1060 not-for-merge 'refs/pull/25/head' of https://github.com/LlamaKit/LlamaKit 20 | 95a8e3aee83a609f16d5c0bd4a9f4727fe2f8ad7 not-for-merge 'refs/pull/25/merge' of https://github.com/LlamaKit/LlamaKit 21 | 5c12af1d0c90270639ba55aa2df21e51e55d16cf not-for-merge 'refs/pull/26/head' of https://github.com/LlamaKit/LlamaKit 22 | 7569c59f49b0d4033a06409745a44f8566189e98 not-for-merge 'refs/pull/27/head' of https://github.com/LlamaKit/LlamaKit 23 | 5b9d9a4db21dc8e9ac1f5f59f3b8d93f92a90eee not-for-merge 'refs/pull/3/head' of https://github.com/LlamaKit/LlamaKit 24 | 75ef680700daf6cbeda8e500e192ecfad3d41d96 not-for-merge 'refs/pull/32/head' of https://github.com/LlamaKit/LlamaKit 25 | 3341557a76a09fa99a7317a5b565d811d4e9dfb8 not-for-merge 'refs/pull/32/merge' of https://github.com/LlamaKit/LlamaKit 26 | 88b48f87fba8e2b8ad628f0a7afd7c002d01d16c not-for-merge 'refs/pull/34/head' of https://github.com/LlamaKit/LlamaKit 27 | 743d7575469cbf400c8fba8fc3d9697834bd9dd4 not-for-merge 'refs/pull/34/merge' of https://github.com/LlamaKit/LlamaKit 28 | 64da818e2b6c9caaaa6a58455df8ea78aba91c9f not-for-merge 'refs/pull/8/head' of https://github.com/LlamaKit/LlamaKit 29 | 8bb6db48794a1eb369822cf9e376a76517248649 not-for-merge 'refs/pull/8/merge' of https://github.com/LlamaKit/LlamaKit 30 | bee25134a85d3184537e3d5acbdb1879c0c3aa44 not-for-merge tag '0.2.0' of https://github.com/LlamaKit/LlamaKit 31 | 7f09e45344aa58afb58a672f356404ba50abbc96 not-for-merge tag 'v0.1.0' of https://github.com/LlamaKit/LlamaKit 32 | e37b966998df6ca05445c0b5d9c6c9560f1e7b61 not-for-merge tag 'v0.5.0' of https://github.com/LlamaKit/LlamaKit 33 | e28d7f6e82fbd5dcd5388b36e2acf4eedb44b4e8 not-for-merge tag 'v0.6.0' of https://github.com/LlamaKit/LlamaKit 34 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/BeLogical.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | internal func matcherWithFailureMessage(matcher: M, postprocessor: (FailureMessage) -> Void) -> FullMatcherFunc { 4 | return FullMatcherFunc { actualExpression, failureMessage, isNegation in 5 | let pass: Bool 6 | if isNegation { 7 | pass = try matcher.doesNotMatch(actualExpression, failureMessage: failureMessage) 8 | } else { 9 | pass = try matcher.matches(actualExpression, failureMessage: failureMessage) 10 | } 11 | postprocessor(failureMessage) 12 | return pass 13 | } 14 | } 15 | 16 | // MARK: beTrue() / beFalse() 17 | 18 | /// A Nimble matcher that succeeds when the actual value is exactly true. 19 | /// This matcher will not match against nils. 20 | public func beTrue() -> FullMatcherFunc { 21 | return matcherWithFailureMessage(equal(true)) { failureMessage in 22 | failureMessage.postfixMessage = "be true" 23 | } 24 | } 25 | 26 | /// A Nimble matcher that succeeds when the actual value is exactly false. 27 | /// This matcher will not match against nils. 28 | public func beFalse() -> FullMatcherFunc { 29 | return matcherWithFailureMessage(equal(false)) { failureMessage in 30 | failureMessage.postfixMessage = "be false" 31 | } 32 | } 33 | 34 | // MARK: beTruthy() / beFalsy() 35 | 36 | /// A Nimble matcher that succeeds when the actual value is not logically false. 37 | public func beTruthy() -> MatcherFunc { 38 | return MatcherFunc { actualExpression, failureMessage in 39 | failureMessage.postfixMessage = "be truthy" 40 | let actualValue = try actualExpression.evaluate() 41 | if let actualValue = actualValue { 42 | if let actualValue = actualValue as? BooleanType { 43 | return actualValue.boolValue == true 44 | } 45 | } 46 | return actualValue != nil 47 | } 48 | } 49 | 50 | /// A Nimble matcher that succeeds when the actual value is logically false. 51 | /// This matcher will match against nils. 52 | public func beFalsy() -> MatcherFunc { 53 | return MatcherFunc { actualExpression, failureMessage in 54 | failureMessage.postfixMessage = "be falsy" 55 | let actualValue = try actualExpression.evaluate() 56 | if let actualValue = actualValue { 57 | if let actualValue = actualValue as? BooleanType { 58 | return actualValue.boolValue != true 59 | } 60 | } 61 | return actualValue == nil 62 | } 63 | } 64 | 65 | extension NMBObjCMatcher { 66 | public class func beTruthyMatcher() -> NMBObjCMatcher { 67 | return NMBObjCMatcher { actualExpression, failureMessage in 68 | let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false as BooleanType? } 69 | return try! beTruthy().matches(expr, failureMessage: failureMessage) 70 | } 71 | } 72 | 73 | public class func beFalsyMatcher() -> NMBObjCMatcher { 74 | return NMBObjCMatcher { actualExpression, failureMessage in 75 | let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false as BooleanType? } 76 | return try! beFalsy().matches(expr, failureMessage: failureMessage) 77 | } 78 | } 79 | 80 | public class func beTrueMatcher() -> NMBObjCMatcher { 81 | return NMBObjCMatcher { actualExpression, failureMessage in 82 | let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false as Bool? } 83 | return try! beTrue().matches(expr, failureMessage: failureMessage) 84 | } 85 | } 86 | 87 | public class func beFalseMatcher() -> NMBObjCMatcher { 88 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 89 | let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false as Bool? } 90 | return try! beFalse().matches(expr, failureMessage: failureMessage) 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-FunkyTests/Pods-FunkyTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "Pods-FunkyTests/Regex.framework" 88 | install_framework "Pods-FunkyTests/Nimble.framework" 89 | install_framework "Pods-FunkyTests/Quick.framework" 90 | fi 91 | if [[ "$CONFIGURATION" == "Release" ]]; then 92 | install_framework "Pods-FunkyTests/Regex.framework" 93 | install_framework "Pods-FunkyTests/Nimble.framework" 94 | install_framework "Pods-FunkyTests/Quick.framework" 95 | fi 96 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Adapters/AssertionRecorder.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | /// A data structure that stores information about an assertion when 4 | /// AssertionRecorder is set as the Nimble assertion handler. 5 | /// 6 | /// @see AssertionRecorder 7 | /// @see AssertionHandler 8 | public struct AssertionRecord: CustomStringConvertible { 9 | /// Whether the assertion succeeded or failed 10 | public let success: Bool 11 | /// The failure message the assertion would display on failure. 12 | public let message: FailureMessage 13 | /// The source location the expectation occurred on. 14 | public let location: SourceLocation 15 | 16 | public var description: String { 17 | return "AssertionRecord { success=\(success), message='\(message.stringValue)', location=\(location) }" 18 | } 19 | } 20 | 21 | /// An AssertionHandler that silently records assertions that Nimble makes. 22 | /// This is useful for testing failure messages for matchers. 23 | /// 24 | /// @see AssertionHandler 25 | public class AssertionRecorder : AssertionHandler { 26 | /// All the assertions that were captured by this recorder 27 | public var assertions = [AssertionRecord]() 28 | 29 | public init() {} 30 | 31 | public func assert(assertion: Bool, message: FailureMessage, location: SourceLocation) { 32 | assertions.append( 33 | AssertionRecord( 34 | success: assertion, 35 | message: message, 36 | location: location)) 37 | } 38 | } 39 | 40 | /// Allows you to temporarily replace the current Nimble assertion handler with 41 | /// the one provided for the scope of the closure. 42 | /// 43 | /// Once the closure finishes, then the original Nimble assertion handler is restored. 44 | /// 45 | /// @see AssertionHandler 46 | public func withAssertionHandler(tempAssertionHandler: AssertionHandler, closure: () throws -> Void) { 47 | let oldRecorder = NimbleAssertionHandler 48 | let capturer = NMBExceptionCapture(handler: nil, finally: ({ 49 | NimbleAssertionHandler = oldRecorder 50 | })) 51 | NimbleAssertionHandler = tempAssertionHandler 52 | capturer.tryBlock { 53 | try! closure() 54 | } 55 | } 56 | 57 | /// Captures expectations that occur in the given closure. Note that all 58 | /// expectations will still go through to the default Nimble handler. 59 | /// 60 | /// This can be useful if you want to gather information about expectations 61 | /// that occur within a closure. 62 | /// 63 | /// @param silently expectations are no longer send to the default Nimble 64 | /// assertion handler when this is true. Defaults to false. 65 | /// 66 | /// @see gatherFailingExpectations 67 | public func gatherExpectations(silently silently: Bool = false, closure: () -> Void) -> [AssertionRecord] { 68 | let previousRecorder = NimbleAssertionHandler 69 | let recorder = AssertionRecorder() 70 | let handlers: [AssertionHandler] 71 | 72 | if silently { 73 | handlers = [recorder] 74 | } else { 75 | handlers = [recorder, previousRecorder] 76 | } 77 | 78 | let dispatcher = AssertionDispatcher(handlers: handlers) 79 | withAssertionHandler(dispatcher, closure: closure) 80 | return recorder.assertions 81 | } 82 | 83 | /// Captures failed expectations that occur in the given closure. Note that all 84 | /// expectations will still go through to the default Nimble handler. 85 | /// 86 | /// This can be useful if you want to gather information about failed 87 | /// expectations that occur within a closure. 88 | /// 89 | /// @param silently expectations are no longer send to the default Nimble 90 | /// assertion handler when this is true. Defaults to false. 91 | /// 92 | /// @see gatherExpectations 93 | /// @see raiseException source for an example use case. 94 | public func gatherFailingExpectations(silently silently: Bool = false, closure: () -> Void) -> [AssertionRecord] { 95 | let assertions = gatherExpectations(silently: silently, closure: closure) 96 | return assertions.filter { assertion in 97 | !assertion.success 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Matchers/AllPass.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public func allPass 4 | (passFunc: (T?) -> Bool) -> NonNilMatcherFunc { 5 | return allPass("pass a condition", passFunc) 6 | } 7 | 8 | public func allPass 9 | (passName: String, _ passFunc: (T?) -> Bool) -> NonNilMatcherFunc { 10 | return createAllPassMatcher() { 11 | expression, failureMessage in 12 | failureMessage.postfixMessage = passName 13 | return passFunc(try expression.evaluate()) 14 | } 15 | } 16 | 17 | public func allPass 18 | (matcher: V) -> NonNilMatcherFunc { 19 | return createAllPassMatcher() { 20 | try matcher.matches($0, failureMessage: $1) 21 | } 22 | } 23 | 24 | private func createAllPassMatcher 25 | (elementEvaluator:(Expression, FailureMessage) throws -> Bool) -> NonNilMatcherFunc { 26 | return NonNilMatcherFunc { actualExpression, failureMessage in 27 | failureMessage.actualValue = nil 28 | if let actualValue = try actualExpression.evaluate() { 29 | for currentElement in actualValue { 30 | let exp = Expression( 31 | expression: {currentElement}, location: actualExpression.location) 32 | if try !elementEvaluator(exp, failureMessage) { 33 | failureMessage.postfixMessage = 34 | "all \(failureMessage.postfixMessage)," 35 | + " but failed first at element <\(stringify(currentElement))>" 36 | + " in <\(stringify(actualValue))>" 37 | return false 38 | } 39 | } 40 | failureMessage.postfixMessage = "all \(failureMessage.postfixMessage)" 41 | } else { 42 | failureMessage.postfixMessage = "all pass (use beNil() to match nils)" 43 | return false 44 | } 45 | 46 | return true 47 | } 48 | } 49 | 50 | extension NMBObjCMatcher { 51 | public class func allPassMatcher(matcher: NMBObjCMatcher) -> NMBObjCMatcher { 52 | return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage in 53 | let location = actualExpression.location 54 | let actualValue = try! actualExpression.evaluate() 55 | var nsObjects = [NSObject]() 56 | 57 | var collectionIsUsable = true 58 | if let value = actualValue as? NSFastEnumeration { 59 | let generator = NSFastGenerator(value) 60 | while let obj:AnyObject = generator.next() { 61 | if let nsObject = obj as? NSObject { 62 | nsObjects.append(nsObject) 63 | } else { 64 | collectionIsUsable = false 65 | break 66 | } 67 | } 68 | } else { 69 | collectionIsUsable = false 70 | } 71 | 72 | if !collectionIsUsable { 73 | failureMessage.postfixMessage = 74 | "allPass only works with NSFastEnumeration (NSArray, NSSet, ...) of NSObjects" 75 | failureMessage.expected = "" 76 | failureMessage.to = "" 77 | return false 78 | } 79 | 80 | let expr = Expression(expression: ({ nsObjects }), location: location) 81 | let elementEvaluator: (Expression, FailureMessage) -> Bool = { 82 | expression, failureMessage in 83 | return matcher.matches( 84 | {try! expression.evaluate()}, failureMessage: failureMessage, location: expr.location) 85 | } 86 | return try! createAllPassMatcher(elementEvaluator).matches( 87 | expr, failureMessage: failureMessage) 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Pods/Nimble/Nimble/Wrappers/MatcherFunc.swift: -------------------------------------------------------------------------------- 1 | /// A convenience API to build matchers that allow full control over 2 | /// to() and toNot() match cases. 3 | /// 4 | /// The final bool argument in the closure is if the match is for negation. 5 | /// 6 | /// You may use this when implementing your own custom matchers. 7 | /// 8 | /// Use the Matcher protocol instead of this type to accept custom matchers as 9 | /// input parameters. 10 | /// @see allPass for an example that uses accepts other matchers as input. 11 | public struct FullMatcherFunc: Matcher { 12 | public let matcher: (Expression, FailureMessage, Bool) throws -> Bool 13 | 14 | public init(_ matcher: (Expression, FailureMessage, Bool) throws -> Bool) { 15 | self.matcher = matcher 16 | } 17 | 18 | public func matches(actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { 19 | return try matcher(actualExpression, failureMessage, false) 20 | } 21 | 22 | public func doesNotMatch(actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { 23 | return try matcher(actualExpression, failureMessage, true) 24 | } 25 | } 26 | 27 | /// A convenience API to build matchers that don't need special negation 28 | /// behavior. The toNot() behavior is the negation of to(). 29 | /// 30 | /// @see NonNilMatcherFunc if you prefer to have this matcher fail when nil 31 | /// values are recieved in an expectation. 32 | /// 33 | /// You may use this when implementing your own custom matchers. 34 | /// 35 | /// Use the Matcher protocol instead of this type to accept custom matchers as 36 | /// input parameters. 37 | /// @see allPass for an example that uses accepts other matchers as input. 38 | public struct MatcherFunc: Matcher { 39 | public let matcher: (Expression, FailureMessage) throws -> Bool 40 | 41 | public init(_ matcher: (Expression, FailureMessage) throws -> Bool) { 42 | self.matcher = matcher 43 | } 44 | 45 | public func matches(actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { 46 | return try matcher(actualExpression, failureMessage) 47 | } 48 | 49 | public func doesNotMatch(actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { 50 | return try !matcher(actualExpression, failureMessage) 51 | } 52 | } 53 | 54 | /// A convenience API to build matchers that don't need special negation 55 | /// behavior. The toNot() behavior is the negation of to(). 56 | /// 57 | /// Unlike MatcherFunc, this will always fail if an expectation contains nil. 58 | /// This applies regardless of using to() or toNot(). 59 | /// 60 | /// You may use this when implementing your own custom matchers. 61 | /// 62 | /// Use the Matcher protocol instead of this type to accept custom matchers as 63 | /// input parameters. 64 | /// @see allPass for an example that uses accepts other matchers as input. 65 | public struct NonNilMatcherFunc: Matcher { 66 | public let matcher: (Expression, FailureMessage) throws -> Bool 67 | 68 | public init(_ matcher: (Expression, FailureMessage) throws -> Bool) { 69 | self.matcher = matcher 70 | } 71 | 72 | public func matches(actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { 73 | let pass = try matcher(actualExpression, failureMessage) 74 | if try attachNilErrorIfNeeded(actualExpression, failureMessage: failureMessage) { 75 | return false 76 | } 77 | return pass 78 | } 79 | 80 | public func doesNotMatch(actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { 81 | let pass = try !matcher(actualExpression, failureMessage) 82 | if try attachNilErrorIfNeeded(actualExpression, failureMessage: failureMessage) { 83 | return false 84 | } 85 | return pass 86 | } 87 | 88 | internal func attachNilErrorIfNeeded(actualExpression: Expression, failureMessage: FailureMessage) throws -> Bool { 89 | if try actualExpression.evaluate() == nil { 90 | failureMessage.postfixActual = " (use beNil() to match nils)" 91 | return true 92 | } 93 | return false 94 | } 95 | } 96 | --------------------------------------------------------------------------------