Sha256: 302eb9916a4f44f9c59a5d7731c2f81ec85db0c906dfd966428edfa36f06e9c4

Contents?: true

Size: 842 Bytes

Versions: 14

Compression:

Stored size: 842 Bytes

Contents

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

require 'ym4r'
require 'test/unit'

include Ym4r::YahooMaps::BuildingBlock

class TestTraffic< Test::Unit::TestCase

  def test_apple
    results = Traffic::get(:street => "1 Infinite Loop",
                          :city => "Cupertino",
                          :state => "CA",
                          :zip => "95014",
                          :include_map => true)
    
    #since it changes according to time, difficult to test..
    assert(! results.nil?)
    assert(results.exact_match?)
    
    if(!results.empty?)
      result = results[0]
      apple_traffic_image = "apple_traffic.png"
      result.download_to(apple_traffic_image)
      assert(File.exist?(apple_traffic_image))
      File.delete(apple_traffic_image)
    end
    

  end

  
end

Version data entries

14 entries across 14 versions & 1 rubygems

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