diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/lib/tom_tom_spec.rb | 25 | 
1 files changed, 25 insertions, 0 deletions
| diff --git a/spec/lib/tom_tom_spec.rb b/spec/lib/tom_tom_spec.rb new file mode 100644 index 000000000..57f22d26a --- /dev/null +++ b/spec/lib/tom_tom_spec.rb @@ -0,0 +1,25 @@ +RSpec.describe TomTom do +  let(:tomtom) { TomTom.new } + +  describe "#convert_way_costs_for_batch" do +    it "turns WayCost points into a collection of colon-separated strings" do +      way_costs = [ +        WayCost.new( +          departure: Geokit::LatLng.new(2, 48), +          arrival: Geokit::LatLng.new(3, 46) +        ), +        WayCost.new( +          departure: Geokit::LatLng.new(-71, 42), +          arrival: Geokit::LatLng.new(-71.5, 42.9) +        ) +      ] + +      expect( +        tomtom.convert_way_costs_for_batch(way_costs) +      ).to eq([ +        '2,48:3,46', +        '-71,42:-71.5,42.9' +      ]) +    end +  end +end | 
