Sha256: 9c119f6633e252856344f3e77cd073e7c336b23d791424b2f033616899598113

Contents?: true

Size: 839 Bytes

Versions: 1

Compression:

Stored size: 839 Bytes

Contents

# encoding: utf-8
require 'test_helper'

class MethodAliasesTest < Test::Unit::TestCase

  def setup
    Geocoder::Configuration.set_defaults
  end

  def test_distance_from_is_alias_for_distance_to
    v = Venue.new(*venue_params(:msg))
    v.latitude, v.longitude = [40.750354, -73.993371]
    assert_equal v.distance_from([30, -94]), v.distance_to([30, -94])
  end

  def test_fetch_coordinates_is_alias_for_geocode
    v = Venue.new(*venue_params(:msg))
    coords = [40.750354, -73.993371]
    assert_equal coords, v.fetch_coordinates
    assert_equal coords, [v.latitude, v.longitude]
  end

  def test_fetch_address_is_alias_for_reverse_geocode
    v = Landmark.new(*landmark_params(:msg))
    address = "4 Penn Plaza, New York, NY 10001, USA"
    assert_equal address, v.fetch_address
    assert_equal address, v.address
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
geocoder-1.0.2 test/method_aliases_test.rb