zillow4r 0.1.0 → 0.1.1

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/test/test_helper.rb CHANGED
@@ -7,6 +7,7 @@ require 'test/unit'
7
7
  Bundler.setup
8
8
  Bundler.require(:default)
9
9
  Bundler.require(:development)
10
+ require 'uri'
10
11
 
11
12
  # require the files
12
13
  require 'zillow4r'
@@ -18,8 +19,21 @@ FIXTURE_PATH = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures'))
18
19
 
19
20
  class ZillowTest < Test::Unit::TestCase
20
21
 
22
+ def default_test; end;
23
+
21
24
  protected
22
25
 
26
+ def assert_equal_url(url1, url2)
27
+ uri1 = URI.parse(url1)
28
+ uri2 = URI.parse(url2)
29
+ assert_equal(uri1.host, uri2.host)
30
+ assert_equal(uri1.port, uri2.port)
31
+ assert_equal(uri1.path, uri2.path)
32
+ query_params1 = uri1.query.split("&").sort
33
+ query_params2 = uri2.query.split("&").sort
34
+ assert_equal(query_params1, query_params2)
35
+ end
36
+
23
37
  def mock_http_response(filename)
24
38
  OpenURI.stubs(:open_uri).returns(File.open(FIXTURE_PATH + "/#{filename}"))
25
39
  end
@@ -4,7 +4,7 @@ class ChartTest < ZillowTest
4
4
 
5
5
  def test_webservice_url
6
6
  path = Zillow4r.build_path(Zillow4r::Api::Chart, "unit-type" => "percent", "zpid" => 48749425, "width" => 300, "height" => 150)
7
- assert_equal("/webservice/GetChart.htm?zws-id=TEST_ZWS_ID&unit-type=percent&zpid=48749425&width=300&height=150", path)
7
+ assert_equal_url("/webservice/GetChart.htm?zws-id=TEST_ZWS_ID&unit-type=percent&zpid=48749425&width=300&height=150", path)
8
8
  end
9
9
 
10
10
  def test_parsing
@@ -4,7 +4,7 @@ class CompsTest < ZillowTest
4
4
 
5
5
  def test_webservice_url
6
6
  path = Zillow4r.build_path(Zillow4r::Api::Comps, :zpid => 48749425, :count => 5)
7
- assert_equal("/webservice/GetComps.htm?zws-id=TEST_ZWS_ID&zpid=48749425&count=5", path)
7
+ assert_equal_url("/webservice/GetComps.htm?zws-id=TEST_ZWS_ID&zpid=48749425&count=5", path)
8
8
  end
9
9
 
10
10
  def test_parsing
@@ -4,7 +4,7 @@ class DeepCompsTest < ZillowTest
4
4
 
5
5
  def test_webservice_url
6
6
  path = Zillow4r.build_path(Zillow4r::Api::DeepComps, :zpid => 48749425, :count => 5)
7
- assert_equal("/webservice/GetDeepComps.htm?zws-id=TEST_ZWS_ID&zpid=48749425&count=5", path)
7
+ assert_equal_url("/webservice/GetDeepComps.htm?zws-id=TEST_ZWS_ID&zpid=48749425&count=5", path)
8
8
  end
9
9
 
10
10
  def test_parsing
@@ -4,7 +4,7 @@ class DeepSearchResultsTest < ZillowTest
4
4
 
5
5
  def test_webservice_url
6
6
  path = Zillow4r.build_path(Zillow4r::Api::DeepSearchResults, :address => "2114 Bigelow Ave", :citystatezip => "Seattle, WA")
7
- assert_equal("/webservice/GetDeepSearchResults.htm?zws-id=TEST_ZWS_ID&address=2114+Bigelow+Ave&citystatezip=Seattle%2C+WA", path)
7
+ assert_equal_url("/webservice/GetDeepSearchResults.htm?zws-id=TEST_ZWS_ID&address=2114+Bigelow+Ave&citystatezip=Seattle%2C+WA", path)
8
8
  end
9
9
 
10
10
  def test_parsing
@@ -4,7 +4,7 @@ class DemographicsTest < ZillowTest
4
4
 
5
5
  def test_webservice_url
6
6
  path = Zillow4r.build_path(Zillow4r::Api::Demographics, :city => "Seattle", :state => "WA")
