parkwhiz 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad04539e6b9c501d54351b36a6678d802fddd3c4
4
- data.tar.gz: 03f66d662559c772942bb49e087514b20506e885
3
+ metadata.gz: 9215534b0d8ef5ea70ae2bab2730842e7a580ba2
4
+ data.tar.gz: 80c0fcc2f62e97db756b901498e93f911a694c5f
5
5
  SHA512:
6
- metadata.gz: e10e4d597994d658fa3cf30b19f57c1b052ef58de721c857ecb47200ccc6b5446021a96742d69226be2c24297ea1e9c3648f6934ed7286650179702a58d6b633
7
- data.tar.gz: 98d0a638e2e98236a917d556b410d7513bd0954dd2f3e958f1b177a87b2abb022f11a508e6b84873d3208b252de403887b3feac3f2f5eeff56686da467c2ba20
6
+ metadata.gz: f1ae5be58990e620a6b1c46cbd1d2274230ff71e32f287a7cebc672ac1e027280f4c4087a4e55fbc8c9ea392b9d541197ff0392e26d738647b4aca5d67a411de
7
+ data.tar.gz: 72e6ec4b7577ec2e361d5e54e48c5af53303a61441899e14dce318610cc0dcec2615eb0779eabbe013e5bbe3cee3e1f7876c1f12a2e0dcd24cea4f59b2ef2bfe
@@ -1,3 +1,6 @@
1
+ === 0.4.0
2
+ - Fixing a bug brought up by @Armandogb where search results don't have a location attached. In that case we return an empty array.
3
+
1
4
  === 0.3.0
2
5
  - Adding Event endpoint. Thanks Eric Kuecks (ekuecks)
3
6
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Parkwhiz
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -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}}
@@ -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.3.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: 2014-08-29 00:00:00.000000000 Z
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.2.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