spark_api 1.3.20 → 1.3.21

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.20
1
+ 1.3.21
@@ -129,7 +129,7 @@ module SparkApi
129
129
  end
130
130
 
131
131
  def street_address
132
- self.UnparsedFirstLineAddress.delete(DATA_MASK).strip().gsub(/\s{2,}/, ' ')
132
+ (self.UnparsedFirstLineAddress || '').delete(DATA_MASK).strip().gsub(/\s{2,}/, ' ')
133
133
  end
134
134
 
135
135
  def region_address
@@ -87,13 +87,22 @@ describe Listing do
87
87
  @listing.should_not respond_to(:Videos)
88
88
  end
89
89
 
90
- it "should return street address" do
91
- @listing.street_address.should eq("100 Someone's St")
92
- end
90
+ describe '.street_address' do
91
+ it 'should return the street address' do
92
+ @listing.street_address.should eq("100 Someone's St")
93
+ end
94
+
95
+ it 'should remove data masks' do
96
+ @listing.StandardFields["UnparsedFirstLineAddress"] = "********"
97
+ @listing.street_address.should eq("")
98
+ end
93
99
 
94
- it "should remove masks from the street address" do
95
- @listing.StandardFields["UnparsedFirstLineAddress"] = "********"
96
- @listing.street_address.should eq("")
100
+ it 'should handle a missing unparsed first line address' do
101
+ [nil, '', ' '].each do |current|
102
+ @listing.StandardFields['UnparsedFirstLineAddress'] = current
103
+ @listing.street_address.should eq('')
104
+ end
105
+ end
97
106
  end
98
107
 
99
108
  it "should return the regional address" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spark_api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 51
4
+ hash: 49
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 20
10
- version: 1.3.20
9
+ - 21
10
+ version: 1.3.21
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brandon Hornseth