From 279f1c8fa2e226e113db76e3720aa89fe9c4cf4a Mon Sep 17 00:00:00 2001 From: Christoffer Winterkvist Date: Mon, 18 Jan 2016 13:07:57 +0100 Subject: [PATCH] Move TestRoute --- Compass.xcodeproj/project.pbxproj | 8 +++---- Sources/iOS/TestRouter.swift | 37 ------------------------------- 2 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 Sources/iOS/TestRouter.swift diff --git a/Compass.xcodeproj/project.pbxproj b/Compass.xcodeproj/project.pbxproj index fcc4d3a..a3638f4 100644 --- a/Compass.xcodeproj/project.pbxproj +++ b/Compass.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + BD93BC731C4D0CB5006D2D11 /* TestRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD93BC721C4D0CB5006D2D11 /* TestRouter.swift */; }; BDF7B4091C3FF40300576737 /* Compass.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDF7B4081C3FF40300576737 /* Compass.swift */; }; BDF7B40A1C3FF40300576737 /* Compass.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDF7B4081C3FF40300576737 /* Compass.swift */; }; BDF7B40C1C3FF40A00576737 /* Compass+Navigate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDF7B40B1C3FF40A00576737 /* Compass+Navigate.swift */; }; @@ -17,7 +18,6 @@ BDF7B4171C3FF51800576737 /* Sugar.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BDF7B4161C3FF51800576737 /* Sugar.framework */; }; D5A2A7931C4CEB1C00B51356 /* Routable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5A2A7921C4CEB1C00B51356 /* Routable.swift */; }; D5A2A7971C4CEB7C00B51356 /* Router.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5A2A7961C4CEB7C00B51356 /* Router.swift */; }; - D5A2A79A1C4CEDDA00B51356 /* TestRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5A2A7991C4CEDDA00B51356 /* TestRouter.swift */; }; D5B2E8AA1C3A780C00C0327D /* Compass.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5B2E89F1C3A780C00C0327D /* Compass.framework */; }; D5C6294A1C3A7FAA007F7B7C /* Compass.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D5C629401C3A7FAA007F7B7C /* Compass.framework */; }; /* End PBXBuildFile section */ @@ -40,6 +40,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + BD93BC721C4D0CB5006D2D11 /* TestRouter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestRouter.swift; sourceTree = ""; }; BDF7B4081C3FF40300576737 /* Compass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Compass.swift; sourceTree = ""; }; BDF7B40B1C3FF40A00576737 /* Compass+Navigate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Compass+Navigate.swift"; sourceTree = ""; }; BDF7B40D1C3FF41500576737 /* Compass+Navigate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Compass+Navigate.swift"; sourceTree = ""; }; @@ -48,7 +49,6 @@ BDF7B4161C3FF51800576737 /* Sugar.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sugar.framework; path = Carthage/Build/iOS/Sugar.framework; sourceTree = ""; }; D5A2A7921C4CEB1C00B51356 /* Routable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Routable.swift; sourceTree = ""; }; D5A2A7961C4CEB7C00B51356 /* Router.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Router.swift; sourceTree = ""; }; - D5A2A7991C4CEDDA00B51356 /* TestRouter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TestRouter.swift; path = Sources/iOS/TestRouter.swift; sourceTree = SOURCE_ROOT; }; D5B2E89F1C3A780C00C0327D /* Compass.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Compass.framework; sourceTree = BUILT_PRODUCTS_DIR; }; D5B2E8A91C3A780C00C0327D /* Compass-iOS-Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Compass-iOS-Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; D5C629401C3A7FAA007F7B7C /* Compass.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Compass.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -178,7 +178,7 @@ D5C629921C3A8BDA007F7B7C /* iOS */ = { isa = PBXGroup; children = ( - D5A2A7991C4CEDDA00B51356 /* TestRouter.swift */, + BD93BC721C4D0CB5006D2D11 /* TestRouter.swift */, ); path = iOS; sourceTree = ""; @@ -416,7 +416,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - D5A2A79A1C4CEDDA00B51356 /* TestRouter.swift in Sources */, + BD93BC731C4D0CB5006D2D11 /* TestRouter.swift in Sources */, BDF7B4101C3FF43F00576737 /* TestCompass.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Sources/iOS/TestRouter.swift b/Sources/iOS/TestRouter.swift deleted file mode 100644 index 9d53ec6..0000000 --- a/Sources/iOS/TestRouter.swift +++ /dev/null @@ -1,37 +0,0 @@ -import Foundation -import XCTest -import Compass - -class TestRoute: Routable { - - var resolved = false - - func resolve(arguments: [String: String], navigationController: UINavigationController?) { - resolved = true - } -} - -class TestRouter: XCTestCase { - - var router: Router! - var navigationController = UINavigationController() - var route: TestRoute! - - override func setUp() { - router = Router() - route = TestRoute() - } - - func testNavigateIfRouteRegistered() { - router.routes["test"] = route - router.navigate("test", arguments: [:], navigationController: navigationController) - - XCTAssertTrue(route.resolved) - } - - func testNavigateIfRouteNotRegistered() { - router.navigate("test", arguments: [:], navigationController: navigationController) - - XCTAssertFalse(route.resolved) - } -}