aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib
diff options
context:
space:
mode:
authorTeddy Wing2018-03-23 18:05:02 +0100
committerTeddy Wing2018-03-27 16:46:18 +0200
commit0a45ba811eefebb97bdc75f5e70da2be13186c28 (patch)
tree5b9bcdd8b1c8288240cbbe241385769d3c7abf40 /spec/lib
parent1c1ecc85064042b0d719e3134afe310227d41f1c (diff)
downloadchouette-core-0a45ba811eefebb97bdc75f5e70da2be13186c28.tar.bz2
TomTom::Matrix#points_as_params: Use `TomTom::Matrix::Point`s
Rewrite this method to accept `TomTom::Matrix::Point`s instead of plain `Geokit::LatLng` coordinates. Do this because this method needs to take the result of `#points_from_way_costs` as input, and that method now returns a `Set` of `Point`s. Refs #6222
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/tom_tom/matrix_spec.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/lib/tom_tom/matrix_spec.rb b/spec/lib/tom_tom/matrix_spec.rb
index 1cb47752d..b27d99a64 100644
--- a/spec/lib/tom_tom/matrix_spec.rb
+++ b/spec/lib/tom_tom/matrix_spec.rb
@@ -38,9 +38,18 @@ RSpec.describe TomTom::Matrix do
describe "#points_as_params" do
it "transforms a set of LatLng points into a hash for use by TomTom Matrix" do
points = Set.new([
- Geokit::LatLng.new(48.85086, 2.36143),
- Geokit::LatLng.new(47.91231, 1.87606),
- Geokit::LatLng.new(52.50867, 13.42879)
+ TomTom::Matrix::Point.new(
+ Geokit::LatLng.new(48.85086, 2.36143),
+ '44'
+ ),
+ TomTom::Matrix::Point.new(
+ Geokit::LatLng.new(47.91231, 1.87606),
+ '77'
+ ),
+ TomTom::Matrix::Point.new(
+ Geokit::LatLng.new(52.50867, 13.42879),
+ '88'
+ )
])
expect(