Skip to content

Commit

Permalink
Refine Obj-C bridging for CoordinateBounds
Browse files Browse the repository at this point in the history
  • Loading branch information
frederoni committed Dec 10, 2018
1 parent 7945c69 commit f9b0583
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion MapboxDirections/MBCoordinateBounds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CoordinateBounds: NSObject, Codable {
Initializes a `BoundingBox` from an array of `CLLocationCoordinate2D`’s.
*/
@objc
convenience public init(_ coordinates: [CLLocationCoordinate2D]) {
convenience public init(coordinates: [CLLocationCoordinate2D]) {
assert(coordinates.count >= 2, "coordinates must consist of at least two coordinates")

var maximumLatitude: CLLocationDegrees = -90
Expand Down
8 changes: 4 additions & 4 deletions OfflineDirectionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class OfflineDirectionsTests: XCTestCase {
func testDownloadTiles() {

let directions = Directions(accessToken: token, host: host)
let coordinateBounds = CoordinateBounds([CLLocationCoordinate2D(latitude: 37.7890, longitude: -122.4337),
CLLocationCoordinate2D(latitude: 37.7881, longitude: -122.4318)])

let bounds = CoordinateBounds(coordinates: [CLLocationCoordinate2D(latitude: 37.7890, longitude: -122.4337),
CLLocationCoordinate2D(latitude: 37.7881, longitude: -122.4318)])

let version = "2018-10-16"
let downloadExpectation = self.expectation(description: "Download tile expectation")
Expand All @@ -62,7 +62,7 @@ class OfflineDirectionsTests: XCTestCase {
return OHHTTPStubsResponse(fileAtPath: path!, statusCode: 200, headers: headers)
}

_ = directions.downloadTiles(in: coordinateBounds, version: version, completionHandler: { (url, response, error) in
_ = directions.downloadTiles(in: bounds, version: version, completionHandler: { (url, response, error) in
XCTAssertEqual(response!.suggestedFilename, "2018-10-16.tar")
XCTAssertNotNil(url, "url should point to the temporary local file")
XCTAssertNil(error)
Expand Down

0 comments on commit f9b0583

Please sign in to comment.