great_schools 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/great_schools.rb +2 -0
- data/lib/great_schools/version.rb +1 -1
- data/spec/great_schools/school_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dacaa7590acb825582391555c7f78611a8ca1fc
|
4
|
+
data.tar.gz: 855cd94cb68b95a934a117337e16750e59aef0aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb4d033feabc3e97f12b8689f03ea70a70b4141afe4d2bb4dfbe6b6cd56eb44cbfe29a1cc47c0425dde7751ab8f9e696d0c5f06d4dba47a94a79c2ae50f8e92e
|
7
|
+
data.tar.gz: 1cf08131c9d8163d136145a71e964e7b1bbc3b33911d597fea0b274807c7cfadfb1430c757f60cba15ca334a047990e60c943fbb64dce5b290fd3af276061410
|
data/lib/great_schools.rb
CHANGED
@@ -67,6 +67,8 @@ module GreatSchools
|
|
67
67
|
|
68
68
|
if response.code.eql?(200)
|
69
69
|
parse(response.values.first) # strip the container element before parsing
|
70
|
+
elsif response.body.blank?
|
71
|
+
nil # no error to parse, return nothing
|
70
72
|
else
|
71
73
|
raise GreatSchools::Error.new(response)
|
72
74
|
end
|
@@ -2,7 +2,7 @@ module GreatSchools # :nodoc:
|
|
2
2
|
class Version # :nodoc:
|
3
3
|
MAJOR = 0 # version when you make incompatible API changes
|
4
4
|
MINOR = 2 # version when you add functionality in a backwards-compatible manner
|
5
|
-
PATCH =
|
5
|
+
PATCH = 1 # version when you make backwards-compatible bug fixes
|
6
6
|
|
7
7
|
class << self # Class methods
|
8
8
|
# MAJOR.MINOR.PATCH per Semantic Versioning 2.0.0
|
@@ -39,6 +39,13 @@ describe GreatSchools::School do
|
|
39
39
|
school.reviews_link.should eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=13978&s_cid=gsapi')
|
40
40
|
school.school_stats_link.should eql('http://www.greatschools.org/cgi-bin/CA/otherprivate/13978')
|
41
41
|
end
|
42
|
+
|
43
|
+
it 'should return an empty array if the server response with no data (404)' do
|
44
|
+
FakeWeb.register_uri(:get, 'http://api.greatschools.org/schools/AS/Pago-Pago?limit=2&key=0123456789ABCDEF', body: nil, status: ['404', 'Not Found'])
|
45
|
+
|
46
|
+
schools = GreatSchools::School.browse('AS', 'Pago Pago', limit: 2)
|
47
|
+
schools.size.should eql(0)
|
48
|
+
end
|
42
49
|
end
|
43
50
|
|
44
51
|
describe '#nearby' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: great_schools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael J. Sepcot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|