7
- assert_equal("/webservice/GetDemographics.htm?zws-id=TEST_ZWS_ID&city=Seattle&state=WA", path)
7
+ assert_equal_url("/webservice/GetDemographics.htm?zws-id=TEST_ZWS_ID&city=Seattle&state=WA", path)
8
8
  end
9
9
 
10
10
  def test_parsing
@@ -4,7 +4,7 @@ class RegionChartTest < ZillowTest
4
4
 
5
5
  def test_webservice_url
6
6
  path = Zillow4r.build_path(Zillow4r::Api::RegionChart, "unit-type" => "percent", :city => "seattle", :state => "WA", :width => 300, :height => 150)
7
- assert_equal("/webservice/GetRegionChart.htm?zws-id=TEST_ZWS_ID&unit-type=percent&city=seattle&state=WA&width=300&height=150", path)
7
+ assert_equal_url("/webservice/GetRegionChart.htm?zws-id=TEST_ZWS_ID&unit-type=percent&city=seattle&state=WA&width=300&height=150", path)
8
8
  end
9
9
 
10
10
  def test_parsing
@@ -4,7 +4,7 @@ class RegionChildrenTest < ZillowTest
4
4
 
5
5
  def test_webservice_url
6
6
  path = Zillow4r.build_path(Zillow4r::Api::RegionChildren, :city => "seattle", :state => "WA", :childtype => "neighborhood")
7
- assert_equal("/webservice/GetRegionChildren.htm?zws-id=TEST_ZWS_ID&city=seattle&state=WA&childtype=neighborhood", path)
7
+ assert_equal_url("/webservice/GetRegionChildren.htm?zws-id=TEST_ZWS_ID&city=seattle&state=WA&childtype=neighborhood", path)
8
8
  end
9
9
 
10
10
  def test_parsing
@@ -4,7 +4,7 @@ class SearchResultsTest < ZillowTest
4
4
 
5
5
  def test_webservice_url
6
6
  path = Zillow4r.build_path(Zillow4r::Api::SearchResults, :address => "2114 Bigelow Ave", :citystatezip => "Seattle, WA")
7
- assert_equal("/webservice/GetSearchResults.htm?zws-id=TEST_ZWS_ID&address=2114+Bigelow+Ave&citystatezip=Seattle%2C+WA", path)
7
+ assert_equal_url("/webservice/GetSearchResults.htm?zws-id=TEST_ZWS_ID&address=2114+Bigelow+Ave&citystatezip=Seattle%2C+WA", path)
8
8
  end
9
9
 
10
10
  def test_parsing
@@ -4,7 +4,7 @@ class UpdatedPropertyDetailsTest < ZillowTest
4
4
 
5
5
  def test_webservice_url
6
6
  path = Zillow4r.build_path(Zillow4r::Api::UpdatedPropertyDetails, :zpid => 48749425)
7
- assert_equal("/webservice/GetUpdatedPropertyDetails.htm?zws-id=TEST_ZWS_ID&zpid=48749425", path)
7
+ assert_equal_url("/webservice/GetUpdatedPropertyDetails.htm?zws-id=TEST_ZWS_ID&zpid=48749425", path)
8
8
  end
9
9
 
10
10
  def test_parsing
@@ -4,7 +4,7 @@ class ZestimateTest < ZillowTest
4
4
 
5
5
  def test_webservice_url
6
6
  path = Zillow4r.build_path(Zillow4r::Api::Zestimate, :zpid => 48749425)
7
- assert_equal("/webservice/GetZestimate.htm?zws-id=TEST_ZWS_ID&zpid=48749425", path)
7
+ assert_equal_url("/webservice/GetZestimate.htm?zws-id=TEST_ZWS_ID&zpid=48749425", path)
8
8
  end
9
9
 
10
10
  def test_parsing
data/zillow4r.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{zillow4r}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeff Ching"]
12
- s.date = %q{2010-12-15}
12
+ s.date = %q{2010-12-16}
13
13
  s.description = %q{Simple ruby interface for the Zillow API. See http://www.zillow.com/howto/api/APIOverview.htm}
14
14
  s.email = %q{ching.jeff@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jeff Ching
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-15 00:00:00 -08:00
17
+ date: 2010-12-16 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -150,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - ">="
152
152
  - !ruby/object:Gem::Version
153
- hash: 3794204408486395298
153
+ hash: 1650785289167883117
154
154
  segments:
155
155
  - 0
156
156
  version: "0"