Sha256: 95a32bdcbac39c718b7ad6e637cdad3bd63c87d1aa672767c06fe091d4af6439

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

require 'spec_helper'

describe "Haversine" do
  it "should work" do
    lon1 = -104.88544
    lat1 = 39.06546

    lon2 = -104.80
    lat2 = lat1

    dist = Haversine.distance( lat1, lon1, lat2, lon2 )

    puts "the distance from  #{lat1}, #{lon1} to #{lat2}, #{lon2} is:"

    puts dist[:meters].number

    puts "#{dist[:miles]}"
    puts "#{dist[:km]}"
    puts "#{dist[:feet]}"
    puts "#{dist[:meters]}"

    dist[:km].to_s.should match(/7\.376*/)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
haversine-0.1.0 spec/haversine_spec.rb