Sha256: 65cd225ca647671decc76367364fbb0f8bacef7829dadadb7d24cc1208a0bdd8

Contents?: true

Size: 716 Bytes

Versions: 2

Compression:

Stored size: 716 Bytes

Contents

require 'test_helper'

module Graticule
  module Geocoder
    class LocalSearchMapsTest < Test::Unit::TestCase
      
      def setup
        @geocoder = LocalSearchMaps.new
        URI::HTTP.responses = []
        URI::HTTP.uris = []
      end
      
      def test_success
        prepare_response :success
        
        location = Location.new :latitude => 51.510036, :longitude => -0.130427
        
        assert_equal location, @geocoder.locate(:street => '48 Leicester Square',
          :locality => 'London', :country => 'UK')
      end

    private
    
      def prepare_response(id = :success)
        URI::HTTP.responses << response('local_search_maps', id, 'txt')
      end
      
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
graticule-1.0.0.pre2 test/graticule/geocoder/local_search_maps_test.rb
graticule-1.0.0.pre test/graticule/geocoder/local_search_maps_test.rb