Sha256: ea0d0ea6d597d18cdc66ffd46787e285b1b858a2a6ec53b2d97c683c13f8e671

Contents?: true

Size: 679 Bytes

Versions: 5

Compression:

Stored size: 679 Bytes

Contents

require 'spec_helper'
require 'active_support/inflector'

class MyGeoThingy
  include GeoUnits
end

describe GeoUnits do
  describe '#key' do
    it 'should return the unit key' do
      GeoUnits.key(:foot).should == :feet
    end
  end

  describe '#radians_to' do
    it 'should convert radians to kms' do
      GeoUnits.radians_to(:kms, 2, 30).should be_within(0.5).of 111.17 * 2
    end
  end

  describe '#miles_to' do
    it 'should convert miles to kms' do
      GeoUnits.miles_to(:kms, 2).should be_within(0.2).of 3.21
    end
  end

  describe '#kms_to' do
    it 'should convert miles to kms' do
      GeoUnits.kilometers_to(:meters, 2).should == 2000
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
geo_units-0.3.4 spec/geo_units_spec.rb
geo_units-0.3.3 spec/geo_units_spec.rb
geo_units-0.3.2 spec/geo_units_spec.rb
geo_units-0.3.1.1 spec/geo_units_spec.rb
geo_units-0.3.1 spec/geo_units_spec.rb