sandy 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,8 @@ module Sandy::Provider
8
8
  area_hash = raw_report.fetch("file_data")["curr_custs_aff"]["areas"].first["areas"]
9
9
  @regions = regions_from_report(area_hash)
10
10
  @neighborhoods = neighborhoods_from_report(area_hash)
11
+ rescue
12
+ raise LoadError, "ConEd reponse was not recognizable."
11
13
  end
12
14
 
13
15
  private
@@ -8,6 +8,8 @@ module Sandy::Provider
8
8
  area_hash = raw_report.fetch("root").fetch("curr_custs_aff")["areas"]["area"]["areas"].first[1]
9
9
  @regions = regions_from_report(area_hash)
10
10
  @neighborhoods = neighborhoods_from_report(area_hash)
11
+ rescue
12
+ raise LoadError, "ConEd reponse was not recognizable."
11
13
  end
12
14
 
13
15
  private
data/lib/sandy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sandy
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -2,12 +2,10 @@ require "spec_helper"
2
2
 
3
3
  describe Sandy::Provider::ConEd::Report do
4
4
  describe ".initialize" do
5
- context "with no response" do
6
- it "raises an error" do
7
- end
8
- end
9
5
  context "with an empty response" do
10
- it "raises an error" do
6
+ before { HTTParty.stub(:get).and_return("") }
7
+ it "raises an informative error" do
8
+ expect { Sandy::Provider::ConEd::Report.new }.to raise_error(LoadError, "ConEd reponse was not recognizable.")
11
9
  end
12
10
  end
13
11
  end
@@ -2,11 +2,11 @@ require "spec_helper"
2
2
 
3
3
  describe Sandy::Provider::LIPA::Report do
4
4
  describe ".initialize" do
5
- context "with no response" do
6
- xit "raises an error"
7
- end
8
5
  context "with an empty response" do
9
- xit "raises an error"
6
+ before { HTTParty.stub(:get).and_return("") }
7
+ it "raises an informative error" do
8
+ expect { Sandy::Provider::LIPA::Report.new }.to raise_error(LoadError, "ConEd reponse was not recognizable.")
9
+ end
10
10
  end
11
11
  end
12
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sandy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  version: '0'
139
139
  requirements: []
140
140
  rubyforge_project:
141
- rubygems_version: 1.8.19
141
+ rubygems_version: 1.8.24
142
142
  signing_key:
143
143
  specification_version: 3
144
144
  summary: Power outage data for ConEd in NYC