Sha256: 602ec3f72165b085f0a2846772ac73aa8b1ffe7c18d80ce3b03e316330f3cbb7

Contents?: true

Size: 1.04 KB

Versions: 14

Compression:

Stored size: 1.04 KB

Contents

$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'ym4r'
require 'test/unit'

include Ym4r::YahooMaps::BuildingBlock

class TestMapImage< Test::Unit::TestCase

  def test_apple
    result = MapImage::get(:street => "1 Infinite Loop",
                            :city => "Cupertino",
                            :state => "CA",
                            :zip => "95014",
                            :image_type => "png")
    assert(result.exact_match?)
    apple_image = "apple.png"
    result.download_to(apple_image)
    assert(File.exist?(apple_image))
    File.delete(apple_image)
  end

  def test_no_location
    assert_raise(MissingParameterException) {MapImage::get(:image_type => "gif")}
  end

  def test_bad_parameter
    assert_raise(BadRequestException) do
      MapImage::get(:street => "1 Infinite Loop",
                   :city => "Cupertino",
                   :state => "CA",
                   :zip => "95014",
                   :image_type => "jpg") #jpg is not a valid image type
    end
  end
  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ym4r-0.1.2 test/test_map_image.rb
ym4r-0.4.1 test/test_map_image.rb
ym4r-0.5.1 test/test_map_image.rb
ym4r-0.1.4 test/test_map_image.rb
ym4r-0.2.1 test/test_map_image.rb
ym4r-0.2.2 test/test_map_image.rb
ym4r-0.3.1 test/test_map_image.rb
ym4r-0.3.2 test/test_map_image.rb
ym4r-0.1.3 test/test_map_image.rb
ym4r-0.6.1 test/test_map_image.rb
ym4r-0.5.4 test/test_map_image.rb
ym4r-0.6.0 test/test_map_image.rb
ym4r-0.5.2 test/test_map_image.rb
ym4r-0.5.3 test/test_map_image.rb