parkwhiz 0.3.0 → 0.4.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +3 -0
- data/lib/parkwhiz/search.rb +1 -1
- data/lib/parkwhiz/version.rb +1 -1
- data/spec/responses/no_location_response.json +1 -0
- data/spec/search_spec.rb +14 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9215534b0d8ef5ea70ae2bab2730842e7a580ba2
|
4
|
+
data.tar.gz: 80c0fcc2f62e97db756b901498e93f911a694c5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1ae5be58990e620a6b1c46cbd1d2274230ff71e32f287a7cebc672ac1e027280f4c4087a4e55fbc8c9ea392b9d541197ff0392e26d738647b4aca5d67a411de
|
7
|
+
data.tar.gz: 72e6ec4b7577ec2e361d5e54e48c5af53303a61441899e14dce318610cc0dcec2615eb0779eabbe013e5bbe3cee3e1f7876c1f12a2e0dcd24cea4f59b2ef2bfe
|
data/CHANGELOG.rdoc
CHANGED
data/lib/parkwhiz/search.rb
CHANGED
@@ -18,6 +18,6 @@ module Parkwhiz
|
|
18
18
|
|
19
19
|
raise SearchError.new(response.body['error']) if response.body.kind_of?(Hash) && response.body['error']
|
20
20
|
|
21
|
-
response.body['parking_listings'].collect{|parking_listing_json| Location.new(parking_listing_json)}
|
21
|
+
(response.body['parking_listings']||[]).collect{|parking_listing_json| Location.new(parking_listing_json)}
|
22
22
|
end
|
23
23
|
end
|
data/lib/parkwhiz/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"parkwhiz_url":"http:\/\/www.parkwhiz.com\/search\/?destination=Ray%2C+OH&start=1422561600&end=1422572400","lat":39.2036801,"lng":-82.6835003,"locations":0,"min_price":null,"max_price":null,"min_distance":null,"max_distance":null,"amenities":{"shuttle":0,"eticket":0,"perk":0,"valet":0,"indoor":0,"handicap":0,"restroom":0,"security":0,"tailgate":null,"rv":null,"unobstructed":0,"attended":0,"reentry_allowed":null}}
|
data/spec/search_spec.rb
CHANGED
@@ -7,6 +7,10 @@ describe "Search" do
|
|
7
7
|
File.read(File.expand_path("spec/responses/la_search_response.json"))
|
8
8
|
end
|
9
9
|
|
10
|
+
let :no_location_search_response do
|
11
|
+
File.read(File.expand_path("spec/responses/no_location_response.json"))
|
12
|
+
end
|
13
|
+
|
10
14
|
let :invalid_search_response do
|
11
15
|
File.read(File.expand_path("spec/responses/invalid_key_response.json"))
|
12
16
|
end
|
@@ -15,6 +19,16 @@ describe "Search" do
|
|
15
19
|
Parkwhiz.api_key = 'asdf1234'
|
16
20
|
end
|
17
21
|
|
22
|
+
context 'on empty search results' do
|
23
|
+
it "should return an emtpy Array" do
|
24
|
+
expect(connection).to receive(:get) { double( body: JSON.parse(no_location_search_response) ) }
|
25
|
+
Parkwhiz.connection = connection
|
26
|
+
locations = Parkwhiz.search({})
|
27
|
+
expect(locations).to be_kind_of(Array)
|
28
|
+
expect(locations).to be_empty
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
18
32
|
context "on successful search" do
|
19
33
|
it "should return an array of Parkwhiz::Locations" do
|
20
34
|
expect(connection).to receive(:get) { double( body: JSON.parse(la_search_response) ) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parkwhiz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Austin Fonacier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -139,6 +139,7 @@ files:
|
|
139
139
|
- spec/responses/event_search_response.json
|
140
140
|
- spec/responses/invalid_key_response.json
|
141
141
|
- spec/responses/la_search_response.json
|
142
|
+
- spec/responses/no_location_response.json
|
142
143
|
- spec/responses/venue_search_response.json
|
143
144
|
- spec/search_spec.rb
|
144
145
|
- spec/spec_helper.rb
|
@@ -163,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
164
|
version: '0'
|
164
165
|
requirements: []
|
165
166
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.
|
167
|
+
rubygems_version: 2.4.3
|
167
168
|
signing_key:
|
168
169
|
specification_version: 4
|
169
170
|
summary: A Ruby gem wrapper to Parkwhiz.com's API
|
@@ -173,6 +174,7 @@ test_files:
|
|
173
174
|
- spec/responses/event_search_response.json
|
174
175
|
- spec/responses/invalid_key_response.json
|
175
176
|
- spec/responses/la_search_response.json
|
177
|
+
- spec/responses/no_location_response.json
|
176
178
|
- spec/responses/venue_search_response.json
|
177
179
|
- spec/search_spec.rb
|
178
180
|
- spec/spec_helper.rb
|