mormon 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mormon/osm_router.rb +1 -1
- data/lib/mormon/version.rb +1 -1
- data/spec/mormon_spec.rb +22 -1
- metadata +2 -2
data/lib/mormon/osm_router.rb
CHANGED
data/lib/mormon/version.rb
CHANGED
data/spec/mormon_spec.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'mormon'
|
3
|
-
require 'benchmark'
|
4
3
|
|
5
4
|
describe Mormon::Weight do
|
6
5
|
it "get (transport, way type) must to return a value" do
|
@@ -75,6 +74,14 @@ describe Mormon::OSM::Loader do
|
|
75
74
|
File.zero?(@loader.cache_filename).should eq false
|
76
75
|
end
|
77
76
|
|
77
|
+
it "should let change the cache dir" do
|
78
|
+
cache_dir = File.join File.dirname(__FILE__), "..", "cache"
|
79
|
+
Mormon::OSM::Loader.cache_dir = cache_dir
|
80
|
+
@loader = Mormon::OSM::Loader.new spec_osm_file, :cache => true
|
81
|
+
cache_filename = File.join Mormon::OSM::Loader.cache_dir, File.basename(spec_osm_file) + ".pstore"
|
82
|
+
@loader.cache_filename.should eq cache_filename
|
83
|
+
end
|
84
|
+
|
78
85
|
it "should have stored the same data" do
|
79
86
|
@without_cache = Mormon::OSM::Loader.new spec_osm_file
|
80
87
|
@with_cache = Mormon::OSM::Loader.new spec_osm_file, :cache => true
|
@@ -93,6 +100,20 @@ describe Mormon::OSM::Loader do
|
|
93
100
|
end
|
94
101
|
|
95
102
|
describe Mormon::OSM::Router do
|
103
|
+
it "should find the route if the params are strings" do
|
104
|
+
@loader = Mormon::OSM::Loader.new spec_osm_file
|
105
|
+
@router = Mormon::OSM::Router.new @loader
|
106
|
+
|
107
|
+
response, route = @router.find_route "448193278", 448193334, "car"
|
108
|
+
response.should eq "success"
|
109
|
+
route.should eq [
|
110
|
+
[-37.3211676, -59.1269871],
|
111
|
+
[-37.3223495, -59.1262886],
|
112
|
+
[-37.3229002, -59.1277355],
|
113
|
+
[-37.3234584, -59.1292045],
|
114
|
+
[-37.3246275, -59.1285124]
|
115
|
+
]
|
116
|
+
end
|
96
117
|
|
97
118
|
it "should do the routing without problems" do
|
98
119
|
@loader = Mormon::OSM::Loader.new spec_osm_file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mormon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|