Sha256: 535d717b644c876627987a96ae063475baba7778aff45a9941ef91301d483b7d

Contents?: true

Size: 615 Bytes

Versions: 39

Compression:

Stored size: 615 Bytes

Contents

require 'spec_helper'

describe "NumericExtensions" do
  it "can be called with .meters as well" do
    10.meters.should == 10
    10.0.meters.should == 10
  end
  
  it "converts km to meters" do
    100.0.km.should == 100_000.0
    100.km.should == 100_000.0
    
    100.0.kms.should == 100_000.0
    100.kms.should == 100_000.0
  end
  
  it "converts miles to " do
    100.mile.should == 160_934.72
    100.miles.should == 160_934.72
  end
  
  it "converts deg to radians" do
    90.to_radians.should == Math::PI / 2
  end
  
  it "converts radians to deg" do
    (Math::PI / 2).to_deg.should == 90
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
supernova-0.4.14 spec/supernova/numeric_extensions_spec.rb
supernova-0.4.13 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.13 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.12 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.11 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.10 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.9 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.8 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.6 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.5 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.4 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.3 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.2 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.1 spec/supernova/numeric_extensions_spec.rb
supernova-0.3.0 spec/supernova/numeric_extensions_spec.rb
supernova-0.2.2 spec/supernova/numeric_extensions_spec.rb
supernova-0.2.1 spec/supernova/numeric_extensions_spec.rb
supernova-0.2.0 spec/supernova/numeric_extensions_spec.rb
supernova-0.1.1 spec/supernova/numeric_extensions_spec.rb