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.7.6 spec/supernova/numeric_extensions_spec.rb
supernova-0.7.5 spec/supernova/numeric_extensions_spec.rb
supernova-0.7.4 spec/supernova/numeric_extensions_spec.rb
supernova-0.7.3 spec/supernova/numeric_extensions_spec.rb
supernova-0.7.2 spec/supernova/numeric_extensions_spec.rb
supernova-0.7.1 spec/supernova/numeric_extensions_spec.rb
supernova-0.7.0 spec/supernova/numeric_extensions_spec.rb
supernova-0.6.8 spec/supernova/numeric_extensions_spec.rb
supernova-0.6.7 spec/supernova/numeric_extensions_spec.rb
supernova-0.6.6 spec/supernova/numeric_extensions_spec.rb
supernova-0.6.5 spec/supernova/numeric_extensions_spec.rb
supernova-0.6.4 spec/supernova/numeric_extensions_spec.rb
supernova-0.6.3 spec/supernova/numeric_extensions_spec.rb
supernova-0.6.2 spec/supernova/numeric_extensions_spec.rb
supernova-0.6.1 spec/supernova/numeric_extensions_spec.rb
supernova-0.6.0 spec/supernova/numeric_extensions_spec.rb
supernova-0.4.18 spec/supernova/numeric_extensions_spec.rb
supernova-0.4.17 spec/supernova/numeric_extensions_spec.rb
supernova-0.4.16 spec/supernova/numeric_extensions_spec.rb
supernova-0.4.15 spec/supernova/numeric_extensions_spec.rb