-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #150 from sharplet/as-swift-error-bridging
Support Swift bridging for RACSignalError using NS_ERROR_ENUM
- Loading branch information
Showing
16 changed files
with
222 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
github "Quick/Nimble" "v7.0.2" | ||
github "Quick/Nimble" "v7.3.1" | ||
github "Quick/Quick" "v1.2.0" | ||
github "jspahrsummers/xcconfigs" "3d9d99634cae6d586e272543d527681283b33eb0" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// Deprecations+Removals.swift | ||
// ReactiveObjC | ||
// | ||
// Created by Adam Sharp on 26/12/18. | ||
// Copyright © 2018 GitHub. All rights reserved. | ||
// | ||
|
||
@available(*, deprecated, renamed: "RACSignalError.notEnabled") | ||
public let RACCommandErrorNotEnabled = RACCommandError.notEnabled.rawValue | ||
|
||
@available(*, deprecated, renamed: "RACSignalError.methodSwizzlingRace") | ||
public let RACSelectorSignalErrorMethodSwizzlingRace = RACSelectorSignalError.methodSwizzlingRace | ||
|
||
@available(*, deprecated, renamed: "RACSignalError.noMatchingCase") | ||
public let RACSignalErrorNoMatchingCase = RACSignalError.noMatchingCase.rawValue | ||
|
||
@available(*, deprecated, renamed: "RACSignalError.timedOut") | ||
public let RACSignalErrorTimedOut = RACSignalError.timedOut.rawValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Quick | ||
import Nimble | ||
import ReactiveObjC | ||
|
||
final class RACSwiftBridgingSpec: QuickSpec { | ||
override func spec() { | ||
describe("RACCommandError") { | ||
it("bridges RACCommandErrorNotEnabled to a Swift error code") { | ||
let error: Error = NSError(domain: RACCommandErrorDomain, code: 1) | ||
expect(RACCommandError.notEnabled ~= error).to(beTrue()) | ||
} | ||
} | ||
|
||
describe("RACSelectorSignalError") { | ||
it("bridges RACSelectorSignalErrorMethodSwizzlingRace to a Swift error code") { | ||
let error: Error = NSError(domain: RACSelectorSignalErrorDomain, code: 1) | ||
expect(RACSelectorSignalError.methodSwizzlingRace ~= error).to(beTrue()) | ||
} | ||
} | ||
|
||
describe("RACSignalError") { | ||
it("bridges RACSignalErrorTimedOut to a Swift error code") { | ||
let error: Error = NSError(domain: RACSignalErrorDomain, code: 1) | ||
expect(RACSignalError.timedOut ~= error).to(beTrue()) | ||
} | ||
|
||
it("bridges RACSignalErrorNoMatchingCase to a Swift error code") { | ||
let error: Error = NSError(domain: RACSignalErrorDomain, code: 2) | ||
expect(RACSignalError.noMatchingCase ~= error).to(beTrue()) | ||
} | ||
} | ||
} | ||
} |