Compare commits
5 Commits
master
...
buildAndRe
| Author | SHA1 | Date |
|---|---|---|
|
|
c579d2b87b | |
|
|
296be1bdb3 | |
|
|
3c3fee2ca9 | |
|
|
447e2f4571 | |
|
|
db46f2b744 |
11
Podfile
11
Podfile
|
|
@ -1,3 +1,10 @@
|
|||
platform :ios, '7.1'
|
||||
|
||||
pod 'CameraManager', :git => 'https://gist.github.com/2204678.git'
|
||||
source 'https://github.com/CocoaPods/Specs.git'
|
||||
platform :ios, '8.0'
|
||||
|
||||
target 'cameraTests' do
|
||||
use_frameworks!
|
||||
|
||||
pod 'Nimble'
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
PODS:
|
||||
- Nimble (0.4.2)
|
||||
|
||||
DEPENDENCIES:
|
||||
- Nimble
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Nimble: 49b7a7da8919f42823d37c6d68cc6d15a7009f32
|
||||
|
||||
COCOAPODS: 0.37.1
|
||||
|
|
@ -0,0 +1 @@
|
|||
../../../Nimble/Nimble/objc/DSL.h
|
||||
|
|
@ -0,0 +1 @@
|
|||
../../../Nimble/Nimble/objc/NMBExceptionCapture.h
|
||||
|
|
@ -0,0 +1 @@
|
|||
../../../Nimble/Nimble/Nimble.h
|
||||
|
|
@ -0,0 +1 @@
|
|||
../../../Nimble/Nimble/objc/DSL.h
|
||||
|
|
@ -0,0 +1 @@
|
|||
../../../Nimble/Nimble/objc/NMBExceptionCapture.h
|
||||
|
|
@ -0,0 +1 @@
|
|||
../../../Nimble/Nimble/Nimble.h
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "Nimble",
|
||||
"version": "0.3.0",
|
||||
"summary": "A Matcher Framework for Swift and Objective-C",
|
||||
"description": " Use Nimble to express the expected outcomes of Swift or Objective-C expressions. Inspired by Cedar.\n",
|
||||
"homepage": "https://github.com/Quick/Nimble",
|
||||
"license": {
|
||||
"type": "Apache 2.0",
|
||||
"file": "LICENSE.md"
|
||||
},
|
||||
"authors": "Quick Contributors",
|
||||
"platforms": {
|
||||
"ios": "8.0",
|
||||
"osx": "10.10"
|
||||
},
|
||||
"source": {
|
||||
"git": "https://github.com/Quick/Nimble.git",
|
||||
"tag": "v0.3.0"
|
||||
},
|
||||
"source_files": [
|
||||
"Nimble",
|
||||
"Nimble/**/*.{swift,h,m}"
|
||||
],
|
||||
"frameworks": "XCTest",
|
||||
"requires_arc": true
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
PODS:
|
||||
- Nimble (0.4.2)
|
||||
|
||||
DEPENDENCIES:
|
||||
- Nimble
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Nimble: 49b7a7da8919f42823d37c6d68cc6d15a7009f32
|
||||
|
||||
COCOAPODS: 0.37.1
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2014 Quick Team
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
import Foundation
|
||||
|
||||
/// Protocol for the assertion handler that Nimble uses for all expectations.
|
||||
public protocol AssertionHandler {
|
||||
func assert(assertion: Bool, message: String, location: SourceLocation)
|
||||
}
|
||||
|
||||
/// Global backing interface for assertions that Nimble creates.
|
||||
/// Defaults to a private test handler that passes through to XCTest.
|
||||
///
|
||||
/// @see AssertionHandler
|
||||
public var NimbleAssertionHandler: AssertionHandler = NimbleXCTestHandler()
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
import Foundation
|
||||
|
||||
/// A data structure that stores information about an assertion when
|
||||
/// AssertionRecorder is set as the Nimble assertion handler.
|
||||
///
|
||||
/// @see AssertionRecorder
|
||||
/// @see AssertionHandler
|
||||
public struct AssertionRecord {
|
||||
/// Whether the assertion succeeded or failed
|
||||
public let success: Bool
|
||||
/// The failure message the assertion would display on failure.
|
||||
public let message: String
|
||||
/// The source location the expectation occurred on.
|
||||
public let location: SourceLocation
|
||||
}
|
||||
|
||||
/// An AssertionHandler that silently records assertions that Nimble makes.
|
||||
/// This is useful for testing failure messages for matchers.
|
||||
///
|
||||
/// @see AssertionHandler
|
||||
public class AssertionRecorder : AssertionHandler {
|
||||
/// All the assertions that were captured by this recorder
|
||||
public var assertions = [AssertionRecord]()
|
||||
|
||||
public init() {}
|
||||
|
||||
public func assert(assertion: Bool, message: String, location: SourceLocation) {
|
||||
assertions.append(
|
||||
AssertionRecord(
|
||||
success: assertion,
|
||||
message: message,
|
||||
location: location))
|
||||
}
|
||||
}
|
||||
|
||||
/// Allows you to temporarily replace the current Nimble assertion handler with
|
||||
/// the one provided for the scope of the closure.
|
||||
///
|
||||
/// Once the closure finishes, then the original Nimble assertion handler is restored.
|
||||
///
|
||||
/// @see AssertionHandler
|
||||
public func withAssertionHandler(tempAssertionHandler: AssertionHandler, closure: () -> Void) {
|
||||
let oldRecorder = NimbleAssertionHandler
|
||||
let capturer = NMBExceptionCapture(handler: nil, finally: ({
|
||||
NimbleAssertionHandler = oldRecorder
|
||||
}))
|
||||
NimbleAssertionHandler = tempAssertionHandler
|
||||
capturer.tryBlock {
|
||||
closure()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
import Foundation
|
||||
import XCTest
|
||||
|
||||
/// Default handler for Nimble. This assertion handler passes failures along to
|
||||
/// XCTest.
|
||||
public class NimbleXCTestHandler : AssertionHandler {
|
||||
public func assert(assertion: Bool, message: String, location: SourceLocation) {
|
||||
if !assertion {
|
||||
XCTFail(message, file: location.file, line: location.line)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
import Foundation
|
||||
|
||||
/// Only classes, protocols, methods, properties, and subscript declarations can be
|
||||
/// bridges to Objective-C via the @objc keyword. This class encapsulates callback-style
|
||||
/// asynchronous waiting logic so that it may be called from Objective-C and Swift.
|
||||
@objc public class NMBWait {
|
||||
public class func until(#timeout: NSTimeInterval, file: String = __FILE__, line: UInt = __LINE__, action: (() -> Void) -> Void) -> Void {
|
||||
var completed = false
|
||||
var token: dispatch_once_t = 0
|
||||
let result = pollBlock(pollInterval: 0.01, timeoutInterval: timeout) {
|
||||
dispatch_once(&token) {
|
||||
dispatch_async(dispatch_get_main_queue()) {
|
||||
action() { completed = true }
|
||||
}
|
||||
}
|
||||
return completed
|
||||
}
|
||||
if result == PollResult.Failure {
|
||||
let pluralize = (timeout == 1 ? "" : "s")
|
||||
fail("Waited more than \(timeout) second\(pluralize)", file: file, line: line)
|
||||
} else if result == PollResult.Timeout {
|
||||
fail("Stall on main thread - too much enqueued on main run loop before waitUntil executes.", file: file, line: line)
|
||||
}
|
||||
}
|
||||
|
||||
public class func until(file: String = __FILE__, line: UInt = __LINE__, action: (() -> Void) -> Void) -> Void {
|
||||
until(timeout: 1, file: file, line: line, action: action)
|
||||
}
|
||||
}
|
||||
|
||||
/// Wait asynchronously until the done closure is called.
|
||||
///
|
||||
/// This will advance the run loop.
|
||||
public func waitUntil(#timeout: NSTimeInterval, file: String = __FILE__, line: UInt = __LINE__, action: (() -> Void) -> Void) -> Void {
|
||||
NMBWait.until(timeout: timeout, file: file, line: line, action: action)
|
||||
}
|
||||
|
||||
/// Wait asynchronously until the done closure is called.
|
||||
///
|
||||
/// This will advance the run loop.
|
||||
public func waitUntil(file: String = __FILE__, line: UInt = __LINE__, action: (() -> Void) -> Void) -> Void {
|
||||
NMBWait.until(file: file, line: line, action: action)
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
/// Make an expectation on a given actual value. The value given is lazily evaluated.
|
||||
public func expect<T>(@autoclosure(escaping) expression: () -> T?, file: String = __FILE__, line: UInt = __LINE__) -> Expectation<T> {
|
||||
return Expectation(
|
||||
expression: Expression(
|
||||
expression: expression,
|
||||
location: SourceLocation(file: file, line: line),
|
||||
isClosure: true))
|
||||
}
|
||||
|
||||
/// Make an expectation on a given actual value. The closure is lazily invoked.
|
||||
public func expect<T>(file: String = __FILE__, line: UInt = __LINE__, expression: () -> T?) -> Expectation<T> {
|
||||
return Expectation(
|
||||
expression: Expression(
|
||||
expression: expression,
|
||||
location: SourceLocation(file: file, line: line),
|
||||
isClosure: true))
|
||||
}
|
||||
|
||||
/// Always fails the test with a message and a specified location.
|
||||
public func fail(message: String, #location: SourceLocation) {
|
||||
NimbleAssertionHandler.assert(false, message: message, location: location)
|
||||
}
|
||||
|
||||
/// Always fails the test with a message.
|
||||
public func fail(message: String, file: String = __FILE__, line: UInt = __LINE__) {
|
||||
fail(message, location: SourceLocation(file: file, line: line))
|
||||
}
|
||||
|
||||
/// Always fails the test.
|
||||
public func fail(file: String = __FILE__, line: UInt = __LINE__) {
|
||||
fail("fail() always fails")
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
import Foundation
|
||||
|
||||
public struct Expectation<T> {
|
||||
let expression: Expression<T>
|
||||
|
||||
public func verify(pass: Bool, _ message: String) {
|
||||
NimbleAssertionHandler.assert(pass, message: message, location: expression.location)
|
||||
}
|
||||
|
||||
public func to<U where U: Matcher, U.ValueType == T>(matcher: U) {
|
||||
var msg = FailureMessage()
|
||||
let pass = matcher.matches(expression, failureMessage: msg)
|
||||
if msg.actualValue == "" {
|
||||
msg.actualValue = "<\(stringify(expression.evaluate()))>"
|
||||
}
|
||||
verify(pass, msg.stringValue())
|
||||
}
|
||||
|
||||
public func toNot<U where U: Matcher, U.ValueType == T>(matcher: U) {
|
||||
var msg = FailureMessage()
|
||||
let pass = matcher.doesNotMatch(expression, failureMessage: msg)
|
||||
if msg.actualValue == "" {
|
||||
msg.actualValue = "<\(stringify(expression.evaluate()))>"
|
||||
}
|
||||
verify(pass, msg.stringValue())
|
||||
}
|
||||
|
||||
public func notTo<U where U: Matcher, U.ValueType == T>(matcher: U) {
|
||||
toNot(matcher)
|
||||
}
|
||||
|
||||
// see:
|
||||
// - BasicMatcherWrapper for extension
|
||||
// - AsyncMatcherWrapper for extension
|
||||
// - NonNilMatcherWrapper for extension
|
||||
//
|
||||
// - NMBExpectation for Objective-C interface
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import Foundation
|
||||
|
||||
// Memoizes the given closure, only calling the passed
|
||||
// closure once; even if repeat calls to the returned closure
|
||||
internal func memoizedClosure<T>(closure: () -> T) -> (Bool) -> T {
|
||||
var cache: T?
|
||||
return ({ withoutCaching in
|
||||
if (withoutCaching || cache == nil) {
|
||||
cache = closure()
|
||||
}
|
||||
return cache!
|
||||
})
|
||||
}
|
||||
|
||||
public struct Expression<T> {
|
||||
internal let _expression: (Bool) -> T?
|
||||
internal let _withoutCaching: Bool
|
||||
public let location: SourceLocation
|
||||
public let isClosure: Bool
|
||||
|
||||
public init(expression: () -> T?, location: SourceLocation, isClosure: Bool = false) {
|
||||
self._expression = memoizedClosure(expression)
|
||||
self.location = location
|
||||
self._withoutCaching = false
|
||||
self.isClosure = isClosure
|
||||
}
|
||||
|
||||
public init(memoizedExpression: (Bool) -> T?, location: SourceLocation, withoutCaching: Bool, isClosure: Bool = false) {
|
||||
self._expression = memoizedExpression
|
||||
self.location = location
|
||||
self._withoutCaching = withoutCaching
|
||||
self.isClosure = isClosure
|
||||
}
|
||||
|
||||
public func cast<U>(block: (T?) -> U?) -> Expression<U> {
|
||||
return Expression<U>(expression: ({ block(self.evaluate()) }), location: self.location, isClosure: self.isClosure)
|
||||
}
|
||||
|
||||
public func evaluate() -> T? {
|
||||
return self._expression(_withoutCaching)
|
||||
}
|
||||
|
||||
public func withoutCaching() -> Expression<T> {
|
||||
return Expression(memoizedExpression: self._expression, location: location, withoutCaching: true, isClosure: isClosure)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
import Foundation
|
||||
|
||||
@objc
|
||||
public class FailureMessage {
|
||||
public var expected: String = "expected"
|
||||
public var actualValue: String? = "" // empty string -> use default; nil -> exclude
|
||||
public var to: String = "to"
|
||||
public var postfixMessage: String = "match"
|
||||
public var postfixActual: String = ""
|
||||
|
||||
public init() {
|
||||
}
|
||||
|
||||
public func stringValue() -> String {
|
||||
var value = "\(expected) \(to) \(postfixMessage)"
|
||||
if let actualValue = actualValue {
|
||||
value = "\(expected) \(to) \(postfixMessage), got \(actualValue)\(postfixActual)"
|
||||
}
|
||||
var lines: [String] = (value as NSString).componentsSeparatedByString("\n") as! [String]
|
||||
let whitespace = NSCharacterSet.whitespaceAndNewlineCharacterSet()
|
||||
lines = lines.map { line in line.stringByTrimmingCharactersInSet(whitespace) }
|
||||
return "".join(lines)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
import Foundation
|
||||
|
||||
public func allPass<T,U where U: SequenceType, U.Generator.Element == T>
|
||||
(passFunc: (T?) -> Bool) -> NonNilMatcherFunc<U> {
|
||||
return allPass("pass a condition", passFunc)
|
||||
}
|
||||
|
||||
public func allPass<T,U where U: SequenceType, U.Generator.Element == T>
|
||||
(passName:String, passFunc: (T?) -> Bool) -> NonNilMatcherFunc<U> {
|
||||
return createAllPassMatcher() {
|
||||
expression, failureMessage in
|
||||
failureMessage.postfixMessage = passName
|
||||
return passFunc(expression.evaluate())
|
||||
}
|
||||
}
|
||||
|
||||
public func allPass<U,V where U: SequenceType, V: NonNilBasicMatcher, U.Generator.Element == V.ValueType>
|
||||
(matcher: V) -> NonNilMatcherFunc<U> {
|
||||
let wrapper = NonNilMatcherWrapper(NonNilBasicMatcherWrapper(matcher))
|
||||
return createAllPassMatcher() {wrapper.matches($0, failureMessage: $1)}
|
||||
}
|
||||
|
||||
public func allPass<U,V where U: SequenceType, V: BasicMatcher, U.Generator.Element == V.ValueType>
|
||||
(matcher: V) -> NonNilMatcherFunc<U> {
|
||||
let wrapper = BasicMatcherWrapper(matcher: matcher)
|
||||
return createAllPassMatcher() {wrapper.matches($0, failureMessage: $1)}
|
||||
}
|
||||
|
||||
public func allPass<U,V where U: SequenceType, V: Matcher, U.Generator.Element == V.ValueType>
|
||||
(matcher: V) -> NonNilMatcherFunc<U> {
|
||||
return createAllPassMatcher() {matcher.matches($0, failureMessage: $1)}
|
||||
}
|
||||
|
||||
private func createAllPassMatcher<T,U where U: SequenceType, U.Generator.Element == T>
|
||||
(elementEvaluator:(Expression<T>, FailureMessage) -> Bool) -> NonNilMatcherFunc<U> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.actualValue = nil
|
||||
if let actualValue = actualExpression.evaluate() {
|
||||
for currentElement in actualValue {
|
||||
let exp = Expression(
|
||||
expression: {currentElement}, location: actualExpression.location)
|
||||
if !elementEvaluator(exp, failureMessage) {
|
||||
failureMessage.postfixMessage =
|
||||
"all \(failureMessage.postfixMessage),"
|
||||
+ " but failed first at element <\(stringify(currentElement))>"
|
||||
+ " in <\(stringify(actualValue))>"
|
||||
return false
|
||||
}
|
||||
}
|
||||
failureMessage.postfixMessage = "all \(failureMessage.postfixMessage)"
|
||||
} else {
|
||||
failureMessage.postfixMessage = "all pass (use beNil() to match nils)"
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func allPassMatcher(matcher: NMBObjCMatcher) -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
let actualValue = actualExpression.evaluate()
|
||||
var nsObjects = [NSObject]()
|
||||
|
||||
var collectionIsUsable = true
|
||||
if let value = actualValue as? NSFastEnumeration {
|
||||
let generator = NSFastGenerator(value)
|
||||
while let obj:AnyObject = generator.next() {
|
||||
if let nsObject = obj as? NSObject {
|
||||
nsObjects.append(nsObject)
|
||||
} else {
|
||||
collectionIsUsable = false
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
collectionIsUsable = false
|
||||
}
|
||||
|
||||
if !collectionIsUsable {
|
||||
failureMessage.postfixMessage =
|
||||
"allPass only works with NSFastEnumeration (NSArray, NSSet, ...) of NSObjects"
|
||||
failureMessage.expected = ""
|
||||
failureMessage.to = ""
|
||||
return false
|
||||
}
|
||||
|
||||
let expr = Expression(expression: ({ nsObjects }), location: location)
|
||||
let elementEvaluator: (Expression<NSObject>, FailureMessage) -> Bool = {
|
||||
expression, failureMessage in
|
||||
return matcher.matches(
|
||||
{expression.evaluate()}, failureMessage: failureMessage, location: expr.location)
|
||||
}
|
||||
return createAllPassMatcher(elementEvaluator).matches(
|
||||
expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
import Foundation
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is an instance of the given class.
|
||||
/// @see beAnInstanceOf if you want to match against the exact class
|
||||
public func beAKindOf(expectedClass: AnyClass) -> NonNilMatcherFunc<NSObject> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
let instance = actualExpression.evaluate()
|
||||
if let validInstance = instance {
|
||||
failureMessage.actualValue = "<\(NSStringFromClass(validInstance.dynamicType)) instance>"
|
||||
} else {
|
||||
failureMessage.actualValue = "<nil>"
|
||||
}
|
||||
failureMessage.postfixMessage = "be a kind of \(NSStringFromClass(expectedClass))"
|
||||
return instance != nil && instance!.isKindOfClass(expectedClass)
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beAKindOfMatcher(expected: AnyClass) -> NMBMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
return beAKindOf(expected).matches(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
import Foundation
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is an instance of the given class.
|
||||
/// @see beAKindOf if you want to match against subclasses
|
||||
public func beAnInstanceOf(expectedClass: AnyClass) -> NonNilMatcherFunc<NSObject> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
let instance = actualExpression.evaluate()
|
||||
if let validInstance = instance {
|
||||
failureMessage.actualValue = "<\(NSStringFromClass(validInstance.dynamicType)) instance>"
|
||||
} else {
|
||||
failureMessage.actualValue = "<nil>"
|
||||
}
|
||||
failureMessage.postfixMessage = "be an instance of \(NSStringFromClass(expectedClass))"
|
||||
return instance != nil && instance!.isMemberOfClass(expectedClass)
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beAnInstanceOfMatcher(expected: AnyClass) -> NMBMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
return beAnInstanceOf(expected).matches(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
import Foundation
|
||||
|
||||
let DefaultDelta = 0.0001
|
||||
|
||||
internal func isCloseTo(actualValue: Double?, expectedValue: Double, delta: Double, failureMessage: FailureMessage) -> Bool {
|
||||
failureMessage.postfixMessage = "be close to <\(stringify(expectedValue))> (within \(stringify(delta)))"
|
||||
if actualValue != nil {
|
||||
failureMessage.actualValue = "<\(stringify(actualValue!))>"
|
||||
} else {
|
||||
failureMessage.actualValue = "<nil>"
|
||||
}
|
||||
return actualValue != nil && abs(actualValue! - expectedValue) < delta
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when a value is close to another. This is used for floating
|
||||
/// point values which can have imprecise results when doing arithmetic on them.
|
||||
///
|
||||
/// @see equal
|
||||
public func beCloseTo(expectedValue: Double, within delta: Double = DefaultDelta) -> NonNilMatcherFunc<Double> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
return isCloseTo(actualExpression.evaluate(), expectedValue, delta, failureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when a value is close to another. This is used for floating
|
||||
/// point values which can have imprecise results when doing arithmetic on them.
|
||||
///
|
||||
/// @see equal
|
||||
public func beCloseTo(expectedValue: NMBDoubleConvertible, within delta: Double = DefaultDelta) -> NonNilMatcherFunc<NMBDoubleConvertible> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
return isCloseTo(actualExpression.evaluate()?.doubleValue, expectedValue.doubleValue, delta, failureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
@objc public class NMBObjCBeCloseToMatcher : NMBMatcher {
|
||||
var _expected: NSNumber
|
||||
var _delta: CDouble
|
||||
init(expected: NSNumber, within: CDouble) {
|
||||
_expected = expected
|
||||
_delta = within
|
||||
}
|
||||
|
||||
public func matches(actualExpression: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
|
||||
let actualBlock: () -> NMBDoubleConvertible? = ({
|
||||
return actualExpression() as? NMBDoubleConvertible
|
||||
})
|
||||
let expr = Expression(expression: actualBlock, location: location)
|
||||
let matcher = NonNilMatcherWrapper(NonNilBasicMatcherWrapper(beCloseTo(self._expected, within: self._delta)))
|
||||
return matcher.matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
|
||||
public func doesNotMatch(actualExpression: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
|
||||
let actualBlock: () -> NMBDoubleConvertible? = ({
|
||||
return actualExpression() as? NMBDoubleConvertible
|
||||
})
|
||||
let expr = Expression(expression: actualBlock, location: location)
|
||||
let matcher = NonNilMatcherWrapper(NonNilBasicMatcherWrapper(beCloseTo(self._expected, within: self._delta)))
|
||||
return matcher.doesNotMatch(expr, failureMessage: failureMessage)
|
||||
}
|
||||
|
||||
public var within: (CDouble) -> NMBObjCBeCloseToMatcher {
|
||||
return ({ delta in
|
||||
return NMBObjCBeCloseToMatcher(expected: self._expected, within: delta)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beCloseToMatcher(expected: NSNumber, within: CDouble) -> NMBObjCBeCloseToMatcher {
|
||||
return NMBObjCBeCloseToMatcher(expected: expected, within: within)
|
||||
}
|
||||
}
|
||||
|
||||
public func beCloseTo(expectedValues: [Double], within delta: Double = DefaultDelta) -> NonNilMatcherFunc <[Double]> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be close to <\(stringify(expectedValues))> (each within \(stringify(delta)))"
|
||||
if let actual = actualExpression.evaluate() {
|
||||
if actual.count != expectedValues.count {
|
||||
return false
|
||||
} else {
|
||||
for (index, actualItem) in enumerate(actual) {
|
||||
if fabs(actualItem - expectedValues[index]) > delta {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Operators
|
||||
|
||||
infix operator ≈ {}
|
||||
|
||||
public func ≈(lhs: Expectation<[Double]>, rhs: [Double]) {
|
||||
lhs.to(beCloseTo(rhs))
|
||||
}
|
||||
|
||||
public func ≈(lhs: Expectation<Double>, rhs: Double) {
|
||||
lhs.to(beCloseTo(rhs))
|
||||
}
|
||||
|
||||
public func ≈(lhs: Expectation<Double>, rhs: (expected: Double, delta: Double)) {
|
||||
lhs.to(beCloseTo(rhs.expected, within: rhs.delta))
|
||||
}
|
||||
|
||||
public func ==(lhs: Expectation<Double>, rhs: (expected: Double, delta: Double)) {
|
||||
lhs.to(beCloseTo(rhs.expected, within: rhs.delta))
|
||||
}
|
||||
|
||||
// make this higher precedence than exponents so the Doubles either end aren't pulled in
|
||||
// unexpectantly
|
||||
infix operator ± { precedence 170 }
|
||||
public func ±(lhs: Double, rhs: Double) -> (expected: Double, delta: Double) {
|
||||
return (expected: lhs, delta: rhs)
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
import Foundation
|
||||
|
||||
|
||||
/// A Nimble matcher that succeeds when a value is "empty". For collections, this
|
||||
/// means the are no items in that collection. For strings, it is an empty string.
|
||||
public func beEmpty<S: SequenceType>() -> NonNilMatcherFunc<S> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be empty"
|
||||
let actualSeq = actualExpression.evaluate()
|
||||
if actualSeq == nil {
|
||||
return true
|
||||
}
|
||||
var generator = actualSeq!.generate()
|
||||
return generator.next() == nil
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when a value is "empty". For collections, this
|
||||
/// means the are no items in that collection. For strings, it is an empty string.
|
||||
public func beEmpty() -> NonNilMatcherFunc<NSString> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be empty"
|
||||
let actualString = actualExpression.evaluate()
|
||||
return actualString == nil || actualString!.length == 0
|
||||
}
|
||||
}
|
||||
|
||||
// Without specific overrides, beEmpty() is ambiguous for NSDictionary, NSArray,
|
||||
// etc, since they conform to SequenceType as well as NMBCollection.
|
||||
|
||||
/// A Nimble matcher that succeeds when a value is "empty". For collections, this
|
||||
/// means the are no items in that collection. For strings, it is an empty string.
|
||||
public func beEmpty() -> NonNilMatcherFunc<NSDictionary> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be empty"
|
||||
let actualDictionary = actualExpression.evaluate()
|
||||
return actualDictionary == nil || actualDictionary!.count == 0
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when a value is "empty". For collections, this
|
||||
/// means the are no items in that collection. For strings, it is an empty string.
|
||||
public func beEmpty() -> NonNilMatcherFunc<NSArray> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be empty"
|
||||
let actualArray = actualExpression.evaluate()
|
||||
return actualArray == nil || actualArray!.count == 0
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when a value is "empty". For collections, this
|
||||
/// means the are no items in that collection. For strings, it is an empty string.
|
||||
public func beEmpty() -> NonNilMatcherFunc<NMBCollection> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be empty"
|
||||
let actual = actualExpression.evaluate()
|
||||
return actual == nil || actual!.count == 0
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beEmptyMatcher() -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
let actualValue = actualExpression.evaluate()
|
||||
failureMessage.postfixMessage = "be empty"
|
||||
if let value = actualValue as? NMBCollection {
|
||||
let expr = Expression(expression: ({ value as NMBCollection }), location: location)
|
||||
return beEmpty().matches(expr, failureMessage: failureMessage)
|
||||
} else if let value = actualValue as? NSString {
|
||||
let expr = Expression(expression: ({ value as String }), location: location)
|
||||
return beEmpty().matches(expr, failureMessage: failureMessage)
|
||||
} else if let actualValue = actualValue {
|
||||
failureMessage.postfixMessage = "be empty (only works for NSArrays, NSSets, NSDictionaries, NSHashTables, and NSStrings)"
|
||||
failureMessage.actualValue = "\(NSStringFromClass(actualValue.dynamicType)) type"
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import Foundation
|
||||
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is greater than the expected value.
|
||||
public func beGreaterThan<T: Comparable>(expectedValue: T?) -> NonNilMatcherFunc<T> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be greater than <\(stringify(expectedValue))>"
|
||||
return actualExpression.evaluate() > expectedValue
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is greater than the expected value.
|
||||
public func beGreaterThan(expectedValue: NMBComparable?) -> NonNilMatcherFunc<NMBComparable> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be greater than <\(stringify(expectedValue))>"
|
||||
let actualValue = actualExpression.evaluate()
|
||||
let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == NSComparisonResult.OrderedDescending
|
||||
return matches
|
||||
}
|
||||
}
|
||||
|
||||
public func ><T: Comparable>(lhs: Expectation<T>, rhs: T) {
|
||||
lhs.to(beGreaterThan(rhs))
|
||||
}
|
||||
|
||||
public func >(lhs: Expectation<NMBComparable>, rhs: NMBComparable?) {
|
||||
lhs.to(beGreaterThan(rhs))
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beGreaterThanMatcher(expected: NMBComparable?) -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
let expr = actualExpression.cast { $0 as? NMBComparable }
|
||||
return beGreaterThan(expected).matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
import Foundation
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is greater than
|
||||
/// or equal to the expected value.
|
||||
public func beGreaterThanOrEqualTo<T: Comparable>(expectedValue: T?) -> NonNilMatcherFunc<T> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be greater than or equal to <\(stringify(expectedValue))>"
|
||||
let actualValue = actualExpression.evaluate()
|
||||
return actualValue >= expectedValue
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is greater than
|
||||
/// or equal to the expected value.
|
||||
public func beGreaterThanOrEqualTo<T: NMBComparable>(expectedValue: T?) -> NonNilMatcherFunc<T> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be greater than or equal to <\(stringify(expectedValue))>"
|
||||
let actualValue = actualExpression.evaluate()
|
||||
let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) != NSComparisonResult.OrderedAscending
|
||||
return matches
|
||||
}
|
||||
}
|
||||
|
||||
public func >=<T: Comparable>(lhs: Expectation<T>, rhs: T) {
|
||||
lhs.to(beGreaterThanOrEqualTo(rhs))
|
||||
}
|
||||
|
||||
public func >=<T: NMBComparable>(lhs: Expectation<T>, rhs: T) {
|
||||
lhs.to(beGreaterThanOrEqualTo(rhs))
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beGreaterThanOrEqualToMatcher(expected: NMBComparable?) -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
let expr = actualExpression.cast { $0 as? NMBComparable }
|
||||
return beGreaterThanOrEqualTo(expected).matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
import Foundation
|
||||
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is the same instance
|
||||
/// as the expected instance.
|
||||
public func beIdenticalTo<T: AnyObject>(expected: T?) -> NonNilMatcherFunc<T> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
let actual = actualExpression.evaluate()
|
||||
failureMessage.actualValue = "\(identityAsString(actual))"
|
||||
failureMessage.postfixMessage = "be identical to \(identityAsString(expected))"
|
||||
return actual === expected && actual !== nil
|
||||
}
|
||||
}
|
||||
|
||||
public func ===<T: AnyObject>(lhs: Expectation<T>, rhs: T?) {
|
||||
lhs.to(beIdenticalTo(rhs))
|
||||
}
|
||||
public func !==<T: AnyObject>(lhs: Expectation<T>, rhs: T?) {
|
||||
lhs.toNot(beIdenticalTo(rhs))
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beIdenticalToMatcher(expected: NSObject?) -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
return beIdenticalTo(expected).matches(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
import Foundation
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is less than the expected value.
|
||||
public func beLessThan<T: Comparable>(expectedValue: T?) -> NonNilMatcherFunc<T> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be less than <\(stringify(expectedValue))>"
|
||||
return actualExpression.evaluate() < expectedValue
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is less than the expected value.
|
||||
public func beLessThan(expectedValue: NMBComparable?) -> NonNilMatcherFunc<NMBComparable> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be less than <\(stringify(expectedValue))>"
|
||||
let actualValue = actualExpression.evaluate()
|
||||
let matches = actualValue != nil && actualValue!.NMB_compare(expectedValue) == NSComparisonResult.OrderedAscending
|
||||
return matches
|
||||
}
|
||||
}
|
||||
|
||||
public func <<T: Comparable>(lhs: Expectation<T>, rhs: T) {
|
||||
lhs.to(beLessThan(rhs))
|
||||
}
|
||||
|
||||
public func <(lhs: Expectation<NMBComparable>, rhs: NMBComparable?) {
|
||||
lhs.to(beLessThan(rhs))
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beLessThanMatcher(expected: NMBComparable?) -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
let expr = actualExpression.cast { $0 as! NMBComparable? }
|
||||
return beLessThan(expected).matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import Foundation
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is less than
|
||||
/// or equal to the expected value.
|
||||
public func beLessThanOrEqualTo<T: Comparable>(expectedValue: T?) -> NonNilMatcherFunc<T> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be less than or equal to <\(stringify(expectedValue))>"
|
||||
return actualExpression.evaluate() <= expectedValue
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is less than
|
||||
/// or equal to the expected value.
|
||||
public func beLessThanOrEqualTo<T: NMBComparable>(expectedValue: T?) -> NonNilMatcherFunc<T> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be less than or equal to <\(stringify(expectedValue))>"
|
||||
let actualValue = actualExpression.evaluate()
|
||||
return actualValue != nil && actualValue!.NMB_compare(expectedValue) != NSComparisonResult.OrderedDescending
|
||||
}
|
||||
}
|
||||
|
||||
public func <=<T: Comparable>(lhs: Expectation<T>, rhs: T) {
|
||||
lhs.to(beLessThanOrEqualTo(rhs))
|
||||
}
|
||||
|
||||
public func <=<T: NMBComparable>(lhs: Expectation<T>, rhs: T) {
|
||||
lhs.to(beLessThanOrEqualTo(rhs))
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beLessThanOrEqualToMatcher(expected: NMBComparable?) -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil:false) { actualExpression, failureMessage, location in
|
||||
let expr = actualExpression.cast { $0 as? NMBComparable }
|
||||
return beLessThanOrEqualTo(expected).matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
import Foundation
|
||||
|
||||
internal func beBool(#expectedValue: BooleanType, #stringValue: String, #falseMatchesNil: Bool) -> MatcherFunc<BooleanType> {
|
||||
return MatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be \(stringValue)"
|
||||
let actual = actualExpression.evaluate()
|
||||
if expectedValue {
|
||||
return actual?.boolValue == expectedValue.boolValue
|
||||
} else if !falseMatchesNil {
|
||||
return actual != nil && actual!.boolValue != !expectedValue.boolValue
|
||||
} else {
|
||||
return actual?.boolValue != !expectedValue.boolValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: beTrue() / beFalse()
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is exactly true.
|
||||
/// This matcher will not match against nils.
|
||||
public func beTrue() -> NonNilMatcherFunc<Bool> {
|
||||
return basicMatcherWithFailureMessage(equal(true)) { failureMessage in
|
||||
failureMessage.postfixMessage = "be true"
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is exactly false.
|
||||
/// This matcher will not match against nils.
|
||||
public func beFalse() -> NonNilMatcherFunc<Bool> {
|
||||
return basicMatcherWithFailureMessage(equal(false)) { failureMessage in
|
||||
failureMessage.postfixMessage = "be false"
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: beTruthy() / beFalsy()
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is not logically false.
|
||||
public func beTruthy() -> MatcherFunc<BooleanType> {
|
||||
return beBool(expectedValue: true, stringValue: "truthy", falseMatchesNil: true)
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is logically false.
|
||||
/// This matcher will match against nils.
|
||||
public func beFalsy() -> MatcherFunc<BooleanType> {
|
||||
return beBool(expectedValue: false, stringValue: "falsy", falseMatchesNil: true)
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beTruthyMatcher() -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher { actualExpression, failureMessage, location in
|
||||
let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false as BooleanType? }
|
||||
return beTruthy().matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
public class func beFalsyMatcher() -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher { actualExpression, failureMessage, location in
|
||||
let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false as BooleanType? }
|
||||
return beFalsy().matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
public class func beTrueMatcher() -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher { actualExpression, failureMessage, location in
|
||||
let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false as Bool? }
|
||||
return beTrue().matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
public class func beFalseMatcher() -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
let expr = actualExpression.cast { ($0 as? NSNumber)?.boolValue ?? false as Bool? }
|
||||
return beFalse().matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
import Foundation
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is nil.
|
||||
public func beNil<T>() -> MatcherFunc<T> {
|
||||
return MatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "be nil"
|
||||
let actualValue = actualExpression.evaluate()
|
||||
return actualValue == nil
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beNilMatcher() -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher { actualExpression, failureMessage, location in
|
||||
return beNil().matches(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import Foundation
|
||||
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual sequence's first element
|
||||
/// is equal to the expected value.
|
||||
public func beginWith<S: SequenceType, T: Equatable where S.Generator.Element == T>(startingElement: T) -> NonNilMatcherFunc<S> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "begin with <\(startingElement)>"
|
||||
if let actualValue = actualExpression.evaluate() {
|
||||
var actualGenerator = actualValue.generate()
|
||||
return actualGenerator.next() == startingElement
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual collection's first element
|
||||
/// is equal to the expected object.
|
||||
public func beginWith(startingElement: AnyObject) -> NonNilMatcherFunc<NMBOrderedCollection> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "begin with <\(startingElement)>"
|
||||
let collection = actualExpression.evaluate()
|
||||
return collection != nil && collection!.indexOfObject(startingElement) == 0
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual string contains expected substring
|
||||
/// where the expected substring's location is zero.
|
||||
public func beginWith(startingSubstring: String) -> NonNilMatcherFunc<String> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "begin with <\(startingSubstring)>"
|
||||
if let actual = actualExpression.evaluate() {
|
||||
let range = actual.rangeOfString(startingSubstring)
|
||||
return range != nil && range!.startIndex == actual.startIndex
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func beginWithMatcher(expected: AnyObject) -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
let actual = actualExpression.evaluate()
|
||||
if let actualString = actual as? String {
|
||||
let expr = actualExpression.cast { $0 as? String }
|
||||
return beginWith(expected as! String).matches(expr, failureMessage: failureMessage)
|
||||
} else {
|
||||
let expr = actualExpression.cast { $0 as? NMBOrderedCollection }
|
||||
return beginWith(expected).matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
import Foundation
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual sequence contains the expected value.
|
||||
public func contain<S: SequenceType, T: Equatable where S.Generator.Element == T>(items: T...) -> NonNilMatcherFunc<S> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "contain <\(arrayAsString(items))>"
|
||||
if let actual = actualExpression.evaluate() {
|
||||
return all(items) {
|
||||
return contains(actual, $0)
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual string contains the expected substring.
|
||||
public func contain(substrings: String...) -> NonNilMatcherFunc<String> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "contain <\(arrayAsString(substrings))>"
|
||||
if let actual = actualExpression.evaluate() {
|
||||
return all(substrings) {
|
||||
let scanRange = Range(start: actual.startIndex, end: actual.endIndex)
|
||||
let range = actual.rangeOfString($0, options: nil, range: scanRange, locale: nil)
|
||||
return range != nil && !range!.isEmpty
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual string contains the expected substring.
|
||||
public func contain(substrings: NSString...) -> NonNilMatcherFunc<NSString> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "contain <\(arrayAsString(substrings))>"
|
||||
if let actual = actualExpression.evaluate() {
|
||||
return all(substrings) {
|
||||
return actual.containsString($0.description)
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual collection contains the expected object.
|
||||
public func contain(items: AnyObject?...) -> NonNilMatcherFunc<NMBContainer> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "contain <\(arrayAsString(items))>"
|
||||
let actual = actualExpression.evaluate()
|
||||
return all(items) { item in
|
||||
return actual != nil && actual!.containsObject(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func containMatcher(expected: NSObject?) -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
let actualValue = actualExpression.evaluate()
|
||||
if let value = actualValue as? NMBContainer {
|
||||
let expr = Expression(expression: ({ value as NMBContainer }), location: location)
|
||||
return contain(expected).matches(expr, failureMessage: failureMessage)
|
||||
} else if let value = actualValue as? NSString {
|
||||
let expr = Expression(expression: ({ value as String }), location: location)
|
||||
return contain(expected as! String).matches(expr, failureMessage: failureMessage)
|
||||
} else if actualValue != nil {
|
||||
failureMessage.postfixMessage = "contain <\(stringify(expected))> (only works for NSArrays, NSSets, NSHashTables, and NSStrings)"
|
||||
} else {
|
||||
failureMessage.postfixMessage = "contain <\(stringify(expected))>"
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
import Foundation
|
||||
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual sequence's last element
|
||||
/// is equal to the expected value.
|
||||
public func endWith<S: SequenceType, T: Equatable where S.Generator.Element == T>(endingElement: T) -> NonNilMatcherFunc<S> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "end with <\(endingElement)>"
|
||||
|
||||
if let actualValue = actualExpression.evaluate() {
|
||||
var actualGenerator = actualValue.generate()
|
||||
var lastItem: T?
|
||||
var item: T?
|
||||
do {
|
||||
lastItem = item
|
||||
item = actualGenerator.next()
|
||||
} while(item != nil)
|
||||
|
||||
return lastItem == endingElement
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual collection's last element
|
||||
/// is equal to the expected object.
|
||||
public func endWith(endingElement: AnyObject) -> NonNilMatcherFunc<NMBOrderedCollection> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "end with <\(endingElement)>"
|
||||
let collection = actualExpression.evaluate()
|
||||
return collection != nil && collection!.indexOfObject(endingElement) == collection!.count - 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual string contains the expected substring
|
||||
/// where the expected substring's location is the actual string's length minus the
|
||||
/// expected substring's length.
|
||||
public func endWith(endingSubstring: String) -> NonNilMatcherFunc<String> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "end with <\(endingSubstring)>"
|
||||
if let collection = actualExpression.evaluate() {
|
||||
let range = collection.rangeOfString(endingSubstring)
|
||||
return range != nil && range!.endIndex == collection.endIndex
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func endWithMatcher(expected: AnyObject) -> NMBObjCMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
let actual = actualExpression.evaluate()
|
||||
if let actualString = actual as? String {
|
||||
let expr = Expression(expression: ({ actualString }), location: location)
|
||||
return endWith(expected as! String).matches(expr, failureMessage: failureMessage)
|
||||
} else {
|
||||
let expr = Expression(expression: ({ actual as? NMBOrderedCollection }), location: location)
|
||||
return endWith(expected).matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,145 @@
|
|||
import Foundation
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is equal to the expected value.
|
||||
/// Values can support equal by supporting the Equatable protocol.
|
||||
///
|
||||
/// @see beCloseTo if you want to match imprecise types (eg - floats, doubles).
|
||||
public func equal<T: Equatable>(expectedValue: T?) -> NonNilMatcherFunc<T> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "equal <\(stringify(expectedValue))>"
|
||||
let matches = actualExpression.evaluate() == expectedValue && expectedValue != nil
|
||||
if expectedValue == nil || actualExpression.evaluate() == nil {
|
||||
if expectedValue == nil {
|
||||
failureMessage.postfixActual = " (use beNil() to match nils)"
|
||||
}
|
||||
return false
|
||||
}
|
||||
return matches
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual value is equal to the expected value.
|
||||
/// Values can support equal by supporting the Equatable protocol.
|
||||
///
|
||||
/// @see beCloseTo if you want to match imprecise types (eg - floats, doubles).
|
||||
public func equal<T: Equatable, C: Equatable>(expectedValue: [T: C]?) -> NonNilMatcherFunc<[T: C]> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "equal <\(stringify(expectedValue))>"
|
||||
if expectedValue == nil || actualExpression.evaluate() == nil {
|
||||
if expectedValue == nil {
|
||||
failureMessage.postfixActual = " (use beNil() to match nils)"
|
||||
}
|
||||
return false
|
||||
}
|
||||
return expectedValue! == actualExpression.evaluate()!
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual collection is equal to the expected collection.
|
||||
/// Items must implement the Equatable protocol.
|
||||
public func equal<T: Equatable>(expectedValue: [T]?) -> NonNilMatcherFunc<[T]> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "equal <\(stringify(expectedValue))>"
|
||||
if expectedValue == nil || actualExpression.evaluate() == nil {
|
||||
if expectedValue == nil {
|
||||
failureMessage.postfixActual = " (use beNil() to match nils)"
|
||||
}
|
||||
return false
|
||||
}
|
||||
return expectedValue! == actualExpression.evaluate()!
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual set is equal to the expected set.
|
||||
public func equal<T>(expectedValue: Set<T>?) -> NonNilMatcherFunc<Set<T>> {
|
||||
return equal(expectedValue, stringify: stringify)
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual set is equal to the expected set.
|
||||
public func equal<T: Comparable>(expectedValue: Set<T>?) -> NonNilMatcherFunc<Set<T>> {
|
||||
return equal(expectedValue, stringify: {
|
||||
if let set = $0 {
|
||||
return stringify(Array(set).sorted { $0 < $1 })
|
||||
} else {
|
||||
return "nil"
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private func equal<T>(expectedValue: Set<T>?, #stringify: Set<T>? -> String) -> NonNilMatcherFunc<Set<T>> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "equal <\(stringify(expectedValue))>"
|
||||
|
||||
if let expectedValue = expectedValue {
|
||||
if let actualValue = actualExpression.evaluate() {
|
||||
failureMessage.actualValue = "<\(stringify(actualValue))>"
|
||||
|
||||
if expectedValue == actualValue {
|
||||
return true
|
||||
}
|
||||
|
||||
let missing = expectedValue.subtract(actualValue)
|
||||
if missing.count > 0 {
|
||||
failureMessage.postfixActual += ", missing <\(stringify(missing))>"
|
||||
}
|
||||
|
||||
let extra = actualValue.subtract(expectedValue)
|
||||
if extra.count > 0 {
|
||||
failureMessage.postfixActual += ", extra <\(stringify(extra))>"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
failureMessage.postfixActual = " (use beNil() to match nils)"
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
public func ==<T: Equatable>(lhs: Expectation<T>, rhs: T?) {
|
||||
lhs.to(equal(rhs))
|
||||
}
|
||||
|
||||
public func !=<T: Equatable>(lhs: Expectation<T>, rhs: T?) {
|
||||
lhs.toNot(equal(rhs))
|
||||
}
|
||||
|
||||
public func ==<T: Equatable>(lhs: Expectation<[T]>, rhs: [T]?) {
|
||||
lhs.to(equal(rhs))
|
||||
}
|
||||
|
||||
public func !=<T: Equatable>(lhs: Expectation<[T]>, rhs: [T]?) {
|
||||
lhs.toNot(equal(rhs))
|
||||
}
|
||||
|
||||
public func ==<T>(lhs: Expectation<Set<T>>, rhs: Set<T>?) {
|
||||
lhs.to(equal(rhs))
|
||||
}
|
||||
|
||||
public func !=<T>(lhs: Expectation<Set<T>>, rhs: Set<T>?) {
|
||||
lhs.toNot(equal(rhs))
|
||||
}
|
||||
|
||||
public func ==<T: Comparable>(lhs: Expectation<Set<T>>, rhs: Set<T>?) {
|
||||
lhs.to(equal(rhs))
|
||||
}
|
||||
|
||||
public func !=<T: Comparable>(lhs: Expectation<Set<T>>, rhs: Set<T>?) {
|
||||
lhs.toNot(equal(rhs))
|
||||
}
|
||||
|
||||
public func ==<T: Equatable, C: Equatable>(lhs: Expectation<[T: C]>, rhs: [T: C]?) {
|
||||
lhs.to(equal(rhs))
|
||||
}
|
||||
|
||||
public func !=<T: Equatable, C: Equatable>(lhs: Expectation<[T: C]>, rhs: [T: C]?) {
|
||||
lhs.toNot(equal(rhs))
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func equalMatcher(expected: NSObject) -> NMBMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
return equal(expected).matches(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import Foundation
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual string satisfies the regular expression
|
||||
/// described by the expected string.
|
||||
public func match(expectedValue: String?) -> NonNilMatcherFunc<String> {
|
||||
return NonNilMatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.postfixMessage = "match <\(stringify(expectedValue))>"
|
||||
|
||||
if let actual = actualExpression.evaluate() {
|
||||
if let regexp = expectedValue {
|
||||
return actual.rangeOfString(regexp, options: .RegularExpressionSearch) != nil
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func matchMatcher(expected: NSString) -> NMBMatcher {
|
||||
return NMBObjCMatcher(canMatchNil: false) { actualExpression, failureMessage, location in
|
||||
let actual = actualExpression.cast { $0 as? String }
|
||||
return match(expected.description).matches(actual, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
import Foundation
|
||||
|
||||
|
||||
/// Implement this protocol if you want full control over to() and toNot() behaviors
|
||||
/// when matching a value.
|
||||
public protocol Matcher {
|
||||
typealias ValueType
|
||||
func matches(actualExpression: Expression<ValueType>, failureMessage: FailureMessage) -> Bool
|
||||
func doesNotMatch(actualExpression: Expression<ValueType>, failureMessage: FailureMessage) -> Bool
|
||||
}
|
||||
|
||||
/// Implement this protocol if you just want a simplier matcher. The negation
|
||||
/// is provided for you automatically.
|
||||
///
|
||||
/// If you just want a very simplified usage of BasicMatcher,
|
||||
/// @see MatcherFunc.
|
||||
public protocol BasicMatcher {
|
||||
typealias ValueType
|
||||
func matches(actualExpression: Expression<ValueType>, failureMessage: FailureMessage) -> Bool
|
||||
}
|
||||
|
||||
|
||||
/// Implement this protocol if you want a matcher only work for non-nil values.
|
||||
/// The matcher still needs to properly handle nil values, but using this type will
|
||||
/// tell Nimble to automatically postfix a nil match error (and automatically fail the match).
|
||||
///
|
||||
/// Unlike a naive implementation of the matches interface, NonNilBasicMatcher will also
|
||||
/// fail for the negation to a nil:
|
||||
///
|
||||
/// // objc
|
||||
/// expect(nil).to(matchWithMyCustomNonNilBasicMatcher()) // => fails
|
||||
/// expect(nil).toNot(matchWithMyCustomNonNilBasicMatcher()) // => fails
|
||||
///
|
||||
/// @see BasicMatcher
|
||||
public protocol NonNilBasicMatcher {
|
||||
typealias ValueType
|
||||
func matches(actualExpression: Expression<ValueType>, failureMessage: FailureMessage) -> Bool
|
||||
}
|
||||
|
||||
/// Objective-C interface to the Swift variant of Matcher. This gives you full control over
|
||||
/// to() and toNot() behaviors when matching a value.
|
||||
@objc public protocol NMBMatcher {
|
||||
func matches(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool
|
||||
func doesNotMatch(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool
|
||||
}
|
||||
|
||||
/// Protocol for types that support contain() matcher.
|
||||
@objc public protocol NMBContainer {
|
||||
func containsObject(object: AnyObject!) -> Bool
|
||||
}
|
||||
extension NSArray : NMBContainer {}
|
||||
extension NSSet : NMBContainer {}
|
||||
extension NSHashTable : NMBContainer {}
|
||||
|
||||
/// Protocol for types that support only beEmpty()
|
||||
@objc public protocol NMBCollection {
|
||||
var count: Int { get }
|
||||
}
|
||||
extension NSSet : NMBCollection {}
|
||||
extension NSDictionary : NMBCollection {}
|
||||
extension NSHashTable : NMBCollection {}
|
||||
|
||||
/// Protocol for types that support beginWith(), endWith(), beEmpty() matchers
|
||||
@objc public protocol NMBOrderedCollection : NMBCollection {
|
||||
func indexOfObject(object: AnyObject!) -> Int
|
||||
}
|
||||
extension NSArray : NMBOrderedCollection {}
|
||||
|
||||
/// Protocol for types to support beCloseTo() matcher
|
||||
@objc public protocol NMBDoubleConvertible {
|
||||
var doubleValue: CDouble { get }
|
||||
}
|
||||
extension NSNumber : NMBDoubleConvertible { }
|
||||
extension NSDecimalNumber : NMBDoubleConvertible { } // TODO: not the best to downsize
|
||||
|
||||
/// Protocol for types to support beLessThan(), beLessThanOrEqualTo(),
|
||||
/// beGreaterThan(), beGreaterThanOrEqualTo(), and equal() matchers.
|
||||
///
|
||||
/// Types that conform to Swift's Comparable protocol will work implicitly too
|
||||
@objc public protocol NMBComparable {
|
||||
func NMB_compare(otherObject: NMBComparable!) -> NSComparisonResult
|
||||
}
|
||||
extension NSNumber : NMBComparable {
|
||||
public func NMB_compare(otherObject: NMBComparable!) -> NSComparisonResult {
|
||||
return compare(otherObject as! NSNumber)
|
||||
}
|
||||
}
|
||||
extension NSString : NMBComparable {
|
||||
public func NMB_compare(otherObject: NMBComparable!) -> NSComparisonResult {
|
||||
return compare(otherObject as! String)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,236 @@
|
|||
import Foundation
|
||||
|
||||
internal struct RaiseExceptionMatchResult {
|
||||
var success: Bool
|
||||
var nameFailureMessage: FailureMessage?
|
||||
var reasonFailureMessage: FailureMessage?
|
||||
var userInfoFailureMessage: FailureMessage?
|
||||
}
|
||||
|
||||
internal func raiseExceptionMatcher(matches: (NSException?, SourceLocation) -> RaiseExceptionMatchResult) -> MatcherFunc<Any> {
|
||||
return MatcherFunc { actualExpression, failureMessage in
|
||||
failureMessage.actualValue = nil
|
||||
|
||||
var exception: NSException?
|
||||
var capture = NMBExceptionCapture(handler: ({ e in
|
||||
exception = e
|
||||
}), finally: nil)
|
||||
|
||||
capture.tryBlock {
|
||||
actualExpression.evaluate()
|
||||
return
|
||||
}
|
||||
|
||||
let result = matches(exception, actualExpression.location)
|
||||
|
||||
failureMessage.postfixMessage = "raise exception"
|
||||
|
||||
if let nameFailureMessage = result.nameFailureMessage {
|
||||
failureMessage.postfixMessage += " with name \(nameFailureMessage.postfixMessage)"
|
||||
}
|
||||
if let reasonFailureMessage = result.reasonFailureMessage {
|
||||
failureMessage.postfixMessage += " with reason \(reasonFailureMessage.postfixMessage)"
|
||||
}
|
||||
if let userInfoFailureMessage = result.userInfoFailureMessage {
|
||||
failureMessage.postfixMessage += " with userInfo \(userInfoFailureMessage.postfixMessage)"
|
||||
}
|
||||
if result.nameFailureMessage == nil && result.reasonFailureMessage == nil
|
||||
&& result.userInfoFailureMessage == nil {
|
||||
failureMessage.postfixMessage = "raise any exception"
|
||||
}
|
||||
|
||||
return result.success
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// A Nimble matcher that succeeds when the actual expression raises an exception, which name,
|
||||
// reason and userInfo match successfully with the provided matchers
|
||||
public func raiseException(
|
||||
named: NonNilMatcherFunc<String>? = nil,
|
||||
reason: NonNilMatcherFunc<String>? = nil,
|
||||
userInfo: NonNilMatcherFunc<NSDictionary>? = nil) -> MatcherFunc<Any> {
|
||||
return raiseExceptionMatcher() { exception, location in
|
||||
|
||||
var matches = exception != nil
|
||||
|
||||
var nameFailureMessage: FailureMessage?
|
||||
if let nameMatcher = named {
|
||||
let wrapper = NonNilMatcherWrapper(NonNilBasicMatcherWrapper(nameMatcher))
|
||||
nameFailureMessage = FailureMessage()
|
||||
matches = wrapper.matches(
|
||||
Expression(expression: { exception?.name },
|
||||
location: location,
|
||||
isClosure: false),
|
||||
failureMessage: nameFailureMessage!) && matches
|
||||
}
|
||||
|
||||
var reasonFailureMessage: FailureMessage?
|
||||
if let reasonMatcher = reason {
|
||||
let wrapper = NonNilMatcherWrapper(NonNilBasicMatcherWrapper(reasonMatcher))
|
||||
reasonFailureMessage = FailureMessage()
|
||||
matches = wrapper.matches(
|
||||
Expression(expression: { exception?.reason },
|
||||
location: location,
|
||||
isClosure: false),
|
||||
failureMessage: reasonFailureMessage!) && matches
|
||||
}
|
||||
|
||||
var userInfoFailureMessage: FailureMessage?
|
||||
if let userInfoMatcher = userInfo {
|
||||
let wrapper = NonNilMatcherWrapper(NonNilBasicMatcherWrapper(userInfoMatcher))
|
||||
userInfoFailureMessage = FailureMessage()
|
||||
matches = wrapper.matches(
|
||||
Expression(expression: { exception?.userInfo },
|
||||
location: location,
|
||||
isClosure: false),
|
||||
failureMessage: userInfoFailureMessage!) && matches
|
||||
}
|
||||
|
||||
return RaiseExceptionMatchResult(
|
||||
success: matches,
|
||||
nameFailureMessage: nameFailureMessage,
|
||||
reasonFailureMessage: reasonFailureMessage,
|
||||
userInfoFailureMessage: userInfoFailureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual expression raises an exception with
|
||||
/// the specified name, reason, and userInfo.
|
||||
public func raiseException(#named: String, #reason: String, #userInfo: NSDictionary) -> MatcherFunc<Any> {
|
||||
return raiseException(named: equal(named), reason: equal(reason), userInfo: equal(userInfo))
|
||||
}
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual expression raises an exception with
|
||||
/// the specified name and reason.
|
||||
public func raiseException(#named: String, #reason: String) -> MatcherFunc<Any> {
|
||||
return raiseException(named: equal(named), reason: equal(reason))
|
||||
}
|
||||
|
||||
|
||||
/// A Nimble matcher that succeeds when the actual expression raises an exception with
|
||||
/// the specified name.
|
||||
public func raiseException(#named: String) -> MatcherFunc<Any> {
|
||||
return raiseException(named: equal(named))
|
||||
}
|
||||
|
||||
@objc public class NMBObjCRaiseExceptionMatcher : NMBMatcher {
|
||||
var _name: String?
|
||||
var _reason: String?
|
||||
var _userInfo: NSDictionary?
|
||||
var _nameMatcher: NMBMatcher?
|
||||
var _reasonMatcher: NMBMatcher?
|
||||
var _userInfoMatcher: NMBMatcher?
|
||||
|
||||
init(name: String?, reason: String?, userInfo: NSDictionary?) {
|
||||
_name = name
|
||||
_reason = reason
|
||||
_userInfo = userInfo
|
||||
}
|
||||
|
||||
init(nameMatcher: NMBMatcher?, reasonMatcher: NMBMatcher?, userInfoMatcher: NMBMatcher?) {
|
||||
_nameMatcher = nameMatcher
|
||||
_reasonMatcher = reasonMatcher
|
||||
_userInfoMatcher = userInfoMatcher
|
||||
}
|
||||
|
||||
public func matches(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
|
||||
let block: () -> Any? = ({ actualBlock(); return nil })
|
||||
let expr = Expression(expression: block, location: location)
|
||||
if _nameMatcher != nil || _reasonMatcher != nil || _userInfoMatcher != nil {
|
||||
return raiseExceptionMatcher() {
|
||||
exception, location in
|
||||
|
||||
var matches = exception != nil
|
||||
|
||||
var nameFailureMessage: FailureMessage?
|
||||
if let nameMatcher = self._nameMatcher {
|
||||
nameFailureMessage = FailureMessage()
|
||||
matches = nameMatcher.matches({ exception?.name },
|
||||
failureMessage: nameFailureMessage!,
|
||||
location: location) && matches
|
||||
}
|
||||
|
||||
var reasonFailureMessage: FailureMessage?
|
||||
if let reasonMatcher = self._reasonMatcher {
|
||||
reasonFailureMessage = FailureMessage()
|
||||
matches = reasonMatcher.matches({ exception?.reason },
|
||||
failureMessage: reasonFailureMessage!,
|
||||
location: location) && matches
|
||||
}
|
||||
|
||||
var userInfoFailureMessage: FailureMessage?
|
||||
if let userInfoMatcher = self._userInfoMatcher {
|
||||
userInfoFailureMessage = FailureMessage()
|
||||
matches = userInfoMatcher.matches({ exception?.userInfo },
|
||||
failureMessage: userInfoFailureMessage!,
|
||||
location: location) && matches
|
||||
}
|
||||
|
||||
return RaiseExceptionMatchResult(
|
||||
success: matches,
|
||||
nameFailureMessage: nameFailureMessage,
|
||||
reasonFailureMessage: reasonFailureMessage,
|
||||
userInfoFailureMessage: userInfoFailureMessage)
|
||||
|
||||
}.matches(expr, failureMessage: failureMessage)
|
||||
} else if let name = _name, reason = _reason, userInfo = _userInfo {
|
||||
return raiseException(named: name, reason: reason, userInfo: userInfo).matches(expr, failureMessage: failureMessage)
|
||||
} else if let name = _name, reason = _reason {
|
||||
return raiseException(named: name, reason: reason).matches(expr, failureMessage: failureMessage)
|
||||
} else if let name = _name {
|
||||
return raiseException(named: name).matches(expr, failureMessage: failureMessage)
|
||||
} else {
|
||||
return raiseException().matches(expr, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
public func doesNotMatch(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
|
||||
return !matches(actualBlock, failureMessage: failureMessage, location: location)
|
||||
}
|
||||
|
||||
public var named: (name: String) -> NMBObjCRaiseExceptionMatcher {
|
||||
return ({ name in
|
||||
return NMBObjCRaiseExceptionMatcher(name: name, reason: self._reason, userInfo: self._userInfo)
|
||||
})
|
||||
}
|
||||
|
||||
public var reason: (reason: String?) -> NMBObjCRaiseExceptionMatcher {
|
||||
return ({ reason in
|
||||
return NMBObjCRaiseExceptionMatcher(name: self._name, reason: reason, userInfo: self._userInfo)
|
||||
})
|
||||
}
|
||||
|
||||
public var userInfo: (userInfo: NSDictionary?) -> NMBObjCRaiseExceptionMatcher {
|
||||
return ({ userInfo in
|
||||
return NMBObjCRaiseExceptionMatcher(name: self._name, reason: self._reason, userInfo: userInfo)
|
||||
})
|
||||
}
|
||||
|
||||
public var withName: (nameMatcher: NMBMatcher) -> NMBObjCRaiseExceptionMatcher {
|
||||
return ({ nameMatcher in
|
||||
return NMBObjCRaiseExceptionMatcher(nameMatcher: nameMatcher,
|
||||
reasonMatcher: self._reasonMatcher, userInfoMatcher: self._userInfoMatcher)
|
||||
})
|
||||
}
|
||||
|
||||
public var withReason: (reasonMatcher: NMBMatcher) -> NMBObjCRaiseExceptionMatcher {
|
||||
return ({ reasonMatcher in
|
||||
return NMBObjCRaiseExceptionMatcher(nameMatcher: self._nameMatcher,
|
||||
reasonMatcher: reasonMatcher, userInfoMatcher: self._userInfoMatcher)
|
||||
})
|
||||
}
|
||||
|
||||
public var withUserInfo: (userInfoMatcher: NMBMatcher) -> NMBObjCRaiseExceptionMatcher {
|
||||
return ({ userInfoMatcher in
|
||||
return NMBObjCRaiseExceptionMatcher(nameMatcher: self._nameMatcher,
|
||||
reasonMatcher: self._reasonMatcher, userInfoMatcher: userInfoMatcher)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
extension NMBObjCMatcher {
|
||||
public class func raiseExceptionMatcher() -> NMBObjCRaiseExceptionMatcher {
|
||||
return NMBObjCRaiseExceptionMatcher(name: nil, reason: nil, userInfo: nil)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import <Nimble/NMBExceptionCapture.h>
|
||||
#import <Nimble/DSL.h>
|
||||
|
||||
FOUNDATION_EXPORT double NimbleVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import Foundation
|
||||
|
||||
internal func all<T>(array: [T], fn: (T) -> Bool) -> Bool {
|
||||
for item in array {
|
||||
if !fn(item) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
import Foundation
|
||||
|
||||
internal enum PollResult : BooleanType {
|
||||
case Success, Failure, Timeout
|
||||
|
||||
var boolValue : Bool {
|
||||
return self == .Success
|
||||
}
|
||||
}
|
||||
|
||||
internal class RunPromise {
|
||||
var token: dispatch_once_t = 0
|
||||
var didFinish = false
|
||||
var didFail = false
|
||||
|
||||
init() {}
|
||||
|
||||
func succeed() {
|
||||
dispatch_once(&self.token) {
|
||||
self.didFinish = false
|
||||
}
|
||||
}
|
||||
|
||||
func fail(block: () -> Void) {
|
||||
dispatch_once(&self.token) {
|
||||
self.didFail = true
|
||||
block()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal func stopRunLoop(runLoop: NSRunLoop, delay: NSTimeInterval) -> RunPromise {
|
||||
var promise = RunPromise()
|
||||
var killQueue = dispatch_queue_create("nimble.waitUntil.queue", DISPATCH_QUEUE_SERIAL)
|
||||
let killTimeOffset = Int64(CDouble(delay) * CDouble(NSEC_PER_SEC))
|
||||
let killTime = dispatch_time(DISPATCH_TIME_NOW, killTimeOffset)
|
||||
dispatch_after(killTime, killQueue) {
|
||||
promise.fail {
|
||||
CFRunLoopStop(runLoop.getCFRunLoop())
|
||||
}
|
||||
}
|
||||
return promise
|
||||
}
|
||||
|
||||
internal func pollBlock(#pollInterval: NSTimeInterval, #timeoutInterval: NSTimeInterval, expression: () -> Bool) -> PollResult {
|
||||
let runLoop = NSRunLoop.mainRunLoop()
|
||||
|
||||
var promise = stopRunLoop(runLoop, min(timeoutInterval, 0.2))
|
||||
|
||||
let startDate = NSDate()
|
||||
|
||||
// trigger run loop to make sure enqueued tasks don't block our assertion polling
|
||||
// the stop run loop task above will abort us if necessary
|
||||
runLoop.runUntilDate(startDate)
|
||||
promise.succeed()
|
||||
|
||||
if promise.didFail {
|
||||
return .Timeout
|
||||
}
|
||||
|
||||
var pass: Bool = false
|
||||
do {
|
||||
pass = expression()
|
||||
if pass {
|
||||
break
|
||||
}
|
||||
|
||||
let runDate = NSDate().dateByAddingTimeInterval(pollInterval) as NSDate
|
||||
runLoop.runUntilDate(runDate)
|
||||
} while(NSDate().timeIntervalSinceDate(startDate) < timeoutInterval);
|
||||
|
||||
return pass ? .Success : .Failure
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import Foundation
|
||||
|
||||
|
||||
@objc public class SourceLocation : Printable {
|
||||
public let file: String
|
||||
public let line: UInt
|
||||
|
||||
init() {
|
||||
file = "Unknown File"
|
||||
line = 0
|
||||
}
|
||||
|
||||
init(file: String, line: UInt) {
|
||||
self.file = file
|
||||
self.line = line
|
||||
}
|
||||
|
||||
public var description: String {
|
||||
return "\(file):\(line)"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
import Foundation
|
||||
|
||||
|
||||
internal func identityAsString(value: AnyObject?) -> String {
|
||||
if value == nil {
|
||||
return "nil"
|
||||
}
|
||||
return NSString(format: "<%p>", unsafeBitCast(value!, Int.self)).description
|
||||
}
|
||||
|
||||
internal func arrayAsString<T>(items: [T], joiner: String = ", ") -> String {
|
||||
return items.reduce("") { accum, item in
|
||||
let prefix = (accum.isEmpty ? "" : joiner)
|
||||
return accum + prefix + "\(stringify(item))"
|
||||
}
|
||||
}
|
||||
|
||||
@objc protocol NMBStringer {
|
||||
func NMB_stringify() -> String
|
||||
}
|
||||
|
||||
internal func stringify<S: SequenceType>(value: S) -> String {
|
||||
var generator = value.generate()
|
||||
var strings = [String]()
|
||||
var value: S.Generator.Element?
|
||||
do {
|
||||
value = generator.next()
|
||||
if value != nil {
|
||||
strings.append(stringify(value))
|
||||
}
|
||||
} while value != nil
|
||||
let str = ", ".join(strings)
|
||||
return "[\(str)]"
|
||||
}
|
||||
|
||||
extension NSArray : NMBStringer {
|
||||
func NMB_stringify() -> String {
|
||||
let str = self.componentsJoinedByString(", ")
|
||||
return "[\(str)]"
|
||||
}
|
||||
}
|
||||
|
||||
internal func stringify<T>(value: T) -> String {
|
||||
if let value = value as? Double {
|
||||
return NSString(format: "%.4f", (value)).description
|
||||
}
|
||||
return toString(value)
|
||||
}
|
||||
|
||||
internal func stringify<T>(value: T?) -> String {
|
||||
if let unboxed = value {
|
||||
return stringify(unboxed)
|
||||
}
|
||||
return "nil"
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
import Foundation
|
||||
|
||||
struct AsyncMatcherWrapper<T, U where U: Matcher, U.ValueType == T>: Matcher {
|
||||
let fullMatcher: U
|
||||
let timeoutInterval: NSTimeInterval
|
||||
let pollInterval: NSTimeInterval
|
||||
|
||||
init(fullMatcher: U, timeoutInterval: NSTimeInterval = 1, pollInterval: NSTimeInterval = 0.01) {
|
||||
self.fullMatcher = fullMatcher
|
||||
self.timeoutInterval = timeoutInterval
|
||||
self.pollInterval = pollInterval
|
||||
}
|
||||
|
||||
func matches(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
let uncachedExpression = actualExpression.withoutCaching()
|
||||
let result = pollBlock(pollInterval: pollInterval, timeoutInterval: timeoutInterval) {
|
||||
self.fullMatcher.matches(uncachedExpression, failureMessage: failureMessage)
|
||||
}
|
||||
switch (result) {
|
||||
case .Success: return true
|
||||
case .Failure: return false
|
||||
case .Timeout:
|
||||
failureMessage.postfixMessage += " (Stall on main thread)."
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func doesNotMatch(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
let uncachedExpression = actualExpression.withoutCaching()
|
||||
let result = pollBlock(pollInterval: pollInterval, timeoutInterval: timeoutInterval) {
|
||||
self.fullMatcher.doesNotMatch(uncachedExpression, failureMessage: failureMessage)
|
||||
}
|
||||
switch (result) {
|
||||
case .Success: return true
|
||||
case .Failure: return false
|
||||
case .Timeout:
|
||||
failureMessage.postfixMessage += " (Stall on main thread)."
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private let toEventuallyRequiresClosureError = "expect(...).toEventually(...) requires an explicit closure (eg - expect { ... }.toEventually(...) )\nSwift 1.2 @autoclosure behavior has changed in an incompatible way for Nimble to function"
|
||||
|
||||
|
||||
extension Expectation {
|
||||
public func toEventually<U where U: Matcher, U.ValueType == T>(matcher: U, timeout: NSTimeInterval = 1, pollInterval: NSTimeInterval = 0.01) {
|
||||
if expression.isClosure {
|
||||
to(AsyncMatcherWrapper(
|
||||
fullMatcher: FullMatcherWrapper(
|
||||
matcher: matcher,
|
||||
to: "to eventually",
|
||||
toNot: "to eventually not"),
|
||||
timeoutInterval: timeout,
|
||||
pollInterval: pollInterval))
|
||||
} else {
|
||||
verify(false, toEventuallyRequiresClosureError)
|
||||
}
|
||||
}
|
||||
|
||||
public func toEventuallyNot<U where U: Matcher, U.ValueType == T>(matcher: U, timeout: NSTimeInterval = 1, pollInterval: NSTimeInterval = 0.01) {
|
||||
if expression.isClosure {
|
||||
toNot(AsyncMatcherWrapper(
|
||||
fullMatcher: FullMatcherWrapper(
|
||||
matcher: matcher,
|
||||
to: "to eventually",
|
||||
toNot: "to eventually not"),
|
||||
timeoutInterval: timeout,
|
||||
pollInterval: pollInterval))
|
||||
} else {
|
||||
verify(false, toEventuallyRequiresClosureError)
|
||||
}
|
||||
}
|
||||
|
||||
public func toEventually<U where U: BasicMatcher, U.ValueType == T>(matcher: U, timeout: NSTimeInterval = 1, pollInterval: NSTimeInterval = 0.01) {
|
||||
toEventually(
|
||||
FullMatcherWrapper(
|
||||
matcher: BasicMatcherWrapper(matcher: matcher),
|
||||
to: "to eventually",
|
||||
toNot: "to eventually not"),
|
||||
timeout: timeout,
|
||||
pollInterval: pollInterval)
|
||||
}
|
||||
|
||||
public func toEventuallyNot<U where U: BasicMatcher, U.ValueType == T>(matcher: U, timeout: NSTimeInterval = 1, pollInterval: NSTimeInterval = 0.01) {
|
||||
toEventuallyNot(
|
||||
FullMatcherWrapper(
|
||||
matcher: BasicMatcherWrapper(matcher: matcher),
|
||||
to: "to eventually",
|
||||
toNot: "to eventually not"),
|
||||
timeout: timeout,
|
||||
pollInterval: pollInterval)
|
||||
}
|
||||
|
||||
public func toEventually<U where U: NonNilBasicMatcher, U.ValueType == T>(matcher: U, timeout: NSTimeInterval = 1, pollInterval: NSTimeInterval = 0.1) {
|
||||
toEventually(
|
||||
FullMatcherWrapper(
|
||||
matcher: NonNilMatcherWrapper(NonNilBasicMatcherWrapper(matcher)),
|
||||
to: "to eventually",
|
||||
toNot: "to eventually not"),
|
||||
timeout: timeout,
|
||||
pollInterval: pollInterval)
|
||||
}
|
||||
|
||||
public func toEventuallyNot<U where U: NonNilBasicMatcher, U.ValueType == T>(matcher: U, timeout: NSTimeInterval = 1, pollInterval: NSTimeInterval = 0.1) {
|
||||
toEventuallyNot(
|
||||
FullMatcherWrapper(
|
||||
matcher: NonNilMatcherWrapper(NonNilBasicMatcherWrapper(matcher)),
|
||||
to: "to eventually",
|
||||
toNot: "to eventually not"),
|
||||
timeout: timeout,
|
||||
pollInterval: pollInterval)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
import Foundation
|
||||
|
||||
|
||||
struct BasicMatcherWrapper<M, T where M: BasicMatcher, M.ValueType == T>: Matcher {
|
||||
let matcher: M
|
||||
|
||||
func matches(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
return matcher.matches(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
|
||||
func doesNotMatch(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
return !matcher.matches(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
extension Expectation {
|
||||
public func to<U where U: BasicMatcher, U.ValueType == T>(matcher: U) {
|
||||
to(FullMatcherWrapper(matcher: BasicMatcherWrapper(matcher: matcher), to: "to", toNot: "to not"))
|
||||
}
|
||||
|
||||
public func toNot<U where U: BasicMatcher, U.ValueType == T>(matcher: U) {
|
||||
toNot(FullMatcherWrapper(matcher: BasicMatcherWrapper(matcher: matcher), to: "to", toNot: "to not"))
|
||||
}
|
||||
|
||||
public func notTo<U where U: BasicMatcher, U.ValueType == T>(matcher: U) {
|
||||
toNot(matcher)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
import Foundation
|
||||
|
||||
|
||||
struct FullMatcherWrapper<M, T where M: Matcher, M.ValueType == T>: Matcher {
|
||||
let matcher: M
|
||||
let to: String
|
||||
let toNot: String
|
||||
|
||||
func matches(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
failureMessage.to = to
|
||||
return matcher.matches(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
|
||||
func doesNotMatch(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
failureMessage.to = toNot
|
||||
return matcher.doesNotMatch(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
import Foundation
|
||||
|
||||
public struct FullMatcherFunc<T>: Matcher {
|
||||
public let matcher: (Expression<T>, FailureMessage, Bool) -> Bool
|
||||
|
||||
public init(_ matcher: (Expression<T>, FailureMessage, Bool) -> Bool) {
|
||||
self.matcher = matcher
|
||||
}
|
||||
|
||||
public func matches(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
return matcher(actualExpression, failureMessage, false)
|
||||
}
|
||||
|
||||
public func doesNotMatch(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
return !matcher(actualExpression, failureMessage, true)
|
||||
}
|
||||
}
|
||||
|
||||
public struct MatcherFunc<T>: BasicMatcher {
|
||||
public let matcher: (Expression<T>, FailureMessage) -> Bool
|
||||
|
||||
public init(_ matcher: (Expression<T>, FailureMessage) -> Bool) {
|
||||
self.matcher = matcher
|
||||
}
|
||||
|
||||
public func matches(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
return matcher(actualExpression, failureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
public struct NonNilMatcherFunc<T>: NonNilBasicMatcher {
|
||||
public let matcher: (Expression<T>, FailureMessage) -> Bool
|
||||
|
||||
public init(_ matcher: (Expression<T>, FailureMessage) -> Bool) {
|
||||
self.matcher = matcher
|
||||
}
|
||||
|
||||
public func matches(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
return matcher(actualExpression, failureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
public func fullMatcherFromBasicMatcher<M: BasicMatcher>(matcher: M) -> FullMatcherFunc<M.ValueType> {
|
||||
return FullMatcherFunc { actualExpression, failureMessage, expectingToNotMatch in
|
||||
return matcher.matches(actualExpression, failureMessage: failureMessage) != expectingToNotMatch
|
||||
}
|
||||
}
|
||||
|
||||
public func basicMatcherWithFailureMessage<M: NonNilBasicMatcher>(matcher: M, postprocessor: (FailureMessage) -> Void) -> NonNilMatcherFunc<M.ValueType> {
|
||||
return NonNilMatcherFunc<M.ValueType> { actualExpression, failureMessage in
|
||||
let result = matcher.matches(actualExpression, failureMessage: failureMessage)
|
||||
postprocessor(failureMessage)
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
struct NonNilMatcherWrapper<M: Matcher, T where M.ValueType == T>: Matcher {
|
||||
let matcher: M
|
||||
let nilMessage = " (use beNil() to match nils)"
|
||||
|
||||
init(_ matcher: M) {
|
||||
self.matcher = matcher
|
||||
}
|
||||
|
||||
func matches(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
let pass = matcher.matches(actualExpression, failureMessage: failureMessage)
|
||||
if actualExpression.evaluate() == nil {
|
||||
failureMessage.postfixActual = nilMessage
|
||||
return false
|
||||
}
|
||||
return pass
|
||||
}
|
||||
|
||||
func doesNotMatch(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
let pass = matcher.doesNotMatch(actualExpression, failureMessage: failureMessage)
|
||||
if actualExpression.evaluate() == nil {
|
||||
failureMessage.postfixActual = nilMessage
|
||||
return false
|
||||
}
|
||||
return pass
|
||||
}
|
||||
}
|
||||
|
||||
struct NonNilBasicMatcherWrapper<M, T where M: NonNilBasicMatcher, M.ValueType == T>: Matcher {
|
||||
let matcher: M
|
||||
|
||||
init(_ matcher: M) {
|
||||
self.matcher = matcher
|
||||
}
|
||||
|
||||
func matches(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
return matcher.matches(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
|
||||
func doesNotMatch(actualExpression: Expression<T>, failureMessage: FailureMessage) -> Bool {
|
||||
return !matcher.matches(actualExpression, failureMessage: failureMessage)
|
||||
}
|
||||
}
|
||||
|
||||
extension Expectation {
|
||||
public func to<U where U: NonNilBasicMatcher, U.ValueType == T>(matcher: U) {
|
||||
to(FullMatcherWrapper(matcher: NonNilMatcherWrapper(NonNilBasicMatcherWrapper(matcher)), to: "to", toNot: "to not"))
|
||||
}
|
||||
|
||||
public func toNot<U where U: NonNilBasicMatcher, U.ValueType == T>(matcher: U) {
|
||||
toNot(FullMatcherWrapper(matcher: NonNilMatcherWrapper(NonNilBasicMatcherWrapper(matcher)), to: "to", toNot: "to not"))
|
||||
}
|
||||
|
||||
public func notTo<U where U: NonNilBasicMatcher, U.ValueType == T>(matcher: U) {
|
||||
toNot(matcher)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,146 @@
|
|||
import Foundation
|
||||
|
||||
struct ObjCMatcherWrapper : Matcher {
|
||||
let matcher: NMBMatcher
|
||||
let to: String
|
||||
let toNot: String
|
||||
|
||||
func matches(actualExpression: Expression<NSObject>, failureMessage: FailureMessage) -> Bool {
|
||||
failureMessage.to = to
|
||||
return matcher.matches(({ actualExpression.evaluate() }), failureMessage: failureMessage, location: actualExpression.location)
|
||||
}
|
||||
|
||||
func doesNotMatch(actualExpression: Expression<NSObject>, failureMessage: FailureMessage) -> Bool {
|
||||
failureMessage.to = toNot
|
||||
return matcher.doesNotMatch(({ actualExpression.evaluate() }), failureMessage: failureMessage, location: actualExpression.location)
|
||||
}
|
||||
}
|
||||
|
||||
// Equivalent to Expectation, but simplified for ObjC objects only
|
||||
public class NMBExpectation : NSObject {
|
||||
let _actualBlock: () -> NSObject!
|
||||
var _negative: Bool
|
||||
let _file: String
|
||||
let _line: UInt
|
||||
var _timeout: NSTimeInterval = 1.0
|
||||
|
||||
public init(actualBlock: () -> NSObject!, negative: Bool, file: String, line: UInt) {
|
||||
self._actualBlock = actualBlock
|
||||
self._negative = negative
|
||||
self._file = file
|
||||
self._line = line
|
||||
}
|
||||
|
||||
public var withTimeout: (NSTimeInterval) -> NMBExpectation {
|
||||
return ({ timeout in self._timeout = timeout
|
||||
return self
|
||||
})
|
||||
}
|
||||
|
||||
public var to: (matcher: NMBMatcher) -> Void {
|
||||
return ({ matcher in
|
||||
expect(file: self._file, line: self._line){ self._actualBlock() as NSObject? }.to(
|
||||
ObjCMatcherWrapper(matcher: matcher, to: "to", toNot: "to not")
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
public var toNot: (matcher: NMBMatcher) -> Void {
|
||||
return ({ matcher in
|
||||
expect(file: self._file, line: self._line){ self._actualBlock() as NSObject? }.toNot(
|
||||
ObjCMatcherWrapper(matcher: matcher, to: "to", toNot: "to not")
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
public var notTo: (matcher: NMBMatcher) -> Void { return toNot }
|
||||
|
||||
public var toEventually: (matcher: NMBMatcher) -> Void {
|
||||
return ({ matcher in
|
||||
expect(file: self._file, line: self._line){ self._actualBlock() as NSObject? }.toEventually(
|
||||
ObjCMatcherWrapper(matcher: matcher, to: "to", toNot: "to not"),
|
||||
timeout: self._timeout
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
public var toEventuallyNot: (matcher: NMBMatcher) -> Void {
|
||||
return ({ matcher in
|
||||
expect(file: self._file, line: self._line){ self._actualBlock() as NSObject? }.toEventuallyNot(
|
||||
ObjCMatcherWrapper(matcher: matcher, to: "to", toNot: "to not"),
|
||||
timeout: self._timeout
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
typealias MatcherBlock = (actualExpression: Expression<NSObject>, failureMessage: FailureMessage, location: SourceLocation) -> Bool
|
||||
typealias FullMatcherBlock = (actualExpression: Expression<NSObject>, failureMessage: FailureMessage, location: SourceLocation, shouldNotMatch: Bool) -> Bool
|
||||
@objc public class NMBObjCMatcher : NMBMatcher {
|
||||
let _match: MatcherBlock
|
||||
let _doesNotMatch: MatcherBlock
|
||||
let canMatchNil: Bool
|
||||
|
||||
init(canMatchNil: Bool, matcher: MatcherBlock, notMatcher: MatcherBlock) {
|
||||
self.canMatchNil = canMatchNil
|
||||
self._match = matcher
|
||||
self._doesNotMatch = notMatcher
|
||||
}
|
||||
|
||||
convenience init(matcher: MatcherBlock) {
|
||||
self.init(canMatchNil: true, matcher: matcher)
|
||||
}
|
||||
|
||||
convenience init(canMatchNil: Bool, matcher: MatcherBlock) {
|
||||
self.init(canMatchNil: canMatchNil, matcher: matcher, notMatcher: ({ actualExpression, failureMessage, location in
|
||||
return !matcher(actualExpression: actualExpression, failureMessage: failureMessage, location: location)
|
||||
}))
|
||||
}
|
||||
|
||||
convenience init(matcher: FullMatcherBlock) {
|
||||
self.init(canMatchNil: true, matcher: matcher)
|
||||
}
|
||||
|
||||
convenience init(canMatchNil: Bool, matcher: FullMatcherBlock) {
|
||||
self.init(canMatchNil: canMatchNil, matcher: ({ actualExpression, failureMessage, location in
|
||||
return matcher(actualExpression: actualExpression, failureMessage: failureMessage, location: location, shouldNotMatch: false)
|
||||
}), notMatcher: ({ actualExpression, failureMessage, location in
|
||||
return matcher(actualExpression: actualExpression, failureMessage: failureMessage, location: location, shouldNotMatch: true)
|
||||
}))
|
||||
}
|
||||
|
||||
private func canMatch(actualExpression: Expression<NSObject>, failureMessage: FailureMessage) -> Bool {
|
||||
if !canMatchNil && actualExpression.evaluate() == nil {
|
||||
failureMessage.postfixActual = " (use beNil() to match nils)"
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
public func matches(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
|
||||
let expr = Expression(expression: actualBlock, location: SourceLocation())
|
||||
let result = _match(
|
||||
actualExpression: expr,
|
||||
failureMessage: failureMessage,
|
||||
location: location)
|
||||
if self.canMatch(Expression(expression: actualBlock, location: location), failureMessage: failureMessage) {
|
||||
return result
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
public func doesNotMatch(actualBlock: () -> NSObject!, failureMessage: FailureMessage, location: SourceLocation) -> Bool {
|
||||
let expr = Expression(expression: actualBlock, location: SourceLocation())
|
||||
let result = _doesNotMatch(
|
||||
actualExpression: expr,
|
||||
failureMessage: failureMessage,
|
||||
location: location)
|
||||
if self.canMatch(Expression(expression: actualBlock, location: location), failureMessage: failureMessage) {
|
||||
return result
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
|
||||
@class NMBExpectation;
|
||||
@class NMBObjCBeCloseToMatcher;
|
||||
@class NMBObjCRaiseExceptionMatcher;
|
||||
@protocol NMBMatcher;
|
||||
|
||||
|
||||
#define NIMBLE_EXPORT FOUNDATION_EXPORT
|
||||
|
||||
#ifdef NIMBLE_DISABLE_SHORT_SYNTAX
|
||||
#define NIMBLE_SHORT(PROTO, ORIGINAL)
|
||||
#else
|
||||
#define NIMBLE_SHORT(PROTO, ORIGINAL) FOUNDATION_STATIC_INLINE PROTO { return (ORIGINAL); }
|
||||
#endif
|
||||
|
||||
NIMBLE_EXPORT NMBExpectation *NMB_expect(id(^actualBlock)(), const char *file, unsigned int line);
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_equal(id expectedValue);
|
||||
NIMBLE_SHORT(id<NMBMatcher> equal(id expectedValue),
|
||||
NMB_equal(expectedValue));
|
||||
|
||||
NIMBLE_EXPORT NMBObjCBeCloseToMatcher *NMB_beCloseTo(NSNumber *expectedValue);
|
||||
NIMBLE_SHORT(NMBObjCBeCloseToMatcher *beCloseTo(id expectedValue),
|
||||
NMB_beCloseTo(expectedValue));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beAnInstanceOf(Class expectedClass);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beAnInstanceOf(Class expectedClass),
|
||||
NMB_beAnInstanceOf(expectedClass));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beAKindOf(Class expectedClass);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beAKindOf(Class expectedClass),
|
||||
NMB_beAKindOf(expectedClass));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beginWith(id itemElementOrSubstring);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beginWith(id itemElementOrSubstring),
|
||||
NMB_beginWith(itemElementOrSubstring));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beGreaterThan(NSNumber *expectedValue);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beGreaterThan(NSNumber *expectedValue),
|
||||
NMB_beGreaterThan(expectedValue));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beGreaterThanOrEqualTo(NSNumber *expectedValue);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beGreaterThanOrEqualTo(NSNumber *expectedValue),
|
||||
NMB_beGreaterThanOrEqualTo(expectedValue));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beIdenticalTo(id expectedInstance);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beIdenticalTo(id expectedInstance),
|
||||
NMB_beIdenticalTo(expectedInstance));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beLessThan(NSNumber *expectedValue);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beLessThan(NSNumber *expectedValue),
|
||||
NMB_beLessThan(expectedValue));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beLessThanOrEqualTo(NSNumber *expectedValue);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beLessThanOrEqualTo(NSNumber *expectedValue),
|
||||
NMB_beLessThanOrEqualTo(expectedValue));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beTruthy(void);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beTruthy(void),
|
||||
NMB_beTruthy());
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beFalsy(void);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beFalsy(void),
|
||||
NMB_beFalsy());
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beTrue(void);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beTrue(void),
|
||||
NMB_beTrue());
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beFalse(void);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beFalse(void),
|
||||
NMB_beFalse());
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beNil(void);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beNil(void),
|
||||
NMB_beNil());
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beEmpty(void);
|
||||
NIMBLE_SHORT(id<NMBMatcher> beEmpty(void),
|
||||
NMB_beEmpty());
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_contain(id itemOrSubstring);
|
||||
NIMBLE_SHORT(id<NMBMatcher> contain(id itemOrSubstring),
|
||||
NMB_contain(itemOrSubstring));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_endWith(id itemElementOrSubstring);
|
||||
NIMBLE_SHORT(id<NMBMatcher> endWith(id itemElementOrSubstring),
|
||||
NMB_endWith(itemElementOrSubstring));
|
||||
|
||||
NIMBLE_EXPORT NMBObjCRaiseExceptionMatcher *NMB_raiseException(void);
|
||||
NIMBLE_SHORT(NMBObjCRaiseExceptionMatcher *raiseException(void),
|
||||
NMB_raiseException());
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_match(id expectedValue);
|
||||
NIMBLE_SHORT(id<NMBMatcher> match(id expectedValue),
|
||||
NMB_match(expectedValue));
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_allPass(id matcher);
|
||||
NIMBLE_SHORT(id<NMBMatcher> allPass(id matcher),
|
||||
NMB_allPass(matcher));
|
||||
|
||||
// In order to preserve breakpoint behavior despite using macros to fill in __FILE__ and __LINE__,
|
||||
// define a builder that populates __FILE__ and __LINE__, and returns a block that takes timeout
|
||||
// and action arguments. See https://github.com/Quick/Quick/pull/185 for details.
|
||||
typedef void (^NMBWaitUntilTimeoutBlock)(NSTimeInterval timeout, void (^action)(void (^)(void)));
|
||||
typedef void (^NMBWaitUntilBlock)(void (^action)(void (^)(void)));
|
||||
|
||||
NIMBLE_EXPORT NMBWaitUntilTimeoutBlock nmb_wait_until_timeout_builder(NSString *file, NSUInteger line);
|
||||
NIMBLE_EXPORT NMBWaitUntilBlock nmb_wait_until_builder(NSString *file, NSUInteger line);
|
||||
|
||||
#define NMB_waitUntilTimeout nmb_wait_until_timeout_builder(@(__FILE__), __LINE__)
|
||||
#define NMB_waitUntil nmb_wait_until_builder(@(__FILE__), __LINE__)
|
||||
|
||||
#ifndef NIMBLE_DISABLE_SHORT_SYNTAX
|
||||
#define expect(...) NMB_expect(^id{ return (__VA_ARGS__); }, __FILE__, __LINE__)
|
||||
#define expectAction(...) NMB_expect(^id{ (__VA_ARGS__); return nil; }, __FILE__, __LINE__)
|
||||
#define waitUntilTimeout NMB_waitUntilTimeout
|
||||
#define waitUntil NMB_waitUntil
|
||||
#endif
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
#import <Nimble/DSL.h>
|
||||
#import <Nimble/Nimble-Swift.h>
|
||||
|
||||
NIMBLE_EXPORT NMBExpectation *NMB_expect(id(^actualBlock)(), const char *file, unsigned int line) {
|
||||
return [[NMBExpectation alloc] initWithActualBlock:actualBlock
|
||||
negative:NO
|
||||
file:[[NSString alloc] initWithFormat:@"%s", file]
|
||||
line:line];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beAnInstanceOf(Class expectedClass) {
|
||||
return [NMBObjCMatcher beAnInstanceOfMatcher:expectedClass];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beAKindOf(Class expectedClass) {
|
||||
return [NMBObjCMatcher beAKindOfMatcher:expectedClass];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT NMBObjCBeCloseToMatcher *NMB_beCloseTo(NSNumber *expectedValue) {
|
||||
return [NMBObjCMatcher beCloseToMatcher:expectedValue within:0.001];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beginWith(id itemElementOrSubstring) {
|
||||
return [NMBObjCMatcher beginWithMatcher:itemElementOrSubstring];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beGreaterThan(NSNumber *expectedValue) {
|
||||
return [NMBObjCMatcher beGreaterThanMatcher:expectedValue];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beGreaterThanOrEqualTo(NSNumber *expectedValue) {
|
||||
return [NMBObjCMatcher beGreaterThanOrEqualToMatcher:expectedValue];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beIdenticalTo(id expectedInstance) {
|
||||
return [NMBObjCMatcher beIdenticalToMatcher:expectedInstance];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beLessThan(NSNumber *expectedValue) {
|
||||
return [NMBObjCMatcher beLessThanMatcher:expectedValue];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beLessThanOrEqualTo(NSNumber *expectedValue) {
|
||||
return [NMBObjCMatcher beLessThanOrEqualToMatcher:expectedValue];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beTruthy() {
|
||||
return [NMBObjCMatcher beTruthyMatcher];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beFalsy() {
|
||||
return [NMBObjCMatcher beFalsyMatcher];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beTrue() {
|
||||
return [NMBObjCMatcher beTrueMatcher];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beFalse() {
|
||||
return [NMBObjCMatcher beFalseMatcher];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beNil() {
|
||||
return [NMBObjCMatcher beNilMatcher];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_beEmpty() {
|
||||
return [NMBObjCMatcher beEmptyMatcher];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_contain(id itemOrSubstring) {
|
||||
return [NMBObjCMatcher containMatcher:itemOrSubstring];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_endWith(id itemElementOrSubstring) {
|
||||
return [NMBObjCMatcher endWithMatcher:itemElementOrSubstring];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_equal(id expectedValue) {
|
||||
return [NMBObjCMatcher equalMatcher:expectedValue];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_match(id expectedValue) {
|
||||
return [NMBObjCMatcher matchMatcher:expectedValue];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT id<NMBMatcher> NMB_allPass(id expectedValue) {
|
||||
return [NMBObjCMatcher allPassMatcher:expectedValue];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT NMBObjCRaiseExceptionMatcher *NMB_raiseException() {
|
||||
return [NMBObjCMatcher raiseExceptionMatcher];
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT NMBWaitUntilTimeoutBlock nmb_wait_until_timeout_builder(NSString *file, NSUInteger line) {
|
||||
return ^(NSTimeInterval timeout, void (^action)(void (^)(void))) {
|
||||
[NMBWait untilTimeout:timeout file:file line:line action:action];
|
||||
};
|
||||
}
|
||||
|
||||
NIMBLE_EXPORT NMBWaitUntilBlock nmb_wait_until_builder(NSString *file, NSUInteger line) {
|
||||
return ^(void (^action)(void (^)(void))) {
|
||||
[NMBWait untilFile:file line:line action:action];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface NMBExceptionCapture : NSObject
|
||||
|
||||
- (id)initWithHandler:(void(^)(NSException *))handler finally:(void(^)())finally;
|
||||
- (void)tryBlock:(void(^)())unsafeBlock;
|
||||
|
||||
@end
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
#import "NMBExceptionCapture.h"
|
||||
|
||||
@interface NMBExceptionCapture ()
|
||||
@property (nonatomic, copy) void(^handler)(NSException *exception);
|
||||
@property (nonatomic, copy) void(^finally)();
|
||||
@end
|
||||
|
||||
@implementation NMBExceptionCapture
|
||||
|
||||
- (id)initWithHandler:(void(^)(NSException *))handler finally:(void(^)())finally {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.handler = handler;
|
||||
self.finally = finally;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)tryBlock:(void(^)())unsafeBlock {
|
||||
@try {
|
||||
unsafeBlock();
|
||||
}
|
||||
@catch (NSException *exception) {
|
||||
if (self.handler) {
|
||||
self.handler(exception);
|
||||
}
|
||||
}
|
||||
@finally {
|
||||
if (self.finally) {
|
||||
self.finally();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,671 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
01089148ABC131B7DAC0ADBC /* BasicMatcherWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 152AF4A2E5ACEDACCC5E1B06 /* BasicMatcherWrapper.swift */; };
|
||||
0CDE0A58ECCA978F3BC3CA31 /* EndWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43141A44B97AD3E367956828 /* EndWith.swift */; };
|
||||
0E9D27CE257CD39FA0B3E71D /* BeCloseTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 078D8E651E500274F399D41E /* BeCloseTo.swift */; };
|
||||
14148724E009FC8FBA176881 /* Stringers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A8F515027DAF831F7DC54D8 /* Stringers.swift */; };
|
||||
159C57E648A726FFC9339607 /* AsyncMatcherWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1AD6342E53A2D4C2E812607 /* AsyncMatcherWrapper.swift */; };
|
||||
17ACC643879106F24D53C641 /* Pods-cameraTests-Nimble-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 021ADDBBBF231A5D239F4C27 /* Pods-cameraTests-Nimble-dummy.m */; };
|
||||
1D890FB86EC29E49C9C9F4CF /* BeGreaterThan.swift in Sources */ = {isa = PBXBuildFile; fileRef = DEB89CA3410BD2FD7DCE6F77 /* BeGreaterThan.swift */; };
|
||||
3EBBCEDABA12566CF98444A7 /* Equal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A917C86763BD1CF101F1655 /* Equal.swift */; };
|
||||
42E2926C0F5EF8D65B53A688 /* Expectation.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA668E44BFF46C893D9507F5 /* Expectation.swift */; };
|
||||
45FC366B9905C2662261CF46 /* Pods-cameraTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = BE09A6B18ED41D446839352E /* Pods-cameraTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
464B01A367749B5493612A3E /* NonNilMatcherWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33855997ACC736A273CC31FE /* NonNilMatcherWrapper.swift */; };
|
||||
471D0C01840B72E4AF8658FC /* BeLessThan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D954B303308DCC71600B886 /* BeLessThan.swift */; };
|
||||
4D7BCE4B2037A18F2BCF3B49 /* FullMatcherWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9085E3E32975EEB9F6CDF05 /* FullMatcherWrapper.swift */; };
|
||||
4DB4999BB8DBB43810B6DC73 /* NMBExceptionCapture.h in Headers */ = {isa = PBXBuildFile; fileRef = 9D9C447E222B27B3B55B82F2 /* NMBExceptionCapture.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
4E2F5FF51CFA702793EDC9CB /* AdapterProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62B4F1518EDEC85C932550D6 /* AdapterProtocols.swift */; };
|
||||
51BF7A9F0C61C2954E4E6981 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B788622D28DB93A351DE04AE /* Foundation.framework */; };
|
||||
5323F82564C12D21885B12B1 /* MatcherFunc.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8570B04BE051CE0C299C217 /* MatcherFunc.swift */; };
|
||||
5F2B169EBEEBB9158E0F4091 /* Pods-cameraTests-Nimble-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = A89419B19D97A9C1D85F74EA /* Pods-cameraTests-Nimble-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
5FE1F6A8C608FB3CCDD44065 /* NimbleXCTestHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E97C6378E1EFC6A9FCD5858 /* NimbleXCTestHandler.swift */; };
|
||||
62E2F6A80ACB1CC1C12F0A84 /* DSL.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A4667FA8D211151E704C12E /* DSL.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
6669C58A2D35EF1F0B59A70B /* BeIdenticalTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1600EED11CD5DCB47E73704E /* BeIdenticalTo.swift */; };
|
||||
735DEA800DD01C8C698BCC12 /* AssertionRecorder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E520D13B89924C3C867B530 /* AssertionRecorder.swift */; };
|
||||
74BF86C46E83F93B092D9616 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 37516A185BCDC2106B98E8E8 /* XCTest.framework */; };
|
||||
74F01F4457479C23F65B6DBE /* SourceLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6B780BA32F3CB7F26B1FBA8 /* SourceLocation.swift */; };
|
||||
7889D3EE297702D056F82D9C /* DSL+Wait.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CD4D2538141697BC84A172D /* DSL+Wait.swift */; };
|
||||
7F4663D1202D8EC7BB2838C8 /* Contain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 532E3AA7F87EF0F8DDBA9655 /* Contain.swift */; };
|
||||
845E41849D0388DF8B095192 /* ObjCMatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB736FB6B375900B50F5D36A /* ObjCMatcher.swift */; };
|
||||
85F70FED553970D25D69AA6B /* MatcherProtocols.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9F114F3B8D445E46110AE38 /* MatcherProtocols.swift */; };
|
||||
87E5689CFA6996489B04439F /* FailureMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78BB93EDD75CA7AD651F697 /* FailureMessage.swift */; };
|
||||
90E1907B18A6767B60124BEA /* BeLessThanOrEqual.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B8E22C95D6FC2CB4CAE30EB /* BeLessThanOrEqual.swift */; };
|
||||
964879168653FACBEC120D11 /* BeNil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89937C7EE610962CD881BE8F /* BeNil.swift */; };
|
||||
9B146CBD42DCA7412BCA6155 /* Functional.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF8E7B37650BCE7B556E47C3 /* Functional.swift */; };
|
||||
A624B3EA27F6600EADB9736F /* NMBExceptionCapture.m in Sources */ = {isa = PBXBuildFile; fileRef = 263D6C0F1E625A583B0B3DCA /* NMBExceptionCapture.m */; };
|
||||
B03074DE8A8F7647A2C23FA4 /* BeEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D8E569C593DB80BD4A8E6A4 /* BeEmpty.swift */; };
|
||||
B98295B00C4A782FE5538FCD /* AllPass.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA53801B35C14BA80F9BC307 /* AllPass.swift */; };
|
||||
C687DB314CDE705E154CE18B /* BeginWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = 634D4B9D994E64B3604AB81B /* BeginWith.swift */; };
|
||||
CAF41CE8ECBF1667F86E0DF2 /* DSL.m in Sources */ = {isa = PBXBuildFile; fileRef = 0721FEB55A46E044A54D3C84 /* DSL.m */; };
|
||||
CB9EC2C617B609ABEE813D73 /* Expression.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48B47B60C36672D4575CADDC /* Expression.swift */; };
|
||||
D11C27E82C73BD53F6F97C31 /* BeLogical.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DD9236DD45DBCB29C093A1A /* BeLogical.swift */; };
|
||||
D288B19C6D66D3E07BBAE689 /* BeAKindOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE4BD548BBC08B3144844482 /* BeAKindOf.swift */; };
|
||||
D384F02E9F6267A2D4A98244 /* Match.swift in Sources */ = {isa = PBXBuildFile; fileRef = 05969277623A1E98CA475706 /* Match.swift */; };
|
||||
D9225694B5282883E4CB86A0 /* DSL.swift in Sources */ = {isa = PBXBuildFile; fileRef = 138F44E6EC4E2624F0D16F78 /* DSL.swift */; };
|
||||
E4D155ABCC2A49EC84FDAFEF /* BeGreaterThanOrEqualTo.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB337C30BF47A0F2AE17082B /* BeGreaterThanOrEqualTo.swift */; };
|
||||
E6E50053B164289E7C0286A1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B788622D28DB93A351DE04AE /* Foundation.framework */; };
|
||||
EB0EBE7891841909EF97930C /* Pods-cameraTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 9A68951E49F8B1020860B088 /* Pods-cameraTests-dummy.m */; };
|
||||
EEEE68FDF6DF9C68AABCB1EF /* Nimble.h in Headers */ = {isa = PBXBuildFile; fileRef = 492A9EA2857145B5C2A65F90 /* Nimble.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
FED5D51DA977C4C75F56EC88 /* RaisesException.swift in Sources */ = {isa = PBXBuildFile; fileRef = B56AC8FE10644EAA3C1BF20B /* RaisesException.swift */; };
|
||||
FF0F82E6307C7BCB94359952 /* Poll.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD217FB84ED2D06BDE3BCE9F /* Poll.swift */; };
|
||||
FFAE85B2E23251978FB44C57 /* BeAnInstanceOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA22B69CB52C59CB59ADFEC5 /* BeAnInstanceOf.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
653B1B8D4FADBD49C1108AD3 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 27C1A71C4CEE03720FF9424C /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = F31DCF4BC1F75A477673D8D8;
|
||||
remoteInfo = "Pods-cameraTests-Nimble";
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
021ADDBBBF231A5D239F4C27 /* Pods-cameraTests-Nimble-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-cameraTests-Nimble-dummy.m"; sourceTree = "<group>"; };
|
||||
05969277623A1E98CA475706 /* Match.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Match.swift; path = Nimble/Matchers/Match.swift; sourceTree = "<group>"; };
|
||||
0721FEB55A46E044A54D3C84 /* DSL.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = DSL.m; path = Nimble/objc/DSL.m; sourceTree = "<group>"; };
|
||||
078D8E651E500274F399D41E /* BeCloseTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeCloseTo.swift; path = Nimble/Matchers/BeCloseTo.swift; sourceTree = "<group>"; };
|
||||
0A43DB02D37C42C4F7BE4D51 /* Pods_cameraTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_cameraTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
120601460EFA14EA14597810 /* Nimble.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Nimble.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
138F44E6EC4E2624F0D16F78 /* DSL.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DSL.swift; path = Nimble/DSL.swift; sourceTree = "<group>"; };
|
||||
152AF4A2E5ACEDACCC5E1B06 /* BasicMatcherWrapper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BasicMatcherWrapper.swift; path = Nimble/Wrappers/BasicMatcherWrapper.swift; sourceTree = "<group>"; };
|
||||
15CCC82CDE5BDB8775D89FC8 /* Pods-cameraTests-Nimble-Private.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-cameraTests-Nimble-Private.xcconfig"; sourceTree = "<group>"; };
|
||||
1600EED11CD5DCB47E73704E /* BeIdenticalTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeIdenticalTo.swift; path = Nimble/Matchers/BeIdenticalTo.swift; sourceTree = "<group>"; };
|
||||
17637EBC9866319AD7C0C4E1 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
1B544C5FB7AB727EEF74872F /* Pods-cameraTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-cameraTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
263D6C0F1E625A583B0B3DCA /* NMBExceptionCapture.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = NMBExceptionCapture.m; path = Nimble/objc/NMBExceptionCapture.m; sourceTree = "<group>"; };
|
||||
2A4667FA8D211151E704C12E /* DSL.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = DSL.h; path = Nimble/objc/DSL.h; sourceTree = "<group>"; };
|
||||
2D181BDAED0514B1747A9927 /* Pods-cameraTests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-cameraTests-resources.sh"; sourceTree = "<group>"; };
|
||||
2D954B303308DCC71600B886 /* BeLessThan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeLessThan.swift; path = Nimble/Matchers/BeLessThan.swift; sourceTree = "<group>"; };
|
||||
2E520D13B89924C3C867B530 /* AssertionRecorder.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AssertionRecorder.swift; path = Nimble/Adapters/AssertionRecorder.swift; sourceTree = "<group>"; };
|
||||
33855997ACC736A273CC31FE /* NonNilMatcherWrapper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NonNilMatcherWrapper.swift; path = Nimble/Wrappers/NonNilMatcherWrapper.swift; sourceTree = "<group>"; };
|
||||
3456DC85700157A9B987FC5E /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
37516A185BCDC2106B98E8E8 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
|
||||
3A8F515027DAF831F7DC54D8 /* Stringers.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Stringers.swift; path = Nimble/Utils/Stringers.swift; sourceTree = "<group>"; };
|
||||
43141A44B97AD3E367956828 /* EndWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = EndWith.swift; path = Nimble/Matchers/EndWith.swift; sourceTree = "<group>"; };
|
||||
48B47B60C36672D4575CADDC /* Expression.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Expression.swift; path = Nimble/Expression.swift; sourceTree = "<group>"; };
|
||||
492A9EA2857145B5C2A65F90 /* Nimble.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Nimble.h; path = Nimble/Nimble.h; sourceTree = "<group>"; };
|
||||
4DD9236DD45DBCB29C093A1A /* BeLogical.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeLogical.swift; path = Nimble/Matchers/BeLogical.swift; sourceTree = "<group>"; };
|
||||
532E3AA7F87EF0F8DDBA9655 /* Contain.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Contain.swift; path = Nimble/Matchers/Contain.swift; sourceTree = "<group>"; };
|
||||
53AE1EAC4C9160383EDC753B /* Pods-cameraTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-cameraTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
54C3349B00B675F956B73C67 /* Pods-cameraTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-cameraTests-acknowledgements.plist"; sourceTree = "<group>"; };
|
||||
5753B8FBCF21E39467BE1707 /* Pods-cameraTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-cameraTests-frameworks.sh"; sourceTree = "<group>"; };
|
||||
60E6D71933D5DB3F01A96CFD /* Pods-cameraTests-Nimble.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-cameraTests-Nimble.xcconfig"; sourceTree = "<group>"; };
|
||||
62B4F1518EDEC85C932550D6 /* AdapterProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AdapterProtocols.swift; path = Nimble/Adapters/AdapterProtocols.swift; sourceTree = "<group>"; };
|
||||
634D4B9D994E64B3604AB81B /* BeginWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeginWith.swift; path = Nimble/Matchers/BeginWith.swift; sourceTree = "<group>"; };
|
||||
6D8E569C593DB80BD4A8E6A4 /* BeEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeEmpty.swift; path = Nimble/Matchers/BeEmpty.swift; sourceTree = "<group>"; };
|
||||
7B8E22C95D6FC2CB4CAE30EB /* BeLessThanOrEqual.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeLessThanOrEqual.swift; path = Nimble/Matchers/BeLessThanOrEqual.swift; sourceTree = "<group>"; };
|
||||
7C100A42839F35137B24C84B /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
|
||||
825F7D266989A04E26AF28C0 /* Pods-cameraTests-environment.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-cameraTests-environment.h"; sourceTree = "<group>"; };
|
||||
89937C7EE610962CD881BE8F /* BeNil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeNil.swift; path = Nimble/Matchers/BeNil.swift; sourceTree = "<group>"; };
|
||||
8CD4D2538141697BC84A172D /* DSL+Wait.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DSL+Wait.swift"; path = "Nimble/DSL+Wait.swift"; sourceTree = "<group>"; };
|
||||
8E97C6378E1EFC6A9FCD5858 /* NimbleXCTestHandler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NimbleXCTestHandler.swift; path = Nimble/Adapters/NimbleXCTestHandler.swift; sourceTree = "<group>"; };
|
||||
966FFA9B2426A9009DF07DD4 /* Pods-cameraTests-Nimble-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-cameraTests-Nimble-prefix.pch"; sourceTree = "<group>"; };
|
||||
9A68951E49F8B1020860B088 /* Pods-cameraTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-cameraTests-dummy.m"; sourceTree = "<group>"; };
|
||||
9A917C86763BD1CF101F1655 /* Equal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Equal.swift; path = Nimble/Matchers/Equal.swift; sourceTree = "<group>"; };
|
||||
9D9C447E222B27B3B55B82F2 /* NMBExceptionCapture.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = NMBExceptionCapture.h; path = Nimble/objc/NMBExceptionCapture.h; sourceTree = "<group>"; };
|
||||
A8570B04BE051CE0C299C217 /* MatcherFunc.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MatcherFunc.swift; path = Nimble/Wrappers/MatcherFunc.swift; sourceTree = "<group>"; };
|
||||
A89419B19D97A9C1D85F74EA /* Pods-cameraTests-Nimble-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-cameraTests-Nimble-umbrella.h"; sourceTree = "<group>"; };
|
||||
A9085E3E32975EEB9F6CDF05 /* FullMatcherWrapper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FullMatcherWrapper.swift; path = Nimble/Wrappers/FullMatcherWrapper.swift; sourceTree = "<group>"; };
|
||||
A9F114F3B8D445E46110AE38 /* MatcherProtocols.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MatcherProtocols.swift; path = Nimble/Matchers/MatcherProtocols.swift; sourceTree = "<group>"; };
|
||||
AD217FB84ED2D06BDE3BCE9F /* Poll.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Poll.swift; path = Nimble/Utils/Poll.swift; sourceTree = "<group>"; };
|
||||
AE4BD548BBC08B3144844482 /* BeAKindOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeAKindOf.swift; path = Nimble/Matchers/BeAKindOf.swift; sourceTree = "<group>"; };
|
||||
B1AD6342E53A2D4C2E812607 /* AsyncMatcherWrapper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncMatcherWrapper.swift; path = Nimble/Wrappers/AsyncMatcherWrapper.swift; sourceTree = "<group>"; };
|
||||
B56AC8FE10644EAA3C1BF20B /* RaisesException.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RaisesException.swift; path = Nimble/Matchers/RaisesException.swift; sourceTree = "<group>"; };
|
||||
B6B780BA32F3CB7F26B1FBA8 /* SourceLocation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SourceLocation.swift; path = Nimble/Utils/SourceLocation.swift; sourceTree = "<group>"; };
|
||||
B75333D5681CD6667EDA5D55 /* Pods-cameraTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-cameraTests.modulemap"; sourceTree = "<group>"; };
|
||||
B788622D28DB93A351DE04AE /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; };
|
||||
BE09A6B18ED41D446839352E /* Pods-cameraTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-cameraTests-umbrella.h"; sourceTree = "<group>"; };
|
||||
CB337C30BF47A0F2AE17082B /* BeGreaterThanOrEqualTo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeGreaterThanOrEqualTo.swift; path = Nimble/Matchers/BeGreaterThanOrEqualTo.swift; sourceTree = "<group>"; };
|
||||
D78BB93EDD75CA7AD651F697 /* FailureMessage.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = FailureMessage.swift; path = Nimble/FailureMessage.swift; sourceTree = "<group>"; };
|
||||
DA668E44BFF46C893D9507F5 /* Expectation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Expectation.swift; path = Nimble/Expectation.swift; sourceTree = "<group>"; };
|
||||
DB736FB6B375900B50F5D36A /* ObjCMatcher.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObjCMatcher.swift; path = Nimble/Wrappers/ObjCMatcher.swift; sourceTree = "<group>"; };
|
||||
DEB89CA3410BD2FD7DCE6F77 /* BeGreaterThan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeGreaterThan.swift; path = Nimble/Matchers/BeGreaterThan.swift; sourceTree = "<group>"; };
|
||||
DF8E7B37650BCE7B556E47C3 /* Functional.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Functional.swift; path = Nimble/Utils/Functional.swift; sourceTree = "<group>"; };
|
||||
E2EACB37B702DAAE7FF0F311 /* Pods-cameraTests-Nimble.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "sourcecode.module-map"; path = "Pods-cameraTests-Nimble.modulemap"; sourceTree = "<group>"; };
|
||||
E37AE92C2BCD0A171EBD9048 /* Pods-cameraTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-cameraTests-acknowledgements.markdown"; sourceTree = "<group>"; };
|
||||
FA22B69CB52C59CB59ADFEC5 /* BeAnInstanceOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BeAnInstanceOf.swift; path = Nimble/Matchers/BeAnInstanceOf.swift; sourceTree = "<group>"; };
|
||||
FA53801B35C14BA80F9BC307 /* AllPass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AllPass.swift; path = Nimble/Matchers/AllPass.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
86AED7A97ED978B78AA624B8 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
51BF7A9F0C61C2954E4E6981 /* Foundation.framework in Frameworks */,
|
||||
74BF86C46E83F93B092D9616 /* XCTest.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
C231EDE8C35C7D379CB96CF6 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E6E50053B164289E7C0286A1 /* Foundation.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
3C5FFF9DD5BDE1510BB6D866 /* Targets Support Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B62D92E24703855CAF461CCB /* Pods-cameraTests */,
|
||||
);
|
||||
name = "Targets Support Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
46FB1072C2AF7C69F7812B07 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7F04B8451408463267D6E9FC /* iOS */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
564BBA1DA28C2A6CFBBFA5D0 /* Support Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
17637EBC9866319AD7C0C4E1 /* Info.plist */,
|
||||
E2EACB37B702DAAE7FF0F311 /* Pods-cameraTests-Nimble.modulemap */,
|
||||
60E6D71933D5DB3F01A96CFD /* Pods-cameraTests-Nimble.xcconfig */,
|
||||
15CCC82CDE5BDB8775D89FC8 /* Pods-cameraTests-Nimble-Private.xcconfig */,
|
||||
021ADDBBBF231A5D239F4C27 /* Pods-cameraTests-Nimble-dummy.m */,
|
||||
966FFA9B2426A9009DF07DD4 /* Pods-cameraTests-Nimble-prefix.pch */,
|
||||
A89419B19D97A9C1D85F74EA /* Pods-cameraTests-Nimble-umbrella.h */,
|
||||
);
|
||||
name = "Support Files";
|
||||
path = "../Target Support Files/Pods-cameraTests-Nimble";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6DA46FFACBA68D7E0E651E9C /* Nimble */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
62B4F1518EDEC85C932550D6 /* AdapterProtocols.swift */,
|
||||
FA53801B35C14BA80F9BC307 /* AllPass.swift */,
|
||||
2E520D13B89924C3C867B530 /* AssertionRecorder.swift */,
|
||||
B1AD6342E53A2D4C2E812607 /* AsyncMatcherWrapper.swift */,
|
||||
152AF4A2E5ACEDACCC5E1B06 /* BasicMatcherWrapper.swift */,
|
||||
AE4BD548BBC08B3144844482 /* BeAKindOf.swift */,
|
||||
FA22B69CB52C59CB59ADFEC5 /* BeAnInstanceOf.swift */,
|
||||
078D8E651E500274F399D41E /* BeCloseTo.swift */,
|
||||
6D8E569C593DB80BD4A8E6A4 /* BeEmpty.swift */,
|
||||
DEB89CA3410BD2FD7DCE6F77 /* BeGreaterThan.swift */,
|
||||
CB337C30BF47A0F2AE17082B /* BeGreaterThanOrEqualTo.swift */,
|
||||
1600EED11CD5DCB47E73704E /* BeIdenticalTo.swift */,
|
||||
2D954B303308DCC71600B886 /* BeLessThan.swift */,
|
||||
7B8E22C95D6FC2CB4CAE30EB /* BeLessThanOrEqual.swift */,
|
||||
4DD9236DD45DBCB29C093A1A /* BeLogical.swift */,
|
||||
89937C7EE610962CD881BE8F /* BeNil.swift */,
|
||||
634D4B9D994E64B3604AB81B /* BeginWith.swift */,
|
||||
532E3AA7F87EF0F8DDBA9655 /* Contain.swift */,
|
||||
2A4667FA8D211151E704C12E /* DSL.h */,
|
||||
0721FEB55A46E044A54D3C84 /* DSL.m */,
|
||||
138F44E6EC4E2624F0D16F78 /* DSL.swift */,
|
||||
8CD4D2538141697BC84A172D /* DSL+Wait.swift */,
|
||||
43141A44B97AD3E367956828 /* EndWith.swift */,
|
||||
9A917C86763BD1CF101F1655 /* Equal.swift */,
|
||||
DA668E44BFF46C893D9507F5 /* Expectation.swift */,
|
||||
48B47B60C36672D4575CADDC /* Expression.swift */,
|
||||
D78BB93EDD75CA7AD651F697 /* FailureMessage.swift */,
|
||||
A9085E3E32975EEB9F6CDF05 /* FullMatcherWrapper.swift */,
|
||||
DF8E7B37650BCE7B556E47C3 /* Functional.swift */,
|
||||
05969277623A1E98CA475706 /* Match.swift */,
|
||||
A8570B04BE051CE0C299C217 /* MatcherFunc.swift */,
|
||||
A9F114F3B8D445E46110AE38 /* MatcherProtocols.swift */,
|
||||
9D9C447E222B27B3B55B82F2 /* NMBExceptionCapture.h */,
|
||||
263D6C0F1E625A583B0B3DCA /* NMBExceptionCapture.m */,
|
||||
492A9EA2857145B5C2A65F90 /* Nimble.h */,
|
||||
8E97C6378E1EFC6A9FCD5858 /* NimbleXCTestHandler.swift */,
|
||||
33855997ACC736A273CC31FE /* NonNilMatcherWrapper.swift */,
|
||||
DB736FB6B375900B50F5D36A /* ObjCMatcher.swift */,
|
||||
AD217FB84ED2D06BDE3BCE9F /* Poll.swift */,
|
||||
B56AC8FE10644EAA3C1BF20B /* RaisesException.swift */,
|
||||
B6B780BA32F3CB7F26B1FBA8 /* SourceLocation.swift */,
|
||||
3A8F515027DAF831F7DC54D8 /* Stringers.swift */,
|
||||
564BBA1DA28C2A6CFBBFA5D0 /* Support Files */,
|
||||
);
|
||||
path = Nimble;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
7F04B8451408463267D6E9FC /* iOS */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B788622D28DB93A351DE04AE /* Foundation.framework */,
|
||||
37516A185BCDC2106B98E8E8 /* XCTest.framework */,
|
||||
);
|
||||
name = iOS;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B62D92E24703855CAF461CCB /* Pods-cameraTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
3456DC85700157A9B987FC5E /* Info.plist */,
|
||||
B75333D5681CD6667EDA5D55 /* Pods-cameraTests.modulemap */,
|
||||
E37AE92C2BCD0A171EBD9048 /* Pods-cameraTests-acknowledgements.markdown */,
|
||||
54C3349B00B675F956B73C67 /* Pods-cameraTests-acknowledgements.plist */,
|
||||
9A68951E49F8B1020860B088 /* Pods-cameraTests-dummy.m */,
|
||||
825F7D266989A04E26AF28C0 /* Pods-cameraTests-environment.h */,
|
||||
5753B8FBCF21E39467BE1707 /* Pods-cameraTests-frameworks.sh */,
|
||||
2D181BDAED0514B1747A9927 /* Pods-cameraTests-resources.sh */,
|
||||
BE09A6B18ED41D446839352E /* Pods-cameraTests-umbrella.h */,
|
||||
1B544C5FB7AB727EEF74872F /* Pods-cameraTests.debug.xcconfig */,
|
||||
53AE1EAC4C9160383EDC753B /* Pods-cameraTests.release.xcconfig */,
|
||||
);
|
||||
name = "Pods-cameraTests";
|
||||
path = "Target Support Files/Pods-cameraTests";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C3E0195705D5B04895B4DB58 /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6DA46FFACBA68D7E0E651E9C /* Nimble */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CE75AE2EC99DAE129C05D411 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
120601460EFA14EA14597810 /* Nimble.framework */,
|
||||
0A43DB02D37C42C4F7BE4D51 /* Pods_cameraTests.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
EB884C39B7ED8AAF95E5DB4D = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
7C100A42839F35137B24C84B /* Podfile */,
|
||||
46FB1072C2AF7C69F7812B07 /* Frameworks */,
|
||||
C3E0195705D5B04895B4DB58 /* Pods */,
|
||||
CE75AE2EC99DAE129C05D411 /* Products */,
|
||||
3C5FFF9DD5BDE1510BB6D866 /* Targets Support Files */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
02DEB2322AA0F2E9AD171FED /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
62E2F6A80ACB1CC1C12F0A84 /* DSL.h in Headers */,
|
||||
4DB4999BB8DBB43810B6DC73 /* NMBExceptionCapture.h in Headers */,
|
||||
EEEE68FDF6DF9C68AABCB1EF /* Nimble.h in Headers */,
|
||||
5F2B169EBEEBB9158E0F4091 /* Pods-cameraTests-Nimble-umbrella.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
3FC06EEDD1E9B1615F81E05A /* Headers */ = {
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
45FC366B9905C2662261CF46 /* Pods-cameraTests-umbrella.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXHeadersBuildPhase section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
5450F12D18236260DBDC1426 /* Pods-cameraTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 584229604CB9167009147B96 /* Build configuration list for PBXNativeTarget "Pods-cameraTests" */;
|
||||
buildPhases = (
|
||||
0113DE36E48EBF1827925437 /* Sources */,
|
||||
C231EDE8C35C7D379CB96CF6 /* Frameworks */,
|
||||
3FC06EEDD1E9B1615F81E05A /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
3F08A95AE54212B5311E1F4F /* PBXTargetDependency */,
|
||||
);
|
||||
name = "Pods-cameraTests";
|
||||
productName = "Pods-cameraTests";
|
||||
productReference = 0A43DB02D37C42C4F7BE4D51 /* Pods_cameraTests.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
F31DCF4BC1F75A477673D8D8 /* Pods-cameraTests-Nimble */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = C37EEE75303E967D57CD8DA4 /* Build configuration list for PBXNativeTarget "Pods-cameraTests-Nimble" */;
|
||||
buildPhases = (
|
||||
B6A95D639391F9A2B4AB79A4 /* Sources */,
|
||||
86AED7A97ED978B78AA624B8 /* Frameworks */,
|
||||
02DEB2322AA0F2E9AD171FED /* Headers */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "Pods-cameraTests-Nimble";
|
||||
productName = "Pods-cameraTests-Nimble";
|
||||
productReference = 120601460EFA14EA14597810 /* Nimble.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
27C1A71C4CEE03720FF9424C /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0640;
|
||||
};
|
||||
buildConfigurationList = 86873D4C70DE8A7BC5A71107 /* Build configuration list for PBXProject "Pods" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
);
|
||||
mainGroup = EB884C39B7ED8AAF95E5DB4D;
|
||||
productRefGroup = CE75AE2EC99DAE129C05D411 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
5450F12D18236260DBDC1426 /* Pods-cameraTests */,
|
||||
F31DCF4BC1F75A477673D8D8 /* Pods-cameraTests-Nimble */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
0113DE36E48EBF1827925437 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
EB0EBE7891841909EF97930C /* Pods-cameraTests-dummy.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
B6A95D639391F9A2B4AB79A4 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
4E2F5FF51CFA702793EDC9CB /* AdapterProtocols.swift in Sources */,
|
||||
B98295B00C4A782FE5538FCD /* AllPass.swift in Sources */,
|
||||
735DEA800DD01C8C698BCC12 /* AssertionRecorder.swift in Sources */,
|
||||
159C57E648A726FFC9339607 /* AsyncMatcherWrapper.swift in Sources */,
|
||||
01089148ABC131B7DAC0ADBC /* BasicMatcherWrapper.swift in Sources */,
|
||||
D288B19C6D66D3E07BBAE689 /* BeAKindOf.swift in Sources */,
|
||||
FFAE85B2E23251978FB44C57 /* BeAnInstanceOf.swift in Sources */,
|
||||
0E9D27CE257CD39FA0B3E71D /* BeCloseTo.swift in Sources */,
|
||||
B03074DE8A8F7647A2C23FA4 /* BeEmpty.swift in Sources */,
|
||||
1D890FB86EC29E49C9C9F4CF /* BeGreaterThan.swift in Sources */,
|
||||
E4D155ABCC2A49EC84FDAFEF /* BeGreaterThanOrEqualTo.swift in Sources */,
|
||||
6669C58A2D35EF1F0B59A70B /* BeIdenticalTo.swift in Sources */,
|
||||
471D0C01840B72E4AF8658FC /* BeLessThan.swift in Sources */,
|
||||
90E1907B18A6767B60124BEA /* BeLessThanOrEqual.swift in Sources */,
|
||||
D11C27E82C73BD53F6F97C31 /* BeLogical.swift in Sources */,
|
||||
964879168653FACBEC120D11 /* BeNil.swift in Sources */,
|
||||
C687DB314CDE705E154CE18B /* BeginWith.swift in Sources */,
|
||||
7F4663D1202D8EC7BB2838C8 /* Contain.swift in Sources */,
|
||||
7889D3EE297702D056F82D9C /* DSL+Wait.swift in Sources */,
|
||||
CAF41CE8ECBF1667F86E0DF2 /* DSL.m in Sources */,
|
||||
D9225694B5282883E4CB86A0 /* DSL.swift in Sources */,
|
||||
0CDE0A58ECCA978F3BC3CA31 /* EndWith.swift in Sources */,
|
||||
3EBBCEDABA12566CF98444A7 /* Equal.swift in Sources */,
|
||||
42E2926C0F5EF8D65B53A688 /* Expectation.swift in Sources */,
|
||||
CB9EC2C617B609ABEE813D73 /* Expression.swift in Sources */,
|
||||
87E5689CFA6996489B04439F /* FailureMessage.swift in Sources */,
|
||||
4D7BCE4B2037A18F2BCF3B49 /* FullMatcherWrapper.swift in Sources */,
|
||||
9B146CBD42DCA7412BCA6155 /* Functional.swift in Sources */,
|
||||
D384F02E9F6267A2D4A98244 /* Match.swift in Sources */,
|
||||
5323F82564C12D21885B12B1 /* MatcherFunc.swift in Sources */,
|
||||
85F70FED553970D25D69AA6B /* MatcherProtocols.swift in Sources */,
|
||||
A624B3EA27F6600EADB9736F /* NMBExceptionCapture.m in Sources */,
|
||||
5FE1F6A8C608FB3CCDD44065 /* NimbleXCTestHandler.swift in Sources */,
|
||||
464B01A367749B5493612A3E /* NonNilMatcherWrapper.swift in Sources */,
|
||||
845E41849D0388DF8B095192 /* ObjCMatcher.swift in Sources */,
|
||||
17ACC643879106F24D53C641 /* Pods-cameraTests-Nimble-dummy.m in Sources */,
|
||||
FF0F82E6307C7BCB94359952 /* Poll.swift in Sources */,
|
||||
FED5D51DA977C4C75F56EC88 /* RaisesException.swift in Sources */,
|
||||
74F01F4457479C23F65B6DBE /* SourceLocation.swift in Sources */,
|
||||
14148724E009FC8FBA176881 /* Stringers.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
3F08A95AE54212B5311E1F4F /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
name = "Pods-cameraTests-Nimble";
|
||||
target = F31DCF4BC1F75A477673D8D8 /* Pods-cameraTests-Nimble */;
|
||||
targetProxy = 653B1B8D4FADBD49C1108AD3 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
6248E498F981E8EBAC638FAD /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 53AE1EAC4C9160383EDC753B /* Pods-cameraTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
INFOPLIST_FILE = "Target Support Files/Pods-cameraTests/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MODULEMAP_FILE = "Target Support Files/Pods-cameraTests/Pods-cameraTests.modulemap";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
OTHER_LDFLAGS = "";
|
||||
OTHER_LIBTOOLFLAGS = "";
|
||||
PODS_ROOT = "$(SRCROOT)";
|
||||
PRODUCT_NAME = Pods_cameraTests;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
9D9AF972159E4F33859A2C93 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 1B544C5FB7AB727EEF74872F /* Pods-cameraTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
INFOPLIST_FILE = "Target Support Files/Pods-cameraTests/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MODULEMAP_FILE = "Target Support Files/Pods-cameraTests/Pods-cameraTests.modulemap";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
OTHER_LDFLAGS = "";
|
||||
OTHER_LIBTOOLFLAGS = "";
|
||||
PODS_ROOT = "$(SRCROOT)";
|
||||
PRODUCT_NAME = Pods_cameraTests;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
A411FA41F1DD1687A9192012 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 15CCC82CDE5BDB8775D89FC8 /* Pods-cameraTests-Nimble-Private.xcconfig */;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_PREFIX_HEADER = "Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble-prefix.pch";
|
||||
INFOPLIST_FILE = "Target Support Files/Pods-cameraTests-Nimble/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MODULEMAP_FILE = "Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble.modulemap";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_NAME = Nimble;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
ECB36D1D36C8A99B248E5F28 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SYMROOT = "${SRCROOT}/../build";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
EDCACA62C23CC326DD4B0FC3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 15CCC82CDE5BDB8775D89FC8 /* Pods-cameraTests-Nimble-Private.xcconfig */;
|
||||
buildSettings = {
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_PREFIX_HEADER = "Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble-prefix.pch";
|
||||
INFOPLIST_FILE = "Target Support Files/Pods-cameraTests-Nimble/Info.plist";
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MODULEMAP_FILE = "Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble.modulemap";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_NAME = Nimble;
|
||||
SDKROOT = iphoneos;
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
F1EB43F79943B44B27E22ADE /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = YES;
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1";
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
STRIP_INSTALLED_PRODUCT = NO;
|
||||
SYMROOT = "${SRCROOT}/../build";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
584229604CB9167009147B96 /* Build configuration list for PBXNativeTarget "Pods-cameraTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
9D9AF972159E4F33859A2C93 /* Debug */,
|
||||
6248E498F981E8EBAC638FAD /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
86873D4C70DE8A7BC5A71107 /* Build configuration list for PBXProject "Pods" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
ECB36D1D36C8A99B248E5F28 /* Debug */,
|
||||
F1EB43F79943B44B27E22ADE /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
C37EEE75303E967D57CD8DA4 /* Build configuration list for PBXNativeTarget "Pods-cameraTests-Nimble" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
EDCACA62C23CC326DD4B0FC3 /* Debug */,
|
||||
A411FA41F1DD1687A9192012 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 27C1A71C4CEE03720FF9424C /* Project object */;
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0640"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "F31DCF4BC1F75A477673D8D8"
|
||||
BuildableName = "Nimble.framework"
|
||||
BlueprintName = "Pods-cameraTests-Nimble"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
59
Pods/Pods.xcodeproj/xcuserdata/nataliaterlecka.xcuserdatad/xcschemes/Pods-cameraTests.xcscheme
generated
Normal file
59
Pods/Pods.xcodeproj/xcuserdata/nataliaterlecka.xcuserdatad/xcschemes/Pods-cameraTests.xcscheme
generated
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0640"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "5450F12D18236260DBDC1426"
|
||||
BuildableName = "Pods_cameraTests.framework"
|
||||
BlueprintName = "Pods-cameraTests"
|
||||
ReferencedContainer = "container:Pods.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
buildConfiguration = "Debug">
|
||||
<Testables>
|
||||
</Testables>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Debug"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
32
Pods/Pods.xcodeproj/xcuserdata/nataliaterlecka.xcuserdatad/xcschemes/xcschememanagement.plist
generated
Normal file
32
Pods/Pods.xcodeproj/xcuserdata/nataliaterlecka.xcuserdatad/xcschemes/xcschememanagement.plist
generated
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>Pods-cameraTests-Nimble.xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>Pods-cameraTests.xcscheme</key>
|
||||
<dict>
|
||||
<key>isShown</key>
|
||||
<false/>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>5450F12D18236260DBDC1426</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>F31DCF4BC1F75A477673D8D8</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.4.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
10
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble-Private.xcconfig
generated
Normal file
10
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble-Private.xcconfig
generated
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include "Pods-cameraTests-Nimble.xcconfig"
|
||||
CONFIGURATION_BUILD_DIR = $PODS_FRAMEWORK_BUILD_PATH
|
||||
FRAMEWORK_SEARCH_PATHS = "$PODS_FRAMEWORK_BUILD_PATH" ${PODS_CAMERATESTS_NIMBLE_FRAMEWORK_SEARCH_PATHS}
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Nimble" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Nimble"
|
||||
OTHER_LDFLAGS = ${PODS_CAMERATESTS_NIMBLE_OTHER_LDFLAGS} -ObjC
|
||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-cameraTests
|
||||
PODS_ROOT = ${SRCROOT}
|
||||
SKIP_INSTALL = YES
|
||||
5
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble-dummy.m
generated
Normal file
5
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble-dummy.m
generated
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
@interface PodsDummy_Pods_cameraTests_Nimble : NSObject
|
||||
@end
|
||||
@implementation PodsDummy_Pods_cameraTests_Nimble
|
||||
@end
|
||||
5
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble-prefix.pch
generated
Normal file
5
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble-prefix.pch
generated
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
|
||||
#import "Pods-cameraTests-environment.h"
|
||||
9
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble-umbrella.h
generated
Normal file
9
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble-umbrella.h
generated
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "Nimble.h"
|
||||
#import "DSL.h"
|
||||
#import "NMBExceptionCapture.h"
|
||||
|
||||
FOUNDATION_EXPORT double NimbleVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];
|
||||
|
||||
6
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble.modulemap
generated
Normal file
6
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble.modulemap
generated
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
framework module Nimble {
|
||||
umbrella header "Pods-cameraTests-Nimble-umbrella.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
2
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble.xcconfig
generated
Normal file
2
Pods/Target Support Files/Pods-cameraTests-Nimble/Pods-cameraTests-Nimble.xcconfig
generated
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
PODS_CAMERATESTS_NIMBLE_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(PLATFORM_DIR)/Developer/Library/Frameworks"
|
||||
PODS_CAMERATESTS_NIMBLE_OTHER_LDFLAGS = -framework "XCTest"
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.cocoapods.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>${CURRENT_PROJECT_VERSION}</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
</dict>
|
||||
</plist>
|
||||
208
Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests-acknowledgements.markdown
generated
Normal file
208
Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests-acknowledgements.markdown
generated
Normal file
|
|
@ -0,0 +1,208 @@
|
|||
# Acknowledgements
|
||||
This application makes use of the following third party libraries:
|
||||
|
||||
## Nimble
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2014 Quick Team
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Generated by CocoaPods - http://cocoapods.org
|
||||
238
Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests-acknowledgements.plist
generated
Normal file
238
Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests-acknowledgements.plist
generated
Normal file
|
|
@ -0,0 +1,238 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>PreferenceSpecifiers</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>This application makes use of the following third party libraries:</string>
|
||||
<key>Title</key>
|
||||
<string>Acknowledgements</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2014 Quick Team
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
</string>
|
||||
<key>Title</key>
|
||||
<string>Nimble</string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>FooterText</key>
|
||||
<string>Generated by CocoaPods - http://cocoapods.org</string>
|
||||
<key>Title</key>
|
||||
<string></string>
|
||||
<key>Type</key>
|
||||
<string>PSGroupSpecifier</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>StringsTable</key>
|
||||
<string>Acknowledgements</string>
|
||||
<key>Title</key>
|
||||
<string>Acknowledgements</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
@interface PodsDummy_Pods_cameraTests : NSObject
|
||||
@end
|
||||
@implementation PodsDummy_Pods_cameraTests
|
||||
@end
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
// To check if a library is compiled with CocoaPods you
|
||||
// can use the `COCOAPODS` macro definition which is
|
||||
// defined in the xcconfigs so it is available in
|
||||
// headers also when they are imported in the client
|
||||
// project.
|
||||
|
||||
|
||||
// Nimble
|
||||
#define COCOAPODS_POD_AVAILABLE_Nimble
|
||||
#define COCOAPODS_VERSION_MAJOR_Nimble 0
|
||||
#define COCOAPODS_VERSION_MINOR_Nimble 4
|
||||
#define COCOAPODS_VERSION_PATCH_Nimble 2
|
||||
|
||||
55
Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests-frameworks.sh
generated
Executable file
55
Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests-frameworks.sh
generated
Executable file
|
|
@ -0,0 +1,55 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
|
||||
|
||||
install_framework()
|
||||
{
|
||||
local source="${BUILT_PRODUCTS_DIR}/Pods-cameraTests/$1"
|
||||
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
|
||||
if [ -L "${source}" ]; then
|
||||
echo "Symlinked..."
|
||||
source=$(readlink "${source}")
|
||||
fi
|
||||
|
||||
# use filter instead of exclude so missing patterns dont' throw errors
|
||||
echo "rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" ${source} ${destination}"
|
||||
rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers/" --filter "- PrivateHeaders/" --filter "- Modules/" "${source}" "${destination}"
|
||||
# Resign the code if required by the build settings to avoid unstable apps
|
||||
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
|
||||
code_sign "${destination}/$1"
|
||||
fi
|
||||
|
||||
# Embed linked Swift runtime libraries
|
||||
local basename
|
||||
basename=$(echo $1 | sed -E s/\\..+// && exit ${PIPESTATUS[0]})
|
||||
local swift_runtime_libs
|
||||
swift_runtime_libs=$(xcrun otool -LX "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/$1/${basename}" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]})
|
||||
for lib in $swift_runtime_libs; do
|
||||
echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
|
||||
rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
|
||||
if [ "${CODE_SIGNING_REQUIRED}" == "YES" ]; then
|
||||
code_sign "${destination}/${lib}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Signs a framework with the provided identity
|
||||
code_sign() {
|
||||
# Use the current code_sign_identitiy
|
||||
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
|
||||
echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements $1"
|
||||
/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1"
|
||||
}
|
||||
|
||||
|
||||
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||
install_framework 'Nimble.framework'
|
||||
fi
|
||||
if [[ "$CONFIGURATION" == "Release" ]]; then
|
||||
install_framework 'Nimble.framework'
|
||||
fi
|
||||
93
Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests-resources.sh
generated
Executable file
93
Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests-resources.sh
generated
Executable file
|
|
@ -0,0 +1,93 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
|
||||
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
|
||||
> "$RESOURCES_TO_COPY"
|
||||
|
||||
XCASSET_FILES=()
|
||||
|
||||
realpath() {
|
||||
DIRECTORY=$(cd "${1%/*}" && pwd)
|
||||
FILENAME="${1##*/}"
|
||||
echo "$DIRECTORY/$FILENAME"
|
||||
}
|
||||
|
||||
install_resource()
|
||||
{
|
||||
case $1 in
|
||||
*.storyboard)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
|
||||
;;
|
||||
*.xib)
|
||||
echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}"
|
||||
ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}"
|
||||
;;
|
||||
*.framework)
|
||||
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
|
||||
;;
|
||||
*.xcdatamodel)
|
||||
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\""
|
||||
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom"
|
||||
;;
|
||||
*.xcdatamodeld)
|
||||
echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\""
|
||||
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd"
|
||||
;;
|
||||
*.xcmappingmodel)
|
||||
echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\""
|
||||
xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm"
|
||||
;;
|
||||
*.xcassets)
|
||||
ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1")
|
||||
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
|
||||
;;
|
||||
/*)
|
||||
echo "$1"
|
||||
echo "$1" >> "$RESOURCES_TO_COPY"
|
||||
;;
|
||||
*)
|
||||
echo "${PODS_ROOT}/$1"
|
||||
echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
if [[ "${ACTION}" == "install" ]]; then
|
||||
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
fi
|
||||
rm -f "$RESOURCES_TO_COPY"
|
||||
|
||||
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
|
||||
then
|
||||
case "${TARGETED_DEVICE_FAMILY}" in
|
||||
1,2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
|
||||
;;
|
||||
1)
|
||||
TARGET_DEVICE_ARGS="--target-device iphone"
|
||||
;;
|
||||
2)
|
||||
TARGET_DEVICE_ARGS="--target-device ipad"
|
||||
;;
|
||||
*)
|
||||
TARGET_DEVICE_ARGS="--target-device mac"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
|
||||
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
|
||||
while read line; do
|
||||
if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
|
||||
XCASSET_FILES+=("$line")
|
||||
fi
|
||||
done <<<"$OTHER_XCASSETS"
|
||||
|
||||
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
||||
fi
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
|
||||
|
||||
FOUNDATION_EXPORT double Pods_cameraTestsVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char Pods_cameraTestsVersionString[];
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/Nimble.framework/Headers"
|
||||
OTHER_LDFLAGS = $(inherited) -ObjC -framework "Nimble"
|
||||
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
|
||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-cameraTests
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
framework module Pods_cameraTests {
|
||||
umbrella header "Pods-cameraTests-umbrella.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
||||
9
Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests.release.xcconfig
generated
Normal file
9
Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests.release.xcconfig
generated
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_FRAMEWORK_BUILD_PATH"
|
||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||
OTHER_CFLAGS = $(inherited) -iquote "$PODS_FRAMEWORK_BUILD_PATH/Nimble.framework/Headers"
|
||||
OTHER_LDFLAGS = $(inherited) -ObjC -framework "Nimble"
|
||||
OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS)
|
||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-cameraTests
|
||||
PODS_ROOT = ${SRCROOT}/Pods
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
453228F81AC2AD9A00A7EE76 /* cameraTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 453228F71AC2AD9A00A7EE76 /* cameraTests.swift */; };
|
||||
454C1F4719E82E2500C81915 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 454C1F4619E82E2500C81915 /* AppDelegate.swift */; };
|
||||
454C1F4919E82E2500C81915 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 454C1F4819E82E2500C81915 /* ViewController.swift */; };
|
||||
454C1F4C19E82E2500C81915 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 454C1F4A19E82E2500C81915 /* Main.storyboard */; };
|
||||
|
|
@ -14,9 +15,24 @@
|
|||
454C1F5119E82E2500C81915 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 454C1F4F19E82E2500C81915 /* LaunchScreen.xib */; };
|
||||
454C1F6719E8316A00C81915 /* CameraManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 454C1F6619E8316A00C81915 /* CameraManager.swift */; };
|
||||
45A23C181A656BDC00FB48F3 /* ImageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45A23C171A656BDC00FB48F3 /* ImageViewController.swift */; };
|
||||
6ECB10078678DAFF23CE9882 /* Pods_cameraTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 567B01E9DBA65A1828DFB549 /* Pods_cameraTests.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
453228F91AC2AD9A00A7EE76 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 454C1F3919E82E2500C81915 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 454C1F4019E82E2500C81915;
|
||||
remoteInfo = camera;
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
00EB71FFBFC984F6002139C5 /* Pods-cameraTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-cameraTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests.release.xcconfig"; sourceTree = "<group>"; };
|
||||
453228F31AC2AD9A00A7EE76 /* cameraTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = cameraTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
453228F61AC2AD9A00A7EE76 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
453228F71AC2AD9A00A7EE76 /* cameraTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = cameraTests.swift; sourceTree = "<group>"; };
|
||||
454C1F4119E82E2500C81915 /* camera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = camera.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
454C1F4519E82E2500C81915 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
454C1F4619E82E2500C81915 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
|
|
@ -26,9 +42,19 @@
|
|||
454C1F5019E82E2500C81915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = "<group>"; };
|
||||
454C1F6619E8316A00C81915 /* CameraManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraManager.swift; sourceTree = "<group>"; };
|
||||
45A23C171A656BDC00FB48F3 /* ImageViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageViewController.swift; sourceTree = "<group>"; };
|
||||
567B01E9DBA65A1828DFB549 /* Pods_cameraTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_cameraTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
98EEB93F92AD5EBAD7397952 /* Pods-cameraTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-cameraTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests.debug.xcconfig"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
453228F01AC2AD9A00A7EE76 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6ECB10078678DAFF23CE9882 /* Pods_cameraTests.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
454C1F3E19E82E2500C81915 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
|
@ -39,11 +65,39 @@
|
|||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
029DB5AC105A36F5E8CCF250 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
567B01E9DBA65A1828DFB549 /* Pods_cameraTests.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
453228F41AC2AD9A00A7EE76 /* cameraTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
453228F71AC2AD9A00A7EE76 /* cameraTests.swift */,
|
||||
453228F51AC2AD9A00A7EE76 /* Supporting Files */,
|
||||
);
|
||||
path = cameraTests;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
453228F51AC2AD9A00A7EE76 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
453228F61AC2AD9A00A7EE76 /* Info.plist */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
454C1F3819E82E2500C81915 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
454C1F4319E82E2500C81915 /* camera */,
|
||||
453228F41AC2AD9A00A7EE76 /* cameraTests */,
|
||||
454C1F4219E82E2500C81915 /* Products */,
|
||||
5E1F459AEBEF8047447D9A0B /* Pods */,
|
||||
029DB5AC105A36F5E8CCF250 /* Frameworks */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
|
|
@ -51,6 +105,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
454C1F4119E82E2500C81915 /* camera.app */,
|
||||
453228F31AC2AD9A00A7EE76 /* cameraTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -86,9 +141,39 @@
|
|||
name = "Example app view controllers";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5E1F459AEBEF8047447D9A0B /* Pods */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
98EEB93F92AD5EBAD7397952 /* Pods-cameraTests.debug.xcconfig */,
|
||||
00EB71FFBFC984F6002139C5 /* Pods-cameraTests.release.xcconfig */,
|
||||
);
|
||||
name = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
453228F21AC2AD9A00A7EE76 /* cameraTests */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 453228FB1AC2AD9A00A7EE76 /* Build configuration list for PBXNativeTarget "cameraTests" */;
|
||||
buildPhases = (
|
||||
ABCF975EEE35FA00EBD1E571 /* Check Pods Manifest.lock */,
|
||||
453228EF1AC2AD9A00A7EE76 /* Sources */,
|
||||
453228F01AC2AD9A00A7EE76 /* Frameworks */,
|
||||
453228F11AC2AD9A00A7EE76 /* Resources */,
|
||||
71784D80FA07AB38044C5279 /* Embed Pods Frameworks */,
|
||||
673474D5F20A1206A1EF8E0D /* Copy Pods Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
453228FA1AC2AD9A00A7EE76 /* PBXTargetDependency */,
|
||||
);
|
||||
name = cameraTests;
|
||||
productName = cameraTests;
|
||||
productReference = 453228F31AC2AD9A00A7EE76 /* cameraTests.xctest */;
|
||||
productType = "com.apple.product-type.bundle.unit-test";
|
||||
};
|
||||
454C1F4019E82E2500C81915 /* camera */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 454C1F6019E82E2500C81915 /* Build configuration list for PBXNativeTarget "camera" */;
|
||||
|
|
@ -115,6 +200,10 @@
|
|||
LastUpgradeCheck = 0600;
|
||||
ORGANIZATIONNAME = imaginaryCloud;
|
||||
TargetAttributes = {
|
||||
453228F21AC2AD9A00A7EE76 = {
|
||||
CreatedOnToolsVersion = 6.2;
|
||||
TestTargetID = 454C1F4019E82E2500C81915;
|
||||
};
|
||||
454C1F4019E82E2500C81915 = {
|
||||
CreatedOnToolsVersion = 6.0.1;
|
||||
};
|
||||
|
|
@ -134,11 +223,19 @@
|
|||
projectRoot = "";
|
||||
targets = (
|
||||
454C1F4019E82E2500C81915 /* camera */,
|
||||
453228F21AC2AD9A00A7EE76 /* cameraTests */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
453228F11AC2AD9A00A7EE76 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
454C1F3F19E82E2500C81915 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
|
@ -151,7 +248,63 @@
|
|||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
673474D5F20A1206A1EF8E0D /* Copy Pods Resources */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Copy Pods Resources";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests-resources.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
71784D80FA07AB38044C5279 /* Embed Pods Frameworks */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-cameraTests/Pods-cameraTests-frameworks.sh\"\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
ABCF975EEE35FA00EBD1E571 /* Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Check Pods Manifest.lock";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
453228EF1AC2AD9A00A7EE76 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
453228F81AC2AD9A00A7EE76 /* cameraTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
454C1F3D19E82E2500C81915 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
|
@ -165,6 +318,14 @@
|
|||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
453228FA1AC2AD9A00A7EE76 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 454C1F4019E82E2500C81915 /* camera */;
|
||||
targetProxy = 453228F91AC2AD9A00A7EE76 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
454C1F4A19E82E2500C81915 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
|
|
@ -185,6 +346,45 @@
|
|||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
453228FC1AC2AD9A00A7EE76 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 98EEB93F92AD5EBAD7397952 /* Pods-cameraTests.debug.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(SDKROOT)/Developer/Library/Frameworks",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = cameraTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/camera.app/camera";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
453228FD1AC2AD9A00A7EE76 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 00EB71FFBFC984F6002139C5 /* Pods-cameraTests.release.xcconfig */;
|
||||
buildSettings = {
|
||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(SDKROOT)/Developer/Library/Frameworks",
|
||||
"$(inherited)",
|
||||
);
|
||||
INFOPLIST_FILE = cameraTests/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/camera.app/camera";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
454C1F5E19E82E2500C81915 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
|
|
@ -275,6 +475,7 @@
|
|||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer: Natalia Terlecki (8B96NL57N3)";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: Natalia Terlecki (8B96NL57N3)";
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
INFOPLIST_FILE = camera/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
|
|
@ -289,6 +490,7 @@
|
|||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_IDENTITY = "iPhone Distribution: IndexSquare LDA (QM7HJTY23M)";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: IndexSquare LDA (QM7HJTY23M)";
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
INFOPLIST_FILE = camera/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
|
||||
|
|
@ -300,6 +502,15 @@
|
|||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
453228FB1AC2AD9A00A7EE76 /* Build configuration list for PBXNativeTarget "cameraTests" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
453228FC1AC2AD9A00A7EE76 /* Debug */,
|
||||
453228FD1AC2AD9A00A7EE76 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
454C1F3C19E82E2500C81915 /* Build configuration list for PBXProject "camera" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -28,7 +28,7 @@
|
|||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "454C1F5519E82E2500C81915"
|
||||
BlueprintIdentifier = "453228F21AC2AD9A00A7EE76"
|
||||
BuildableName = "cameraTests.xctest"
|
||||
BlueprintName = "cameraTests"
|
||||
ReferencedContainer = "container:camera.xcodeproj">
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
skipped = "NO">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "454C1F5519E82E2500C81915"
|
||||
BlueprintIdentifier = "453228F21AC2AD9A00A7EE76"
|
||||
BuildableName = "cameraTests.xctest"
|
||||
BlueprintName = "cameraTests"
|
||||
ReferencedContainer = "container:camera.xcodeproj">
|
||||
|
|
@ -72,7 +72,8 @@
|
|||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "454C1F4019E82E2500C81915"
|
||||
|
|
@ -90,7 +91,8 @@
|
|||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable>
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "454C1F4019E82E2500C81915"
|
||||
|
|
@ -2,4 +2,22 @@
|
|||
<Bucket
|
||||
type = "1"
|
||||
version = "2.0">
|
||||
<Breakpoints>
|
||||
<BreakpointProxy
|
||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
||||
<BreakpointContent
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "camera/CameraManager.swift"
|
||||
timestampString = "448886805.389877"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "296"
|
||||
endingLineNumber = "296"
|
||||
landmarkName = "stopAndRemoveCaptureSession()"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
</Bucket>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>camera.xcscheme</key>
|
||||
<key>camera.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
|
|
@ -12,6 +12,16 @@
|
|||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>453228E31AC2AAFA00A7EE76</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>453228F21AC2AD9A00A7EE76</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>454C1F4019E82E2500C81915</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "group:camera.xcodeproj">
|
||||
</FileRef>
|
||||
<FileRef
|
||||
location = "group:Pods/Pods.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||
<false/>
|
||||
<key>IDESourceControlProjectIdentifier</key>
|
||||
<string>9D40B2A5-FAFF-4F6F-912C-8C53EFC55C8E</string>
|
||||
<key>IDESourceControlProjectName</key>
|
||||
<string>camera</string>
|
||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||
<dict>
|
||||
<key>E1D0A3AE6B49B031DF6A25973E5414F28D2A575A</key>
|
||||
<string>https://github.com/imaginary-cloud/CameraManager.git</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectPath</key>
|
||||
<string>camera.xcworkspace</string>
|
||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||
<dict>
|
||||
<key>E1D0A3AE6B49B031DF6A25973E5414F28D2A575A</key>
|
||||
<string>..</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectURL</key>
|
||||
<string>https://github.com/imaginary-cloud/CameraManager.git</string>
|
||||
<key>IDESourceControlProjectVersion</key>
|
||||
<integer>111</integer>
|
||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||
<string>E1D0A3AE6B49B031DF6A25973E5414F28D2A575A</string>
|
||||
<key>IDESourceControlProjectWCConfigurations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||
<string>public.vcs.git</string>
|
||||
<key>IDESourceControlWCCIdentifierKey</key>
|
||||
<string>E1D0A3AE6B49B031DF6A25973E5414F28D2A575A</string>
|
||||
<key>IDESourceControlWCCName</key>
|
||||
<string>CameraManager</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -63,7 +63,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
public var hasFrontCamera: Bool = {
|
||||
let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo)
|
||||
for device in devices {
|
||||
let captureDevice = device as AVCaptureDevice
|
||||
let captureDevice = device as! AVCaptureDevice
|
||||
if (captureDevice.position == .Front) {
|
||||
return true
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
public var hasFlash: Bool = {
|
||||
let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo)
|
||||
for device in devices {
|
||||
let captureDevice = device as AVCaptureDevice
|
||||
let captureDevice = device as! AVCaptureDevice
|
||||
if (captureDevice.position == .Back) {
|
||||
return captureDevice.hasFlash
|
||||
}
|
||||
|
|
@ -91,29 +91,29 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
set(newCameraDevice) {
|
||||
if let validCaptureSession = self.captureSession {
|
||||
validCaptureSession.beginConfiguration()
|
||||
let inputs = validCaptureSession.inputs as [AVCaptureInput]
|
||||
let inputs = validCaptureSession.inputs as! [AVCaptureInput]
|
||||
|
||||
switch newCameraDevice {
|
||||
case .Front:
|
||||
if self.hasFrontCamera {
|
||||
if let validBackDevice = self.rearCamera? {
|
||||
if let validBackDevice = self.rearCamera {
|
||||
if contains(inputs, validBackDevice) {
|
||||
validCaptureSession.removeInput(validBackDevice)
|
||||
}
|
||||
}
|
||||
if let validFrontDevice = self.frontCamera? {
|
||||
if let validFrontDevice = self.frontCamera {
|
||||
if !contains(inputs, validFrontDevice) {
|
||||
validCaptureSession.addInput(validFrontDevice)
|
||||
}
|
||||
}
|
||||
}
|
||||
case .Back:
|
||||
if let validFrontDevice = self.frontCamera? {
|
||||
if let validFrontDevice = self.frontCamera {
|
||||
if contains(inputs, validFrontDevice) {
|
||||
validCaptureSession.removeInput(validFrontDevice)
|
||||
}
|
||||
}
|
||||
if let validBackDevice = self.rearCamera? {
|
||||
if let validBackDevice = self.rearCamera {
|
||||
if !contains(inputs, validBackDevice) {
|
||||
validCaptureSession.addInput(validBackDevice)
|
||||
}
|
||||
|
|
@ -212,8 +212,8 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
public func addPreviewLayerToView(view: UIView, newCameraOutputMode: CameraOutputMode) -> CameraState
|
||||
{
|
||||
if self._canLoadCamera() {
|
||||
if let validEmbedingView = self.embedingView? {
|
||||
if let validPreviewLayer = self.previewLayer? {
|
||||
if let validEmbedingView = self.embedingView {
|
||||
if let validPreviewLayer = self.previewLayer {
|
||||
validPreviewLayer.removeFromSuperlayer()
|
||||
}
|
||||
}
|
||||
|
|
@ -268,7 +268,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
*/
|
||||
public func resumeCaptureSession()
|
||||
{
|
||||
if let validCaptureSession = self.captureSession? {
|
||||
if let validCaptureSession = self.captureSession {
|
||||
if !validCaptureSession.running && self.cameraIsSetup {
|
||||
validCaptureSession.startRunning()
|
||||
self._startFollowingDeviceOrientation()
|
||||
|
|
@ -279,7 +279,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
self.stopAndRemoveCaptureSession()
|
||||
}
|
||||
self._setupCamera({Void -> Void in
|
||||
if let validEmbedingView = self.embedingView? {
|
||||
if let validEmbedingView = self.embedingView {
|
||||
self._addPreeviewLayerToView(validEmbedingView)
|
||||
}
|
||||
self._startFollowingDeviceOrientation()
|
||||
|
|
@ -316,7 +316,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
if self.cameraOutputMode == .StillImage {
|
||||
dispatch_async(self.sessionQueue, {
|
||||
self._getStillImageOutput().captureStillImageAsynchronouslyFromConnection(self._getStillImageOutput().connectionWithMediaType(AVMediaTypeVideo), completionHandler: { [weak self] (sample: CMSampleBuffer!, error: NSError!) -> Void in
|
||||
if (error? != nil) {
|
||||
if (error != nil) {
|
||||
dispatch_async(dispatch_get_main_queue(), {
|
||||
if let weakSelf = self {
|
||||
weakSelf._show(NSLocalizedString("Error", comment:""), message: error.localizedDescription)
|
||||
|
|
@ -327,10 +327,10 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
let imageData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(sample)
|
||||
if let weakSelf = self {
|
||||
if weakSelf.writeFilesToPhoneLibrary {
|
||||
if let validLibrary = weakSelf.library? {
|
||||
if let validLibrary = weakSelf.library {
|
||||
validLibrary.writeImageDataToSavedPhotosAlbum(imageData, metadata:nil, completionBlock: {
|
||||
(picUrl, error) -> Void in
|
||||
if (error? != nil) {
|
||||
if (error != nil) {
|
||||
dispatch_async(dispatch_get_main_queue(), {
|
||||
weakSelf._show(NSLocalizedString("Error", comment:""), message: error.localizedDescription)
|
||||
})
|
||||
|
|
@ -425,7 +425,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
if (error != nil) {
|
||||
self._show(NSLocalizedString("Unable to save video to the iPhone", comment:""), message: error.localizedDescription)
|
||||
} else {
|
||||
if let validLibrary = self.library? {
|
||||
if let validLibrary = self.library {
|
||||
if self.writeFilesToPhoneLibrary {
|
||||
validLibrary.writeVideoAtPathToSavedPhotosAlbum(outputFileURL, completionBlock: { (assetURL: NSURL?, error: NSError?) -> Void in
|
||||
if (error != nil) {
|
||||
|
|
@ -450,7 +450,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
self.captureSession?.beginConfiguration()
|
||||
let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo)
|
||||
for device in devices {
|
||||
let captureDevice = device as AVCaptureDevice
|
||||
let captureDevice = device as! AVCaptureDevice
|
||||
if (captureDevice.position == AVCaptureDevicePosition.Back) {
|
||||
let avTorchMode = AVCaptureTorchMode(rawValue: flashMode.rawValue)
|
||||
if (captureDevice.isTorchModeSupported(avTorchMode!)) {
|
||||
|
|
@ -517,19 +517,19 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
case .VideoOnly, .VideoWithMic:
|
||||
currentConnection = self._getMovieOutput().connectionWithMediaType(AVMediaTypeVideo)
|
||||
}
|
||||
if let validPreviewLayer = self.previewLayer? {
|
||||
if let validPreviewLayerConnection = validPreviewLayer.connection? {
|
||||
if let validPreviewLayer = self.previewLayer {
|
||||
if let validPreviewLayerConnection = validPreviewLayer.connection {
|
||||
if validPreviewLayerConnection.supportsVideoOrientation {
|
||||
validPreviewLayerConnection.videoOrientation = self._currentVideoOrientation()
|
||||
}
|
||||
}
|
||||
if let validOutputLayerConnection = currentConnection? {
|
||||
if let validOutputLayerConnection = currentConnection {
|
||||
if validOutputLayerConnection.supportsVideoOrientation {
|
||||
validOutputLayerConnection.videoOrientation = self._currentVideoOrientation()
|
||||
}
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), { () -> Void in
|
||||
if let validEmbedingView = self.embedingView? {
|
||||
if let validEmbedingView = self.embedingView {
|
||||
validPreviewLayer.frame = validEmbedingView.bounds
|
||||
}
|
||||
})
|
||||
|
|
@ -559,7 +559,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
self.captureSession = AVCaptureSession()
|
||||
|
||||
dispatch_async(sessionQueue, {
|
||||
if let validCaptureSession = self.captureSession? {
|
||||
if let validCaptureSession = self.captureSession {
|
||||
validCaptureSession.beginConfiguration()
|
||||
validCaptureSession.sessionPreset = AVCaptureSessionPresetHigh
|
||||
self._addVideoInput()
|
||||
|
|
@ -630,7 +630,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
{
|
||||
var error: NSError?
|
||||
|
||||
if (self.frontCamera? == nil) || (self.rearCamera? == nil) {
|
||||
if (self.frontCamera == nil) || (self.rearCamera == nil) {
|
||||
var videoFrontDevice: AVCaptureDevice?
|
||||
var videoBackDevice: AVCaptureDevice?
|
||||
for device: AnyObject in AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) {
|
||||
|
|
@ -640,17 +640,17 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
videoFrontDevice = device as? AVCaptureDevice
|
||||
}
|
||||
}
|
||||
if (self.frontCamera? == nil) {
|
||||
if let validVideoFrontDevice = videoFrontDevice? {
|
||||
self.frontCamera = AVCaptureDeviceInput.deviceInputWithDevice(validVideoFrontDevice, error: &error) as AVCaptureDeviceInput
|
||||
if (self.frontCamera == nil) {
|
||||
if let validVideoFrontDevice = videoFrontDevice {
|
||||
self.frontCamera = AVCaptureDeviceInput.deviceInputWithDevice(validVideoFrontDevice, error: &error) as! AVCaptureDeviceInput
|
||||
}
|
||||
}
|
||||
if (self.rearCamera? == nil) {
|
||||
if let validVideoBackDevice = videoBackDevice? {
|
||||
self.rearCamera = AVCaptureDeviceInput.deviceInputWithDevice(validVideoBackDevice, error: &error) as AVCaptureDeviceInput
|
||||
if (self.rearCamera == nil) {
|
||||
if let validVideoBackDevice = videoBackDevice {
|
||||
self.rearCamera = AVCaptureDeviceInput.deviceInputWithDevice(validVideoBackDevice, error: &error) as! AVCaptureDeviceInput
|
||||
}
|
||||
}
|
||||
if let validError = error? {
|
||||
if let validError = error {
|
||||
self._show(NSLocalizedString("Device setup error occured", comment:""), message: validError.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
|
@ -663,7 +663,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
var error: NSError?
|
||||
let micDevice:AVCaptureDevice = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeAudio);
|
||||
self.mic = AVCaptureDeviceInput.deviceInputWithDevice(micDevice, error: &error) as? AVCaptureDeviceInput;
|
||||
if let errorHappened = error? {
|
||||
if let errorHappened = error {
|
||||
self.mic = nil
|
||||
self._show(NSLocalizedString("Mic error", comment:""), message: errorHappened.description)
|
||||
}
|
||||
|
|
@ -678,15 +678,15 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
// remove current setting
|
||||
switch _cameraOutputMode {
|
||||
case .StillImage:
|
||||
if let validStillImageOutput = self.stillImageOutput? {
|
||||
if let validStillImageOutput = self.stillImageOutput {
|
||||
self.captureSession?.removeOutput(validStillImageOutput)
|
||||
}
|
||||
case .VideoOnly, .VideoWithMic:
|
||||
if let validMovieOutput = self.movieOutput? {
|
||||
if let validMovieOutput = self.movieOutput {
|
||||
self.captureSession?.removeOutput(validMovieOutput)
|
||||
}
|
||||
if _cameraOutputMode == .VideoWithMic {
|
||||
if let validMic = self.mic? {
|
||||
if let validMic = self.mic {
|
||||
self.captureSession?.removeInput(validMic)
|
||||
}
|
||||
}
|
||||
|
|
@ -699,7 +699,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
if (self.stillImageOutput == nil) {
|
||||
self._setupOutputs()
|
||||
}
|
||||
if let validStillImageOutput = self.stillImageOutput? {
|
||||
if let validStillImageOutput = self.stillImageOutput {
|
||||
self.captureSession?.addOutput(validStillImageOutput)
|
||||
}
|
||||
case .VideoOnly, .VideoWithMic:
|
||||
|
|
@ -709,7 +709,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
if (self.mic == nil) {
|
||||
self._setupMic()
|
||||
}
|
||||
if let validMic = self.mic? {
|
||||
if let validMic = self.mic {
|
||||
self.captureSession?.addInput(validMic)
|
||||
}
|
||||
}
|
||||
|
|
@ -735,7 +735,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
|
||||
private func _setupPreviewLayer()
|
||||
{
|
||||
if let validCaptureSession = self.captureSession? {
|
||||
if let validCaptureSession = self.captureSession {
|
||||
self.previewLayer = AVCaptureVideoPreviewLayer(session: validCaptureSession)
|
||||
self.previewLayer?.videoGravity = AVLayerVideoGravityResizeAspectFill
|
||||
}
|
||||
|
|
@ -746,7 +746,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
self.captureSession?.beginConfiguration()
|
||||
let devices = AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo)
|
||||
for device in devices {
|
||||
let captureDevice = device as AVCaptureDevice
|
||||
let captureDevice = device as! AVCaptureDevice
|
||||
if (captureDevice.position == AVCaptureDevicePosition.Back) {
|
||||
let avFlashMode = AVCaptureFlashMode(rawValue: flashMode.rawValue)
|
||||
if (captureDevice.isFlashModeSupported(avFlashMode!)) {
|
||||
|
|
@ -761,7 +761,7 @@ public class CameraManager: NSObject, AVCaptureFileOutputRecordingDelegate {
|
|||
|
||||
private func _updateCameraQualityMode(newCameraOutputQuality: CameraOutputQuality)
|
||||
{
|
||||
if let validCaptureSession = self.captureSession? {
|
||||
if let validCaptureSession = self.captureSession {
|
||||
var sessionPreset = AVCaptureSessionPresetLow
|
||||
switch (newCameraOutputQuality) {
|
||||
case CameraOutputQuality.Low:
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class ImageViewController: UIViewController {
|
|||
super.viewDidLoad()
|
||||
self.navigationController?.navigationBar.hidden = false
|
||||
|
||||
if let validImage = self.image? {
|
||||
if let validImage = self.image {
|
||||
self.imageView.image = validImage
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string></string>
|
||||
<string>com.imaginarycloud.camera</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class ViewController: UIViewController {
|
|||
self.cameraManager.capturePictureWithCompletition({ (image, error) -> Void in
|
||||
let vc: ImageViewController? = self.storyboard?.instantiateViewControllerWithIdentifier("ImageVC") as? ImageViewController
|
||||
if let validVC: ImageViewController = vc {
|
||||
if let capturedImage = image? {
|
||||
if let capturedImage = image {
|
||||
validVC.image = capturedImage
|
||||
self.navigationController?.pushViewController(validVC, animated: true)
|
||||
}
|
||||
|
|
@ -110,7 +110,7 @@ class ViewController: UIViewController {
|
|||
} else {
|
||||
self.cameraManager.stopRecordingVideo({ (videoURL, error) -> Void in
|
||||
println(videoURL)
|
||||
if let errorOccured = error? {
|
||||
if let errorOccured = error {
|
||||
UIAlertView(title: "Error occured", message: errorOccured.localizedDescription, delegate: nil, cancelButtonTitle: "OK").show()
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.imaginarycloud.$(PRODUCT_NAME:rfc1034identifier)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
import UIKit
|
||||
import XCTest
|
||||
|
||||
class cameraTests: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
func testExample() {
|
||||
// This is an example of a functional test case.
|
||||
XCTAssert(true, "Pass")
|
||||
}
|
||||
|
||||
func testPerformanceExample() {
|
||||
// This is an example of a performance test case.
|
||||
self.measureBlock() {
|
||||
// Put the code you want to measure the time of here.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
#change those according to your project settings
|
||||
|
||||
$workspaceName = 'camera.xcworkspace'
|
||||
$schemeName = 'camera'
|
||||
$releaseProvisioningProfileName = ''
|
||||
$nameOfTheSimulatorToTest = 'iPad Retina'
|
||||
|
||||
|
||||
#you can create API key here: https://rink.hockeyapp.net/manage/auth_tokens
|
||||
|
||||
$hockeyAppApiKey = ''
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# The rest will just do the magic for you :-)
|
||||
|
||||
def build()
|
||||
putStatusInBlue('BUILDING')
|
||||
|
||||
removeOldFiles
|
||||
if buildFromIpaBuild then
|
||||
putStatusInGreen('SUCESS')
|
||||
else
|
||||
putStatusInRed('FAILED, TRYING XCODEBUILD')
|
||||
|
||||
if buildFromXcodeBuild then
|
||||
putStatusInGreen('SUCESS')
|
||||
|
||||
putStatusInBlue('UPLOADING TO HOCKEYAPP')
|
||||
|
||||
system('ipa distribute:hockeyapp -a ' + $hockeyAppApiKey + ' -d ' + $dsymZippedName)
|
||||
else
|
||||
putStatusInRed('EVERYTHING FAILED')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def buildFromIpaBuild()
|
||||
putStatusInBlue('BUILDING WITH IPA BUILD')
|
||||
|
||||
if system('ipa build -m "' + $releaseProvisioningProfileName + '" --workspace ' + $workspaceName + '" --scheme ' + $schemeName) then
|
||||
system('ipa distribute:hockeyapp -a ' + $hockeyAppApiKey)
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
def buildFromXcodeBuild()
|
||||
|
||||
putStatusInBlue('BUILDING WITH XCODEBUILD')
|
||||
|
||||
if system('xcodebuild clean archive -workspace ' + $workspaceName + ' -scheme ' + $schemeName + ' -archivePath ' + $archivePath) then
|
||||
putStatusInBlue('EXPORTING IPA')
|
||||
|
||||
if system('xcodebuild -exportArchive -archivePath ' + $archivePath + ' -exportPath ' + $schemeName + ' -exportFormat ipa -exportProvisioningProfile "' + $releaseProvisioningProfileName + '"') then
|
||||
|
||||
system('zip -r ' + $dsymZippedName + ' ' + $dsymPath)
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
def removeOldFiles()
|
||||
if system('test -d ' + $archivePath) then
|
||||
putStatusInBlue('REMOVING OLD ARCHIVE FILE')
|
||||
system('rm -R' + $archivePath)
|
||||
end
|
||||
if system('test -f ' + $schemeName + '.ipa') then
|
||||
putStatusInBlue('REMOVING OLD IPA FILE')
|
||||
system('rm ' + $schemeName + '.ipa')
|
||||
end
|
||||
if system('test -f ' + $dsymZippedName) then
|
||||
putStatusInBlue('REMOVING OLD DSYM FILE')
|
||||
system('rm ' + $dsymZippedName)
|
||||
end
|
||||
end
|
||||
|
||||
def putStatusInRed(status)
|
||||
puts " "
|
||||
puts ">>>>>>>> ".red + status.red + " <<<<<<<<".red
|
||||
puts " "
|
||||
end
|
||||
|
||||
def putStatusInBlue(status)
|
||||
puts " "
|
||||
puts ">>>>>>>> ".blue + status.blue + " <<<<<<<<".blue
|
||||
puts " "
|
||||
end
|
||||
|
||||
def putStatusInGreen(status)
|
||||
puts " "
|
||||
puts ">>>>>>>> ".green + status.green + " <<<<<<<<".green
|
||||
puts " "
|
||||
end
|
||||
|
||||
class String
|
||||
def red; "\033[31m#{self}\033[0m" end
|
||||
def green; "\033[32m#{self}\033[0m" end
|
||||
def blue; "\033[34m#{self}\033[0m" end
|
||||
end
|
||||
|
||||
|
||||
$archivePath = $schemeName + '.xcarchive'
|
||||
$dsymZippedName = $schemeName + '.app.dSYM.zip'
|
||||
$dsymPath = $archivePath + '/dSYMs/' + $schemeName + '.app.dSYM'
|
||||
|
||||
putStatusInBlue('TESTING')
|
||||
|
||||
if system('xctool -workspace ' + $workspaceName + ' -scheme ' + $schemeName + ' -sdk iphonesimulator test') then
|
||||
build
|
||||
else
|
||||
putStatusInRed('XCTOOL FAILED - TRYING XCODEBUILD')
|
||||
|
||||
if system('xcodebuild clean test -scheme ' + $schemeName + ' -workspace ' + $workspaceName + ' -destination \'platform=iOS Simulator,name=' + $nameOfTheSimulatorToTest + '\'') then
|
||||
build
|
||||
else
|
||||
putStatusInRed('XCODEBUILD TEST FAILED')
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue