great_schools 0.2.1 → 0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 8dacaa7590acb825582391555c7f78611a8ca1fc
4
- data.tar.gz: 855cd94cb68b95a934a117337e16750e59aef0aa
2
+ SHA256:
3
+ metadata.gz: 6a5a30108f13ca85f684810394a1dde2a5c66d4c020fc9bd90bc47d3ffd0d221
4
+ data.tar.gz: 56350ed5520a3b4147bb3ae852d54f988ec440f9dd781262ff1c4e4815966979
5
5
  SHA512:
6
- metadata.gz: eb4d033feabc3e97f12b8689f03ea70a70b4141afe4d2bb4dfbe6b6cd56eb44cbfe29a1cc47c0425dde7751ab8f9e696d0c5f06d4dba47a94a79c2ae50f8e92e
7
- data.tar.gz: 1cf08131c9d8163d136145a71e964e7b1bbc3b33911d597fea0b274807c7cfadfb1430c757f60cba15ca334a047990e60c943fbb64dce5b290fd3af276061410
6
+ metadata.gz: 300ccfb782b1b7fe143f0a1f63b3d509bb8174ea6caee999654fe187781b6d216cabd3e07c2cc9c0f65ea14f01548b166b98aca97b2026d91855ee06bfd956b2
7
+ data.tar.gz: 8cce7bad7e050013c5c798462fdc2099068aae80b8c8a092670597ac1b554cf20e2c7ad56af7e26b48eb904a8edf46a983a707bfed648b5cc4cbe66dbef50a88
data/Rakefile CHANGED
@@ -4,3 +4,11 @@ require 'rspec/core/rake_task'
4
4
  RSpec::Core::RakeTask.new('spec')
5
5
 
6
6
  task default: :spec
7
+
8
+ task :console do
9
+ require 'irb'
10
+ require 'irb/completion'
11
+ require 'great_schools'
12
+ ARGV.clear
13
+ IRB.start
14
+ end
@@ -18,13 +18,13 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.required_ruby_version = '>= 1.9.3'
21
+ spec.required_ruby_version = '>= 2.0.0'
22
22
 
23
- spec.add_development_dependency 'bundler', '~> 1.3'
23
+ spec.add_development_dependency 'bundler'
24
24
  spec.add_development_dependency 'fakeweb'
25
25
  spec.add_development_dependency 'rake'
26
26
  spec.add_development_dependency 'rspec'
27
27
 
28
- spec.add_dependency 'activesupport', '>= 3.0.0'
29
- spec.add_dependency 'httparty', '~> 0.12.0'
28
+ spec.add_dependency 'activesupport'
29
+ spec.add_dependency 'httparty'
30
30
  end
@@ -44,7 +44,7 @@ module GreatSchools
44
44
  # ++
45
45
  class API
46
46
  class << self # Class methods
47
- DOMAIN = 'http://api.greatschools.org'
47
+ DOMAIN = 'https://api.greatschools.org'
48
48
 
49
49
  # The API access key, must be set before making any requests.
50
50
  attr_accessor :key
@@ -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 = 1 # version when you make backwards-compatible bug fixes
5
+ PATCH = 3 # 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
@@ -6,22 +6,22 @@ describe GreatSchools::Census do
6
6
  xml = File.read(File.expand_path(
7
7
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_census_data.xml')
8
8
  ))
9
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/school/census/ND/20?key=0123456789ABCDEF', body: xml)
9
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/school/census/ND/20?key=0123456789ABCDEF', body: xml)
10
10
 
11
11
  census = GreatSchools::Census.for_school('ND', 20)
12
- census.school_name.should eql('Simle Middle School')
13
- census.address.should eql('1215 N 19th St, Bismarck, ND 58501')
14
- census.latitude.should eql('46.8179')
15
- census.longitude.should eql('-100.7631')
16
- census.phone.should eql('(701) 221-3570')
17
- census.type.should eql('public')
18
- census.district.should eql('Bismarck 1')
19
- census.enrollment.should eql('851')
20
- census.free_and_reduced_price_lunch.should eql('23.3843')
21
- census.student_teacher_ratio.should eql('14.1')
12
+ expect(census.school_name).to eq('Simle Middle School')
13
+ expect(census.address).to eq('1215 N 19th St, Bismarck, ND 58501')
14
+ expect(census.latitude).to eq('46.8179')
15
+ expect(census.longitude).to eq('-100.7631')
16
+ expect(census.phone).to eq('(701) 221-3570')
17
+ expect(census.type).to eq('public')
18
+ expect(census.district).to eq('Bismarck 1')
19
+ expect(census.enrollment).to eq('851')
20
+ expect(census.free_and_reduced_price_lunch).to eq('23.3843')
21
+ expect(census.student_teacher_ratio).to eq('14.1')
22
22
 
23
23
  census.ethnicities.each do |ethnicity|
24
- ethnicity.should be_a(GreatSchools::Ethnicity)
24
+ expect(ethnicity).to be_a(GreatSchools::Ethnicity)
25
25
  end
26
26
  end
27
27
  end
@@ -6,25 +6,25 @@ describe GreatSchools::Census do
6
6
  xml = File.read(File.expand_path(
7
7
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'nearby_cities.xml')
8
8
  ))
9
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/cities/nearby/CA/Bakersfield?radius=16&key=0123456789ABCDEF', body: xml)
9
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/cities/nearby/CA/Bakersfield?radius=16&key=0123456789ABCDEF', body: xml)
10
10
 
11
11
  cities = GreatSchools::City.nearby('CA', 'Bakersfield', radius: 16)
12
12
 
13
- cities.size.should eql(2)
14
- cities[0].name.should eql('Lamont')
15
- cities[1].name.should eql('Arvin')
13
+ expect(cities.size).to eq(2)
14
+ expect(cities[0].name).to eq('Lamont')
15
+ expect(cities[1].name).to eq('Arvin')
16
16
 
17
17
  city = cities.first
18
- city.state.should eql('CA')
19
- city.name.should eql('Lamont')
20
- city.rating.should eql('3')
21
- city.total_schools.should eql('5')
22
- city.elementary_schools.should eql('3')
23
- city.middle_schools.should eql('2')
24
- city.high_schools.should eql('1')
25
- city.public_schools.should eql('5')
26
- city.charter_schools.should eql('0')
27
- city.private_schools.should eql('0')
18
+ expect(city.state).to eq('CA')
19
+ expect(city.name).to eq('Lamont')
20
+ expect(city.rating).to eq('3')
21
+ expect(city.total_schools).to eq('5')
22
+ expect(city.elementary_schools).to eq('3')
23
+ expect(city.middle_schools).to eq('2')
24
+ expect(city.high_schools).to eq('1')
25
+ expect(city.public_schools).to eq('5')
26
+ expect(city.charter_schools).to eq('0')
27
+ expect(city.private_schools).to eq('0')
28
28
  end
29
29
  end
30
30
 
@@ -33,20 +33,20 @@ describe GreatSchools::Census do
33
33
  xml = File.read(File.expand_path(
34
34
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'city_overview.xml')
35
35
  ))
36
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/cities/AK/Anchorage?key=0123456789ABCDEF', body: xml)
36
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/cities/AK/Anchorage?key=0123456789ABCDEF', body: xml)
37
37
 
38
38
  city = GreatSchools::City.overview('AK', 'Anchorage')
39
39
 
40
- city.state.should eql('AK')
41
- city.name.should eql('Anchorage')
42
- city.rating.should eql('7')
43
- city.total_schools.should eql('103')
44
- city.elementary_schools.should eql('76')
45
- city.middle_schools.should eql('41')
46
- city.high_schools.should eql('33')
47
- city.public_schools.should eql('74')
48
- city.charter_schools.should eql('6')
49
- city.private_schools.should eql('23')
40
+ expect(city.state).to eq('AK')
41
+ expect(city.name).to eq('Anchorage')
42
+ expect(city.rating).to eq('7')
43
+ expect(city.total_schools).to eq('103')
44
+ expect(city.elementary_schools).to eq('76')
45
+ expect(city.middle_schools).to eq('41')
46
+ expect(city.high_schools).to eq('33')
47
+ expect(city.public_schools).to eq('74')
48
+ expect(city.charter_schools).to eq('6')
49
+ expect(city.private_schools).to eq('23')
50
50
  end
51
51
  end
52
52
 
@@ -54,7 +54,7 @@ describe GreatSchools::Census do
54
54
  it 'should make a GreatSchools::District#browse call using the state/city attributes' do
55
55
  city = GreatSchools::City.new(state: 'IL', city: 'Chicago')
56
56
 
57
- GreatSchools::District.should_receive(:browse).with('IL', 'Chicago')
57
+ expect(GreatSchools::District).to receive(:browse).with('IL', 'Chicago')
58
58
 
59
59
  city.districts
60
60
  end
@@ -64,7 +64,7 @@ describe GreatSchools::Census do
64
64
  it 'should make a GreatSchools::Review#for_city call using the state/city attributes' do
65
65
  city = GreatSchools::City.new(state: 'IL', name: 'Chicago')
66
66
 
67
- GreatSchools::Review.should_receive(:for_city).with('IL', 'Chicago', {})
67
+ expect(GreatSchools::Review).to receive(:for_city).with('IL', 'Chicago', {})
68
68
 
69
69
  city.reviews
70
70
  end
@@ -6,29 +6,29 @@ describe GreatSchools::District do
6
6
  xml = File.read(File.expand_path(
7
7
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'browse_districts.xml')
8
8
  ))
9
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/districts/CA/San-Francisco?key=0123456789ABCDEF', body: xml)
9
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/districts/CA/San-Francisco?key=0123456789ABCDEF', body: xml)
10
10
 
11
11
  districts = GreatSchools::District.browse('CA', 'San Francisco')
12
12
 
13
- districts.size.should eql(2)
14
- districts[0].name.should eql('San Francisco Unified School District')
15
- districts[1].name.should eql('San Francisco County Office of Education')
13
+ expect(districts.size).to eql(2)
14
+ expect(districts[0].name).to eql('San Francisco Unified School District')
15
+ expect(districts[1].name).to eql('San Francisco County Office of Education')
16
16
 
17
17
  district = districts.first
18
- district.name.should eql('San Francisco Unified School District')
19
- district.nces_code.should eql('0634410')
20
- district.district_rating.should eql('6')
21
- district.address.should eql('555 Franklin St., San Francisco, CA 94102')
22
- district.phone.should eql('(415) 241-6000')
23
- district.fax.should eql('(415) 241-6012')
24
- district.website.should eql('http://www.sfusd.k12.ca.us')
25
- district.grade_range.should eql('K-12 & ungraded')
26
- district.total_schools.should eql('121')
27
- district.elementary_schools.should eql('84')
28
- district.middle_schools.should eql('36')
29
- district.high_schools.should eql('34')
30
- district.public_schools.should eql('113')
31
- district.charter_schools.should eql('8')
18
+ expect(district.name).to eql('San Francisco Unified School District')
19
+ expect(district.nces_code).to eql('0634410')
20
+ expect(district.district_rating).to eql('6')
21
+ expect(district.address).to eql('555 Franklin St., San Francisco, CA 94102')
22
+ expect(district.phone).to eql('(415) 241-6000')
23
+ expect(district.fax).to eql('(415) 241-6012')
24
+ expect(district.website).to eql('http://www.sfusd.k12.ca.us')
25
+ expect(district.grade_range).to eql('K-12 & ungraded')
26
+ expect(district.total_schools).to eql('121')
27
+ expect(district.elementary_schools).to eql('84')
28
+ expect(district.middle_schools).to eql('36')
29
+ expect(district.high_schools).to eql('34')
30
+ expect(district.public_schools).to eql('113')
31
+ expect(district.charter_schools).to eql('8')
32
32
  end
33
33
  end
34
34
  end
@@ -5,13 +5,13 @@ describe GreatSchools::Ethnicity do
5
5
  xml = File.read(File.expand_path(
6
6
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_census_data.xml')
7
7
  ))
8
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/school/census/ND/20?key=0123456789ABCDEF', body: xml)
8
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/school/census/ND/20?key=0123456789ABCDEF', body: xml)
9
9
 
10
10
  census = GreatSchools::Census.for_school('ND', 20)
11
11
  ethnicity = census.ethnicities.first
12
12
 
13
- ethnicity.name.should eql('White, non-Hispanic')
14
- ethnicity.value.should eql('91.0693')
15
- ethnicity.year.should eql('2007')
13
+ expect(ethnicity.name).to eql('White, non-Hispanic')
14
+ expect(ethnicity.value).to eql('91.0693')
15
+ expect(ethnicity.year).to eql('2007')
16
16
  end
17
17
  end
@@ -6,16 +6,16 @@ describe GreatSchools::Score do
6
6
  xml = File.read(File.expand_path(
7
7
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_test_scores.xml')
8
8
  ))
9
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/school/tests/AZ/1?key=0123456789ABCDEF', body: xml)
9
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/school/tests/AZ/1?key=0123456789ABCDEF', body: xml)
10
10
 
11
11
  score = GreatSchools::Score.for_school('AZ', 1)
12
12
  rank = score.rank
13
13
 
14
- rank.name.should eql('AZ GS Rating')
15
- rank.scale.should eql('1-10')
16
- rank.year.should eql('2008')
17
- rank.score.should eql('9.0')
18
- rank.description.should eql(<<-TEXT.squish)
14
+ expect(rank.name).to eql('AZ GS Rating')
15
+ expect(rank.scale).to eql('1-10')
16
+ expect(rank.year).to eql('2008')
17
+ expect(rank.score).to eql('9.0')
18
+ expect(rank.description).to eql(<<-TEXT.squish)
19
19
  GreatSchools Ratings for Arizona are based on the 2007-2008 Arizona's
20
20
  Instrument to Measure Standards (AIMS) reading, writing and math results.
21
21
  GreatSchools compared the test results for each grade and subject across
@@ -6,21 +6,21 @@ describe GreatSchools::Score do
6
6
  xml = File.read(File.expand_path(
7
7
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_test_scores.xml')
8
8
  ))
9
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/school/tests/AZ/1?key=0123456789ABCDEF', body: xml)
9
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/school/tests/AZ/1?key=0123456789ABCDEF', body: xml)
10
10
 
11
11
  score = GreatSchools::Score.for_school('AZ', 1)
12
12
  results = score.tests.first.results
13
13
 
14
- results.size.should eql(2)
15
- results[0].subject_name.should eql('Writing')
16
- results[1].subject_name.should eql('Reading')
14
+ expect(results.size).to eql(2)
15
+ expect(results[0].subject_name).to eql('Writing')
16
+ expect(results[1].subject_name).to eql('Reading')
17
17
 
18
18
  result = results.first
19
- result.grade_name.should eql('10')
20
- result.score.should eql('81.0')
21
- result.subject_name.should eql('Writing')
22
- result.test_id.should eql('AZ00137')
23
- result.year.should eql('2008')
19
+ expect(result.grade_name).to eql('10')
20
+ expect(result.score).to eql('81.0')
21
+ expect(result.subject_name).to eql('Writing')
22
+ expect(result.test_id).to eql('AZ00137')
23
+ expect(result.year).to eql('2008')
24
24
  end
25
25
  end
26
26
  end
@@ -6,22 +6,22 @@ describe GreatSchools::Review do
6
6
  xml = File.read(File.expand_path(
7
7
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_reviews.xml')
8
8
  ))
9
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/reviews/city/CA/Alameda?limit=2&key=0123456789ABCDEF', body: xml)
9
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/reviews/city/CA/Alameda?limit=2&key=0123456789ABCDEF', body: xml)
10
10
 
11
11
  reviews = GreatSchools::Review.for_city('CA', 'Alameda', limit: 2)
12
12
 
13
- reviews.size.should eql(2)
14
- reviews[0].submitter.should eql('former student')
15
- reviews[1].submitter.should eql('parent')
13
+ expect(reviews.size).to eql(2)
14
+ expect(reviews[0].submitter).to eql('former student')
15
+ expect(reviews[1].submitter).to eql('parent')
16
16
 
17
17
  review = reviews.first
18
- review.school_name.should eql('Alameda High School')
19
- review.school_address.should eql('2201 Encinal Ave., Alameda, CA 94501')
20
- review.review_link.should eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=1&s_cid=gsapi&lr=true#ps398220')
21
- review.rating.should eql('3')
22
- review.submitter.should eql('former student')
23
- review.posted_date.should eql('2006/06/06')
24
- review.comments.should eql('The staff gets on the level of the students and everything is kaotic.')
18
+ expect(review.school_name).to eql('Alameda High School')
19
+ expect(review.school_address).to eql('2201 Encinal Ave., Alameda, CA 94501')
20
+ expect(review.review_link).to eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=1&s_cid=gsapi&lr=true#ps398220')
21
+ expect(review.rating).to eql('3')
22
+ expect(review.submitter).to eql('former student')
23
+ expect(review.posted_date).to eql('2006/06/06')
24
+ expect(review.comments).to eql('The staff gets on the level of the students and everything is kaotic.')
25
25
  end
26
26
  end
27
27
 
@@ -30,22 +30,22 @@ describe GreatSchools::Review do
30
30
  xml = File.read(File.expand_path(
31
31
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_reviews.xml')
32
32
  ))
33
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/reviews/school/CA/1?limit=2&key=0123456789ABCDEF', body: xml)
33
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/reviews/school/CA/1?limit=2&key=0123456789ABCDEF', body: xml)
34
34
 
35
35
  reviews = GreatSchools::Review.for_school('CA', 1, limit: 2)
36
36
 
37
- reviews.size.should eql(2)
38
- reviews[0].submitter.should eql('former student')
39
- reviews[1].submitter.should eql('parent')
37
+ expect(reviews.size).to eql(2)
38
+ expect(reviews[0].submitter).to eql('former student')
39
+ expect(reviews[1].submitter).to eql('parent')
40
40
 
41
41
  review = reviews.first
42
- review.school_name.should eql('Alameda High School')
43
- review.school_address.should eql('2201 Encinal Ave., Alameda, CA 94501')
44
- review.review_link.should eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=1&s_cid=gsapi&lr=true#ps398220')
45
- review.rating.should eql('3')
46
- review.submitter.should eql('former student')
47
- review.posted_date.should eql('2006/06/06')
48
- review.comments.should eql('The staff gets on the level of the students and everything is kaotic.')
42
+ expect(review.school_name).to eql('Alameda High School')
43
+ expect(review.school_address).to eql('2201 Encinal Ave., Alameda, CA 94501')
44
+ expect(review.review_link).to eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=1&s_cid=gsapi&lr=true#ps398220')
45
+ expect(review.rating).to eql('3')
46
+ expect(review.submitter).to eql('former student')
47
+ expect(review.posted_date).to eql('2006/06/06')
48
+ expect(review.comments).to eql('The staff gets on the level of the students and everything is kaotic.')
49
49
  end
50
50
  end
51
51
 
@@ -53,20 +53,20 @@ describe GreatSchools::Review do
53
53
  xml = File.read(File.expand_path(
54
54
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_profile.xml')
55
55
  ))
56
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/schools/CA/1?key=0123456789ABCDEF', body: xml)
56
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/schools/CA/1?key=0123456789ABCDEF', body: xml)
57
57
 
58
58
  school = GreatSchools::School.profile('CA', 1)
59
59
  reviews = school.parent_reviews
60
60
 
61
- reviews.size.should eql(5)
61
+ expect(reviews.size).to eql(5)
62
62
 
63
63
  review = reviews.first
64
- review.school_name.should eql('Alameda High School')
65
- review.school_address.should eql('2201 Encinal Ave., Alameda, CA 94501')
66
- review.review_link.should eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=1&s_cid=gsapi&lr=true#ps398220')
67
- review.rating.should eql('3')
68
- review.submitter.should eql('former student')
69
- review.posted_date.should eql('2006/06/06')
70
- review.comments.should eql('The staff gets on the level of the students and everything is kaotic.')
64
+ expect(review.school_name).to eql('Alameda High School')
65
+ expect(review.school_address).to eql('2201 Encinal Ave., Alameda, CA 94501')
66
+ expect(review.review_link).to eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=1&s_cid=gsapi&lr=true#ps398220')
67
+ expect(review.rating).to eql('3')
68
+ expect(review.submitter).to eql('former student')
69
+ expect(review.posted_date).to eql('2006/06/06')
70
+ expect(review.comments).to eql('The staff gets on the level of the students and everything is kaotic.')
71
71
  end
72
72
  end
@@ -6,45 +6,45 @@ describe GreatSchools::School do
6
6
  xml = File.read(File.expand_path(
7
7
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'browse_schools.xml')
8
8
  ))
9
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/schools/CA/Truckee?limit=2&key=0123456789ABCDEF', body: xml)
9
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/schools/CA/Truckee?limit=2&key=0123456789ABCDEF', body: xml)
10
10
 
11
11
  schools = GreatSchools::School.browse('CA', 'Truckee', limit: 2)
12
12
 
13
- schools.size.should eql(2)
14
- schools[0].name.should eql('Alder Creek Middle School')
15
- schools[1].name.should eql('Cold Stream Alternative School')
13
+ expect(schools.size).to eql(2)
14
+ expect(schools[0].name).to eql('Alder Creek Middle School')
15
+ expect(schools[1].name).to eql('Cold Stream Alternative School')
16
16
 
17
17
  school = schools.first
18
- school.id.should eql('13978')
19
- school.name.should eql('Alder Creek Middle School')
20
- school.type.should eql('public')
21
- school.grade_range.should eql('6-8')
22
- school.enrollment.should eql('598')
23
- school.rating.should eql('8')
24
- school.parent_rating.should eql('4')
25
- school.city.should eql('Truckee')
26
- school.state.should eql('CA')
27
- school.district_id.should eql('509')
28
- school.district.should eql('Tahoe-Truckee Joint Unified School District')
29
- school.district_nces_id.should eql('0638770')
30
- school.address.should eql('10931 Alder Dr., Truckee, CA 96161')
31
- school.phone.should eql('(530) 582-2750')
32
- school.fax.should eql('(530) 582-7640')
33
- school.website.should eql('http://www.ttusd.org')
34
- school.nces_id.should eql('063877011005')
35
- school.latitude.should eql('39.3454')
36
- school.longitude.should eql('-120.1735')
37
- school.overview_link.should eql('http://www.greatschools.org/modperl/browse_school/ca/13978?s_cid=gsapi')
38
- school.ratings_link.should eql('http://www.greatschools.org/school/rating.page?state=CA&id=13978&s_cid=gsapi')
39
- school.reviews_link.should eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=13978&s_cid=gsapi')
40
- school.school_stats_link.should eql('http://www.greatschools.org/cgi-bin/CA/otherprivate/13978')
18
+ expect(school.id).to eql('13978')
19
+ expect(school.name).to eql('Alder Creek Middle School')
20
+ expect(school.type).to eql('public')
21
+ expect(school.grade_range).to eql('6-8')
22
+ expect(school.enrollment).to eql('598')
23
+ expect(school.rating).to eql('8')
24
+ expect(school.parent_rating).to eql('4')
25
+ expect(school.city).to eql('Truckee')
26
+ expect(school.state).to eql('CA')
27
+ expect(school.district_id).to eql('509')
28
+ expect(school.district).to eql('Tahoe-Truckee Joint Unified School District')
29
+ expect(school.district_nces_id).to eql('0638770')
30
+ expect(school.address).to eql('10931 Alder Dr., Truckee, CA 96161')
31
+ expect(school.phone).to eql('(530) 582-2750')
32
+ expect(school.fax).to eql('(530) 582-7640')
33
+ expect(school.website).to eql('http://www.ttusd.org')
34
+ expect(school.nces_id).to eql('063877011005')
35
+ expect(school.latitude).to eql('39.3454')
36
+ expect(school.longitude).to eql('-120.1735')
37
+ expect(school.overview_link).to eql('http://www.greatschools.org/modperl/browse_school/ca/13978?s_cid=gsapi')
38
+ expect(school.ratings_link).to eql('http://www.greatschools.org/school/rating.page?state=CA&id=13978&s_cid=gsapi')
39
+ expect(school.reviews_link).to eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=13978&s_cid=gsapi')
40
+ expect(school.school_stats_link).to eql('http://www.greatschools.org/cgi-bin/CA/otherprivate/13978')
41
41
  end
42
42
 
43
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'])
44
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/schools/AS/Pago-Pago?limit=2&key=0123456789ABCDEF', body: nil, status: ['404', 'Not Found'])
45
45
 
46
46
  schools = GreatSchools::School.browse('AS', 'Pago Pago', limit: 2)
47
- schools.size.should eql(0)
47
+ expect(schools.size).to eql(0)
48
48
  end
49
49
  end
50
50
 
@@ -53,41 +53,41 @@ describe GreatSchools::School do
53
53
  xml = File.read(File.expand_path(
54
54
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'nearby_schools.xml')
55
55
  ))
56
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/schools/nearby?state=CA&zip=94105&limit=2&key=0123456789ABCDEF', body: xml)
56
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/schools/nearby?state=CA&zip=94105&limit=2&key=0123456789ABCDEF', body: xml)
57
57
 
58
58
  schools = GreatSchools::School.nearby('CA', zip_code: 94105, limit: 2)
59
59
 
60
- schools.size.should eql(2)
61
- schools[0].name.should eql('Youth Chance High School')
62
- schools[1].name.should eql('Notre Dame des Victoires School')
60
+ expect(schools.size).to eql(2)
61
+ expect(schools[0].name).to eql('Youth Chance High School')
62
+ expect(schools[1].name).to eql('Notre Dame des Victoires School')
63
63
 
64
64
  school = schools.first
65
- school.id.should eql('11536')
66
- school.name.should eql('Youth Chance High School')
67
- school.type.should eql('private')
68
- school.grade_range.should eql('10-12')
69
- school.enrollment.should eql('25')
70
- school.city.should eql('San Francisco')
71
- school.state.should eql('CA')
72
- school.address.should eql('169 Steuart Street, San Francisco, CA 94105')
73
- school.phone.should eql('(415) 615-1337')
74
- school.nces_id.should eql('A9900759')
75
- school.latitude.should eql('37.7924')
76
- school.longitude.should eql('-122.3921')
77
- school.overview_link.should eql('http://www.greatschools.org/cgi-bin/ca/private/11536?s_cid=gsapi')
78
- school.ratings_link.should eql('http://www.greatschools.org/school/rating.page?state=CA&id=11536&s_cid=gsapi')
79
- school.reviews_link.should eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=11536&s_cid=gsapi')
65
+ expect(school.id).to eql('11536')
66
+ expect(school.name).to eql('Youth Chance High School')
67
+ expect(school.type).to eql('private')
68
+ expect(school.grade_range).to eql('10-12')
69
+ expect(school.enrollment).to eql('25')
70
+ expect(school.city).to eql('San Francisco')
71
+ expect(school.state).to eql('CA')
72
+ expect(school.address).to eql('169 Steuart Street, San Francisco, CA 94105')
73
+ expect(school.phone).to eql('(415) 615-1337')
74
+ expect(school.nces_id).to eql('A9900759')
75
+ expect(school.latitude).to eql('37.7924')
76
+ expect(school.longitude).to eql('-122.3921')
77
+ expect(school.overview_link).to eql('http://www.greatschools.org/cgi-bin/ca/private/11536?s_cid=gsapi')
78
+ expect(school.ratings_link).to eql('http://www.greatschools.org/school/rating.page?state=CA&id=11536&s_cid=gsapi')
79
+ expect(school.reviews_link).to eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=11536&s_cid=gsapi')
80
80
  end
81
81
 
82
82
  it 'should handle no results coming back from the web service' do
83
83
  xml = File.read(File.expand_path(
84
84
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'nearby_schools_empty.xml')
85
85
  ))
86
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/schools/nearby?state=CA&zip=00000&limit=2&key=0123456789ABCDEF', body: xml)
86
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/schools/nearby?state=CA&zip=00000&limit=2&key=0123456789ABCDEF', body: xml)
87
87
 
88
88
  schools = GreatSchools::School.nearby('CA', zip_code: '00000', limit: 2)
89
89
 
90
- schools.size.should eql(0)
90
+ expect(schools.size).to eql(0)
91
91
  end
92
92
  end
93
93
 
@@ -96,33 +96,33 @@ describe GreatSchools::School do
96
96
  xml = File.read(File.expand_path(
97
97
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_profile.xml')
98
98
  ))
99
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/schools/CA/1?key=0123456789ABCDEF', body: xml)
99
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/schools/CA/1?key=0123456789ABCDEF', body: xml)
100
100
 
101
101
  school = GreatSchools::School.profile('CA', 1)
102
102
 
103
- school.id.should eql('1')
104
- school.name.should eql('Alameda High School')
105
- school.type.should eql('public')
106
- school.grade_range.should eql('9-12')
107
- school.enrollment.should eql('1938')
108
- school.city.should eql('Alameda')
109
- school.state.should eql('CA')
110
- school.district_id.should eql('1')
111
- school.district.should eql('Alameda City Unified School District')
112
- school.district_nces_id.should eql('0601770')
113
- school.address.should eql('2201 Encinal Ave., Alameda, CA 94501')
114
- school.phone.should eql('(510) 337-7022')
115
- school.fax.should eql('(510) 521-4740')
116
- school.website.should eql('http://ahs.alameda.k12.ca.us/')
117
- school.nces_id.should eql('060177000041')
118
- school.latitude.should eql('37.764267')
119
- school.longitude.should eql('-122.24818')
120
- school.overview_link.should eql('http://www.greatschools.org/modperl/browse_school/ca/1?s_cid=gsapi')
121
- school.ratings_link.should eql('http://www.greatschools.org/school/rating.page?state=CA&id=1&s_cid=gsapi')
122
- school.reviews_link.should eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=1&s_cid=gsapi')
103
+ expect(school.id).to eql('1')
104
+ expect(school.name).to eql('Alameda High School')
105
+ expect(school.type).to eql('public')
106
+ expect(school.grade_range).to eql('9-12')
107
+ expect(school.enrollment).to eql('1938')
108
+ expect(school.city).to eql('Alameda')
109
+ expect(school.state).to eql('CA')
110
+ expect(school.district_id).to eql('1')
111
+ expect(school.district).to eql('Alameda City Unified School District')
112
+ expect(school.district_nces_id).to eql('0601770')
113
+ expect(school.address).to eql('2201 Encinal Ave., Alameda, CA 94501')
114
+ expect(school.phone).to eql('(510) 337-7022')
115
+ expect(school.fax).to eql('(510) 521-4740')
116
+ expect(school.website).to eql('http://ahs.alameda.k12.ca.us/')
117
+ expect(school.nces_id).to eql('060177000041')
118
+ expect(school.latitude).to eql('37.764267')
119
+ expect(school.longitude).to eql('-122.24818')
120
+ expect(school.overview_link).to eql('http://www.greatschools.org/modperl/browse_school/ca/1?s_cid=gsapi')
121
+ expect(school.ratings_link).to eql('http://www.greatschools.org/school/rating.page?state=CA&id=1&s_cid=gsapi')
122
+ expect(school.reviews_link).to eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=1&s_cid=gsapi')
123
123
 
124
124
  school.parent_reviews.each do |review|
125
- review.should be_a(GreatSchools::Review)
125
+ expect(review).to be_a(GreatSchools::Review)
126
126
  end
127
127
  end
128
128
  end
@@ -132,31 +132,31 @@ describe GreatSchools::School do
132
132
  xml = File.read(File.expand_path(
133
133
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_search.xml')
134
134
  ))
135
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/search/schools?limit=2&q=Alameda%20Christian&state=CA&key=0123456789ABCDEF', body: xml)
135
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/search/schools?limit=2&q=Alameda%20Christian&state=CA&key=0123456789ABCDEF', body: xml)
136
136
 
137
137
  schools = GreatSchools::School.search('CA', 'Alameda Christian', limit: 2)
138
138
 
139
- schools.size.should eql(2)
140
- schools[0].name.should eql('Alameda Christian School')
141
- schools[1].name.should eql('Chinese Christian Schools-Alameda')
139
+ expect(schools.size).to eql(2)
140
+ expect(schools[0].name).to eql('Alameda Christian School')
141
+ expect(schools[1].name).to eql('Chinese Christian Schools-Alameda')
142
142
 
143
143
  school = schools.first
144
- school.id.should eql('8485')
145
- school.name.should eql('Alameda Christian School')
146
- school.type.should eql('private')
147
- school.grade_range.should eql('K-8')
148
- school.enrollment.should eql('52')
149
- school.parent_rating.should eql('5')
150
- school.city.should eql('Alameda')
151
- school.state.should eql('CA')
152
- school.address.should eql('2226 Pacific Ave, Alameda, CA 94501')
153
- school.phone.should eql('(510) 523-1000')
154
- school.nces_id.should eql('00079445')
155
- school.latitude.should eql('37.768623')
156
- school.longitude.should eql('-122.243965')
157
- school.overview_link.should eql('http://www.greatschools.org/cgi-bin/ca/private/8485?s_cid=gsapi')
158
- school.ratings_link.should eql('http://www.greatschools.org/school/rating.page?state=CA&id=8485&s_cid=gsapi')
159
- school.reviews_link.should eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=8485&s_cid=gsapi')
144
+ expect(school.id).to eql('8485')
145
+ expect(school.name).to eql('Alameda Christian School')
146
+ expect(school.type).to eql('private')
147
+ expect(school.grade_range).to eql('K-8')
148
+ expect(school.enrollment).to eql('52')
149
+ expect(school.parent_rating).to eql('5')
150
+ expect(school.city).to eql('Alameda')
151
+ expect(school.state).to eql('CA')
152
+ expect(school.address).to eql('2226 Pacific Ave, Alameda, CA 94501')
153
+ expect(school.phone).to eql('(510) 523-1000')
154
+ expect(school.nces_id).to eql('00079445')
155
+ expect(school.latitude).to eql('37.768623')
156
+ expect(school.longitude).to eql('-122.243965')
157
+ expect(school.overview_link).to eql('http://www.greatschools.org/cgi-bin/ca/private/8485?s_cid=gsapi')
158
+ expect(school.ratings_link).to eql('http://www.greatschools.org/school/rating.page?state=CA&id=8485&s_cid=gsapi')
159
+ expect(school.reviews_link).to eql('http://www.greatschools.org/school/parentReviews.page?state=CA&id=8485&s_cid=gsapi')
160
160
  end
161
161
  end
162
162
 
@@ -164,7 +164,7 @@ describe GreatSchools::School do
164
164
 
165
165
  describe '.census' do
166
166
  it 'should make a GreatSchools::Census#for_school call using state/gs_id attributes' do
167
- GreatSchools::Census.should_receive(:for_school).with('CA', 1)
167
+ expect(GreatSchools::Census).to receive(:for_school).with('CA', 1)
168
168
 
169
169
  school.census
170
170
  end
@@ -172,7 +172,7 @@ describe GreatSchools::School do
172
172
 
173
173
  describe '.reviews' do
174
174
  it 'should make a GreatSchools::Review#for_school call using state/gs_id attributes' do
175
- GreatSchools::Review.should_receive(:for_school).with('CA', 1, {})
175
+ expect(GreatSchools::Review).to receive(:for_school).with('CA', 1, {})
176
176
 
177
177
  school.reviews
178
178
  end
@@ -180,7 +180,7 @@ describe GreatSchools::School do
180
180
 
181
181
  describe '.score' do
182
182
  it 'should make a GreatSchools::Score#for_school call using state/gs_id attributes' do
183
- GreatSchools::Score.should_receive(:for_school).with('CA', 1)
183
+ expect(GreatSchools::Score).to receive(:for_school).with('CA', 1)
184
184
 
185
185
  school.score
186
186
  end
@@ -6,14 +6,14 @@ describe GreatSchools::Score do
6
6
  xml = File.read(File.expand_path(
7
7
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_test_scores.xml')
8
8
  ))
9
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/school/tests/AZ/1?key=0123456789ABCDEF', body: xml)
9
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/school/tests/AZ/1?key=0123456789ABCDEF', body: xml)
10
10
 
11
11
  score = GreatSchools::Score.for_school('AZ', 1)
12
12
 
13
- score.school_name.should eql('Flagstaff High School')
14
- score.rank.should be_a(GreatSchools::Rank)
13
+ expect(score.school_name).to eql('Flagstaff High School')
14
+ expect(score.rank).to be_a(GreatSchools::Rank)
15
15
  score.tests.each do |test|
16
- test.should be_a(GreatSchools::Test)
16
+ expect(test).to be_a(GreatSchools::Test)
17
17
  end
18
18
  end
19
19
  end
@@ -5,20 +5,20 @@ describe GreatSchools::Test do
5
5
  xml = File.read(File.expand_path(
6
6
  File.join(File.dirname(__FILE__), '..', 'fixtures', 'school_test_scores.xml')
7
7
  ))
8
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/school/tests/AZ/1?key=0123456789ABCDEF', body: xml)
8
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/school/tests/AZ/1?key=0123456789ABCDEF', body: xml)
9
9
 
10
10
  score = GreatSchools::Score.for_school('AZ', 1)
11
11
  tests = score.tests
12
12
 
13
- tests.size.should eql(1)
13
+ expect(tests.size).to eql(1)
14
14
 
15
15
  test = tests.first
16
- test.name.should eql('Arizona\'s Instrument to Measure Standards')
17
- test.id.should eql('AZ00137')
18
- test.abbreviation.should eql('AIMS')
19
- test.scale.should eql('% meeting or exceeding standards')
20
- test.level_code.should eql('e,m,h')
21
- test.description.should eql(<<-TEXT.squish)
16
+ expect(test.name).to eql('Arizona\'s Instrument to Measure Standards')
17
+ expect(test.id).to eql('AZ00137')
18
+ expect(test.abbreviation).to eql('AIMS')
19
+ expect(test.scale).to eql('% meeting or exceeding standards')
20
+ expect(test.level_code).to eql('e,m,h')
21
+ expect(test.description).to eql(<<-TEXT.squish)
22
22
  In 2007-2008 Arizona's Instrument to Measure Standards (AIMS) was used to
23
23
  test students in reading, writing and mathematics in grades 3 through 8
24
24
  and 10, and in science in grades 4, 8 and high school. AIMS is a
@@ -29,7 +29,7 @@ describe GreatSchools::Test do
29
29
  TEXT
30
30
 
31
31
  test.results.each do |result|
32
- result.should be_a(GreatSchools::Result)
32
+ expect(result).to be_a(GreatSchools::Result)
33
33
  end
34
34
  end
35
35
  end
@@ -5,7 +5,7 @@ describe GreatSchools::API do
5
5
  xml = File.read(File.expand_path(
6
6
  File.join(File.dirname(__FILE__), 'fixtures', 'error.xml')
7
7
  ))
8
- FakeWeb.register_uri(:get, 'http://api.greatschools.org/reviews/city/CA/Foster-City?key=0123456789ABCDEF', body: xml, status: [401, 'Unauthorized'])
8
+ FakeWeb.register_uri(:get, 'https://api.greatschools.org/reviews/city/CA/Foster-City?key=0123456789ABCDEF', body: xml, status: [401, 'Unauthorized'])
9
9
 
10
10
  expect {
11
11
  GreatSchools::API.get('reviews/city/CA/Foster-City')
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: great_schools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
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-13 00:00:00.000000000 Z
11
+ date: 2020-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: fakeweb
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 3.0.0
75
+ version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 3.0.0
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: httparty
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 0.12.0
89
+ version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 0.12.0
96
+ version: '0'
97
97
  description: The GreatSchools API allows access to School Profiles, Test Scores, School
98
98
  Reviews, GreatSchools Ratings, School Districts, and City Profiles.
99
99
  email:
@@ -158,15 +158,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
158
158
  requirements:
159
159
  - - ">="
160
160
  - !ruby/object:Gem::Version
161
- version: 1.9.3
161
+ version: 2.0.0
162
162
  required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  requirements: []
168
- rubyforge_project:
169
- rubygems_version: 2.2.2
168
+ rubygems_version: 3.0.6
170
169
  signing_key:
171
170
  specification_version: 4
172
171
  summary: A Ruby interface to the GreatSchools API.