From c7a50d1e47cae1859454d4e633da122ff831b904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Fri, 13 Oct 2017 08:27:15 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20misuse=20of=20the=20word=20=E2=80=9Cvoice?= =?UTF-8?q?=E2=80=9D=20(#191)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MapboxDirections.xcodeproj/project.pbxproj | 38 +++++++++---------- MapboxDirections/MBRouteOptions.swift | 10 ++--- MapboxDirections/MBRouteStep.swift | 8 ++-- ...tructions.json => spokenInstructions.json} | 0 MapboxDirectionsTests/RouteOptionsTests.swift | 2 +- ...ns.swift => SpokenInstructionsTests.swift} | 28 +++++++------- 6 files changed, 43 insertions(+), 43 deletions(-) rename MapboxDirectionsTests/Fixtures/{voiceInstructions.json => spokenInstructions.json} (100%) rename MapboxDirectionsTests/{VoiceInstructions.swift => SpokenInstructionsTests.swift} (70%) diff --git a/MapboxDirections.xcodeproj/project.pbxproj b/MapboxDirections.xcodeproj/project.pbxproj index 558220fed..f0034f3f2 100644 --- a/MapboxDirections.xcodeproj/project.pbxproj +++ b/MapboxDirections.xcodeproj/project.pbxproj @@ -20,7 +20,7 @@ C52CE38F1F6AF63C0069963D /* MBSpokenInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = C55FB44A1F6AEBF6006BD1E9 /* MBSpokenInstruction.swift */; }; C52CE3901F6AF63D0069963D /* MBSpokenInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = C55FB44A1F6AEBF6006BD1E9 /* MBSpokenInstruction.swift */; }; C52CE3911F6AF63E0069963D /* MBSpokenInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = C55FB44A1F6AEBF6006BD1E9 /* MBSpokenInstruction.swift */; }; - C52CE3931F6AF6E70069963D /* VoiceInstructions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52CE3921F6AF6E70069963D /* VoiceInstructions.swift */; }; + C52CE3931F6AF6E70069963D /* SpokenInstructionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52CE3921F6AF6E70069963D /* SpokenInstructionsTests.swift */; }; C53A02261E92C26E009837BD /* MBAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* MBAttribute.swift */; }; C53A02271E92C26F009837BD /* MBAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* MBAttribute.swift */; }; C53A02281E92C271009837BD /* MBAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* MBAttribute.swift */; }; @@ -58,11 +58,11 @@ C58EA7AD1E9D7F75008F98CE /* MBCongestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = C58EA7A91E9D7EAD008F98CE /* MBCongestion.swift */; }; C59426071F1EA6C400C8E59C /* MBRoadClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59426061F1EA6C400C8E59C /* MBRoadClasses.swift */; }; C5A3D3981E8188FE00D494A0 /* annotation.json in Resources */ = {isa = PBXBuildFile; fileRef = C5A3D3971E8188FE00D494A0 /* annotation.json */; }; - C5D1D7F01F6AF91700A1C4F1 /* voiceInstructions.json in Resources */ = {isa = PBXBuildFile; fileRef = C5D1D7EF1F6AF91700A1C4F1 /* voiceInstructions.json */; }; - C5D1D7F11F6AF92500A1C4F1 /* voiceInstructions.json in Resources */ = {isa = PBXBuildFile; fileRef = C5D1D7EF1F6AF91700A1C4F1 /* voiceInstructions.json */; }; - C5D1D7F21F6AF92600A1C4F1 /* voiceInstructions.json in Resources */ = {isa = PBXBuildFile; fileRef = C5D1D7EF1F6AF91700A1C4F1 /* voiceInstructions.json */; }; - C5D1D7F31F6AFBD600A1C4F1 /* VoiceInstructions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52CE3921F6AF6E70069963D /* VoiceInstructions.swift */; }; - C5D1D7F41F6AFBD600A1C4F1 /* VoiceInstructions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52CE3921F6AF6E70069963D /* VoiceInstructions.swift */; }; + C5D1D7F01F6AF91700A1C4F1 /* spokenInstructions.json in Resources */ = {isa = PBXBuildFile; fileRef = C5D1D7EF1F6AF91700A1C4F1 /* spokenInstructions.json */; }; + C5D1D7F11F6AF92500A1C4F1 /* spokenInstructions.json in Resources */ = {isa = PBXBuildFile; fileRef = C5D1D7EF1F6AF91700A1C4F1 /* spokenInstructions.json */; }; + C5D1D7F21F6AF92600A1C4F1 /* spokenInstructions.json in Resources */ = {isa = PBXBuildFile; fileRef = C5D1D7EF1F6AF91700A1C4F1 /* spokenInstructions.json */; }; + C5D1D7F31F6AFBD600A1C4F1 /* SpokenInstructionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52CE3921F6AF6E70069963D /* SpokenInstructionsTests.swift */; }; + C5D1D7F41F6AFBD600A1C4F1 /* SpokenInstructionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52CE3921F6AF6E70069963D /* SpokenInstructionsTests.swift */; }; DA1A10C61D00F969009F82FA /* MapboxDirections.h in Headers */ = {isa = PBXBuildFile; fileRef = DA6C9D8A1CAE442B00094FBC /* MapboxDirections.h */; settings = {ATTRIBUTES = (Public, ); }; }; DA1A10C71D00F969009F82FA /* MBDirections.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD6254731AE70CB700017857 /* MBDirections.swift */; }; DA1A10C81D00F969009F82FA /* MBRoute.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAC05F171CFC075300FA0071 /* MBRoute.swift */; }; @@ -186,7 +186,7 @@ 358D48851E2EAB4500F32A65 /* MBRouteOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBRouteOptions.m; sourceTree = ""; }; C51538CB1E807FF00093FF3E /* MBAttribute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBAttribute.swift; sourceTree = ""; }; C5247D701E818A24004B6154 /* AnnotationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnnotationTests.swift; sourceTree = ""; }; - C52CE3921F6AF6E70069963D /* VoiceInstructions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VoiceInstructions.swift; sourceTree = ""; }; + C52CE3921F6AF6E70069963D /* SpokenInstructionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpokenInstructionsTests.swift; sourceTree = ""; }; C558C58B1E94181A00617B37 /* MBAttribute.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBAttribute.h; sourceTree = ""; }; C55FB44A1F6AEBF6006BD1E9 /* MBSpokenInstruction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MBSpokenInstruction.swift; sourceTree = ""; }; C57B2E951DB8171300E9123A /* MBLaneIndication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBLaneIndication.h; sourceTree = ""; }; @@ -196,7 +196,7 @@ C58EA7A91E9D7EAD008F98CE /* MBCongestion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBCongestion.swift; sourceTree = ""; }; C59426061F1EA6C400C8E59C /* MBRoadClasses.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBRoadClasses.swift; sourceTree = ""; }; C5A3D3971E8188FE00D494A0 /* annotation.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = annotation.json; path = v5/annotation.json; sourceTree = ""; }; - C5D1D7EF1F6AF91700A1C4F1 /* voiceInstructions.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = voiceInstructions.json; sourceTree = ""; }; + C5D1D7EF1F6AF91700A1C4F1 /* spokenInstructions.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = spokenInstructions.json; sourceTree = ""; }; DA1A10AF1D00F8FF009F82FA /* MapboxDirections.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapboxDirections.framework; sourceTree = BUILT_PRODUCTS_DIR; }; DA1A10B81D00F8FF009F82FA /* MapboxDirectionsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MapboxDirectionsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; DA1A10D51D0101ED009F82FA /* MapboxDirections.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapboxDirections.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -345,12 +345,12 @@ name = annotation; sourceTree = ""; }; - C5D1D7EE1F6AF8FA00A1C4F1 /* voiceInstructions */ = { + C5D1D7EE1F6AF8FA00A1C4F1 /* spokenInstructions */ = { isa = PBXGroup; children = ( - C5D1D7EF1F6AF91700A1C4F1 /* voiceInstructions.json */, + C5D1D7EF1F6AF91700A1C4F1 /* spokenInstructions.json */, ); - name = voiceInstructions; + name = spokenInstructions; sourceTree = ""; }; DA6C9D891CAE442B00094FBC /* MapboxDirections */ = { @@ -391,7 +391,7 @@ DA6C9DB11CAECA0E00094FBC /* Fixture.swift */, C5247D701E818A24004B6154 /* AnnotationTests.swift */, DAE33A1A1F215DF600C06039 /* IntersectionTests.swift */, - C52CE3921F6AF6E70069963D /* VoiceInstructions.swift */, + C52CE3921F6AF6E70069963D /* SpokenInstructionsTests.swift */, DA6C9D9A1CAE442B00094FBC /* Info.plist */, DA6C9DAD1CAEC93800094FBC /* Fixtures */, ); @@ -401,7 +401,7 @@ DA6C9DAD1CAEC93800094FBC /* Fixtures */ = { isa = PBXGroup; children = ( - C5D1D7EE1F6AF8FA00A1C4F1 /* voiceInstructions */, + C5D1D7EE1F6AF8FA00A1C4F1 /* spokenInstructions */, C5247D721E818A8D004B6154 /* annotation */, DA737EEC1D061514005BDA16 /* V4 */, DA737EEB1D0614FA005BDA16 /* V5 */, @@ -833,7 +833,7 @@ DA737EF31D061AA2005BDA16 /* v4_driving_dc_polyline.json in Resources */, DA737EE51D05F91E005BDA16 /* v5_driving_dc_geojson.json in Resources */, DA1A10CF1D00F975009F82FA /* v5_driving_dc_polyline.json in Resources */, - C5D1D7F11F6AF92500A1C4F1 /* voiceInstructions.json in Resources */, + C5D1D7F11F6AF92500A1C4F1 /* spokenInstructions.json in Resources */, DA737EEF1D06175B005BDA16 /* v4_driving_dc_geojson.json in Resources */, C53A022B1E92C281009837BD /* annotation.json in Resources */, ); @@ -853,7 +853,7 @@ DA737EF41D061AA2005BDA16 /* v4_driving_dc_polyline.json in Resources */, DA737EE61D05F91E005BDA16 /* v5_driving_dc_geojson.json in Resources */, DA1A10F31D010251009F82FA /* v5_driving_dc_polyline.json in Resources */, - C5D1D7F21F6AF92600A1C4F1 /* voiceInstructions.json in Resources */, + C5D1D7F21F6AF92600A1C4F1 /* spokenInstructions.json in Resources */, DA737EF01D06175B005BDA16 /* v4_driving_dc_geojson.json in Resources */, C53A022C1E92C281009837BD /* annotation.json in Resources */, ); @@ -880,7 +880,7 @@ DA737EF21D061AA2005BDA16 /* v4_driving_dc_polyline.json in Resources */, DA737EE41D05F91E005BDA16 /* v5_driving_dc_geojson.json in Resources */, DAC05F1C1CFC1E5300FA0071 /* v5_driving_dc_polyline.json in Resources */, - C5D1D7F01F6AF91700A1C4F1 /* voiceInstructions.json in Resources */, + C5D1D7F01F6AF91700A1C4F1 /* spokenInstructions.json in Resources */, DA737EEE1D06175B005BDA16 /* v4_driving_dc_geojson.json in Resources */, C5A3D3981E8188FE00D494A0 /* annotation.json in Resources */, ); @@ -972,7 +972,7 @@ DAE33A1C1F215DF600C06039 /* IntersectionTests.swift in Sources */, DA1A10CE1D00F972009F82FA /* Fixture.swift in Sources */, DA1A110C1D01045E009F82FA /* DirectionsTests.swift in Sources */, - C5D1D7F31F6AFBD600A1C4F1 /* VoiceInstructions.swift in Sources */, + C5D1D7F31F6AFBD600A1C4F1 /* SpokenInstructionsTests.swift in Sources */, F4D785F01DDD82C100FF4665 /* RouteStepTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1009,7 +1009,7 @@ DAE33A1D1F215DF600C06039 /* IntersectionTests.swift in Sources */, DA1A10F51D010251009F82FA /* Fixture.swift in Sources */, DA1A110D1D01045E009F82FA /* DirectionsTests.swift in Sources */, - C5D1D7F41F6AFBD600A1C4F1 /* VoiceInstructions.swift in Sources */, + C5D1D7F41F6AFBD600A1C4F1 /* SpokenInstructionsTests.swift in Sources */, F4D785F11DDD82C100FF4665 /* RouteStepTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1067,7 +1067,7 @@ DAE33A1B1F215DF600C06039 /* IntersectionTests.swift in Sources */, DA6C9DB21CAECA0E00094FBC /* Fixture.swift in Sources */, DA1A110B1D01045E009F82FA /* DirectionsTests.swift in Sources */, - C52CE3931F6AF6E70069963D /* VoiceInstructions.swift in Sources */, + C52CE3931F6AF6E70069963D /* SpokenInstructionsTests.swift in Sources */, F4D785EF1DDD82C100FF4665 /* RouteStepTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/MapboxDirections/MBRouteOptions.swift b/MapboxDirections/MBRouteOptions.swift index e5ee31813..62245cc62 100644 --- a/MapboxDirections/MBRouteOptions.swift +++ b/MapboxDirections/MBRouteOptions.swift @@ -227,7 +227,7 @@ open class RouteOptions: NSObject, NSSecureCoding { locale = decoder.decodeObject(of: NSLocale.self, forKey: "locale") as Locale? - includesVoiceInstructions = decoder.decodeBool(forKey: "includeVoiceInstructions") + includesSpokenInstructions = decoder.decodeBool(forKey: "includesSpokenInstructions") } open static var supportsSecureCoding = true @@ -243,7 +243,7 @@ open class RouteOptions: NSObject, NSSecureCoding { coder.encode(attributeOptions.description, forKey: "attributeOptions") coder.encode(includesExitRoundaboutManeuver, forKey: "includesExitRoundaboutManeuver") coder.encode(locale, forKey: "locale") - coder.encode(includesVoiceInstructions, forKey: "includeVoiceInstructions") + coder.encode(includesSpokenInstructions, forKey: "includesSpokenInstructions") } // MARK: Specifying the Path of the Route @@ -376,7 +376,7 @@ open class RouteOptions: NSObject, NSSecureCoding { If this option is set to true, the `RouteStep.instructionsSpokenAlongStep` property is set to an array of `SpokenInstructions`. */ - open var includesVoiceInstructions = false + open var includesSpokenInstructions = false /** The measurement system used in spoken instructions included in route steps. @@ -408,8 +408,8 @@ open class RouteOptions: NSObject, NSSecureCoding { params.append(URLQueryItem(name: "language", value: locale.identifier)) } - if includesVoiceInstructions { - params.append(URLQueryItem(name: "voice_instructions", value: String(includesVoiceInstructions))) + if includesSpokenInstructions { + params.append(URLQueryItem(name: "voice_instructions", value: String(includesSpokenInstructions))) params.append(URLQueryItem(name: "voice_units", value: String(describing: distanceMeasurementSystem))) } diff --git a/MapboxDirections/MBRouteStep.swift b/MapboxDirections/MBRouteStep.swift index 2cb43043e..60d7847cd 100644 --- a/MapboxDirections/MBRouteStep.swift +++ b/MapboxDirections/MBRouteStep.swift @@ -627,7 +627,7 @@ open class RouteStep: NSObject, NSSecureCoding { intersections = decoder.decodeObject(of: [NSArray.self, Intersection.self], forKey: "intersections") as? [Intersection] - instructionsSpokenAlongStep = decoder.decodeObject(of: [NSArray.self, SpokenInstruction.self], forKey: "voiceInstructions") as? [SpokenInstruction] + instructionsSpokenAlongStep = decoder.decodeObject(of: [NSArray.self, SpokenInstruction.self], forKey: "instructionsSpokenAlongStep") as? [SpokenInstruction] } open static var supportsSecureCoding = true @@ -673,7 +673,7 @@ open class RouteStep: NSObject, NSSecureCoding { coder.encode(codes, forKey: "codes") coder.encode(destinationCodes, forKey: "destinationCodes") coder.encode(destinations, forKey: "destinations") - coder.encode(instructionsSpokenAlongStep, forKey: "voiceInstructions") + coder.encode(instructionsSpokenAlongStep, forKey: "instructionsSpokenAlongStep") } // MARK: Getting the Step Geometry @@ -728,7 +728,7 @@ open class RouteStep: NSObject, NSSecureCoding { /** A string with instructions explaining how to perform the step’s maneuver. - You can display this string or read it aloud to the user. The string does not include the distance to or from the maneuver. For instructions optimized for real-time delivery during turn-by-turn navigation, set the `RouteOptions.includesVoiceInstructions` option and use the `instructionsSpokenAlongStep` property. If you need customized instructions, you can construct them yourself from the step’s other properties or use [OSRM Text Instructions](https://github.com/Project-OSRM/osrm-text-instructions.swift/). + You can display this string or read it aloud to the user. The string does not include the distance to or from the maneuver. For instructions optimized for real-time delivery during turn-by-turn navigation, set the `RouteOptions.includesSpokenInstructions` option and use the `instructionsSpokenAlongStep` property. If you need customized instructions, you can construct them yourself from the step’s other properties or use [OSRM Text Instructions](https://github.com/Project-OSRM/osrm-text-instructions.swift/). - note: If you use MapboxDirections.swift with the Mapbox Directions API, this property is formatted and localized for display to the user. If you use OSRM directly, this property contains a basic string that only includes the maneuver type and direction. Use [OSRM Text Instructions](https://github.com/Project-OSRM/osrm-text-instructions.swift/) to construct a complete, localized instruction string for display. */ @@ -739,7 +739,7 @@ open class RouteStep: NSObject, NSSecureCoding { As the user traverses this step, you can give them advance notice of the upcoming maneuver by reading aloud each item in this array in order as the user reaches the specified distances along this step. The text of the spoken instructions refers to the details in the next step, but the distances are measured from the beginning of this step. - This property is non-`nil` if the `RouteOptions.includesVoiceInstructions` option is set to `true`. For instructions designed for display, use the `instructions` property. + This property is non-`nil` if the `RouteOptions.includesSpokenInstructions` option is set to `true`. For instructions designed for display, use the `instructions` property. */ open let instructionsSpokenAlongStep: [SpokenInstruction]? diff --git a/MapboxDirectionsTests/Fixtures/voiceInstructions.json b/MapboxDirectionsTests/Fixtures/spokenInstructions.json similarity index 100% rename from MapboxDirectionsTests/Fixtures/voiceInstructions.json rename to MapboxDirectionsTests/Fixtures/spokenInstructions.json diff --git a/MapboxDirectionsTests/RouteOptionsTests.swift b/MapboxDirectionsTests/RouteOptionsTests.swift index 2c11a3b79..684490ed2 100644 --- a/MapboxDirectionsTests/RouteOptionsTests.swift +++ b/MapboxDirectionsTests/RouteOptionsTests.swift @@ -36,7 +36,7 @@ class RouteOptionsTests: XCTestCase { XCTAssertEqual(unarchivedOptions.profileIdentifier, options.profileIdentifier) XCTAssertEqual(unarchivedOptions.locale, options.locale) - XCTAssertEqual(unarchivedOptions.includesVoiceInstructions, options.includesVoiceInstructions) + XCTAssertEqual(unarchivedOptions.includesSpokenInstructions, options.includesSpokenInstructions) XCTAssertEqual(unarchivedOptions.distanceMeasurementSystem, options.distanceMeasurementSystem) } } diff --git a/MapboxDirectionsTests/VoiceInstructions.swift b/MapboxDirectionsTests/SpokenInstructionsTests.swift similarity index 70% rename from MapboxDirectionsTests/VoiceInstructions.swift rename to MapboxDirectionsTests/SpokenInstructionsTests.swift index ec49b4227..bec082143 100644 --- a/MapboxDirectionsTests/VoiceInstructions.swift +++ b/MapboxDirectionsTests/SpokenInstructionsTests.swift @@ -2,13 +2,13 @@ import XCTest import OHHTTPStubs @testable import MapboxDirections -class VoiceInstructionsTest: XCTestCase { +class SpokenInstructionsTests: XCTestCase { override func tearDown() { OHHTTPStubs.removeAllStubs() super.tearDown() } - func testVoiceInstructions() { + func testSpokenInstructions() { let expectation = self.expectation(description: "calculating directions should return results") let queryParams: [String: String?] = [ @@ -24,7 +24,7 @@ class VoiceInstructionsTest: XCTestCase { stub(condition: isHost("api.mapbox.com") && containsQueryParams(queryParams)) { _ in - let path = Bundle(for: type(of: self)).path(forResource: "voiceInstructions", ofType: "json") + let path = Bundle(for: type(of: self)).path(forResource: "spokenInstructions", ofType: "json") return OHHTTPStubsResponse(fileAtPath: path!, statusCode: 200, headers: ["Content-Type": "application/json"]) } @@ -36,7 +36,7 @@ class VoiceInstructionsTest: XCTestCase { options.includesSteps = true options.includesAlternativeRoutes = false options.routeShapeResolution = .full - options.includesVoiceInstructions = true + options.includesSpokenInstructions = true options.distanceMeasurementSystem = .imperial var route: Route? let task = Directions(accessToken: BogusToken).calculate(options) { (waypoints, routes, error) in @@ -65,18 +65,18 @@ class VoiceInstructionsTest: XCTestCase { XCTAssertEqual(step.instructionsSpokenAlongStep!.count, 3) - let voiceInstructions = step.instructionsSpokenAlongStep! + let spokenInstructions = step.instructionsSpokenAlongStep! - XCTAssertEqual(voiceInstructions[0].distanceAlongStep, 793.8) - XCTAssertEqual(voiceInstructions[1].distanceAlongStep, 304.0) - XCTAssertEqual(voiceInstructions[2].distanceAlongStep, 65.1) + XCTAssertEqual(spokenInstructions[0].distanceAlongStep, 793.8) + XCTAssertEqual(spokenInstructions[1].distanceAlongStep, 304.0) + XCTAssertEqual(spokenInstructions[2].distanceAlongStep, 65.1) - XCTAssertEqual(voiceInstructions[0].ssmlText, "Head south on 8th Avenue") - XCTAssertEqual(voiceInstructions[1].ssmlText, "In 1000 feet, turn left onto John F Kennedy Drive") - XCTAssertEqual(voiceInstructions[2].ssmlText, "Turn left onto John F Kennedy Drive") + XCTAssertEqual(spokenInstructions[0].ssmlText, "Head south on 8th Avenue") + XCTAssertEqual(spokenInstructions[1].ssmlText, "In 1000 feet, turn left onto John F Kennedy Drive") + XCTAssertEqual(spokenInstructions[2].ssmlText, "Turn left onto John F Kennedy Drive") - XCTAssertEqual(voiceInstructions[0].text, "Head south on 8th Avenue") - XCTAssertEqual(voiceInstructions[1].text, "In 1000 feet, turn left onto John F Kennedy Drive") - XCTAssertEqual(voiceInstructions[2].text, "Turn left onto John F Kennedy Drive") + XCTAssertEqual(spokenInstructions[0].text, "Head south on 8th Avenue") + XCTAssertEqual(spokenInstructions[1].text, "In 1000 feet, turn left onto John F Kennedy Drive") + XCTAssertEqual(spokenInstructions[2].text, "Turn left onto John F Kennedy Drive") } }