Sha256: 6b5bd40df5f80f8b39d378c9f12b230f4a9ae413e43c72a3dfc6ebf8220e7e91

Contents?: true

Size: 661 Bytes

Versions: 7

Compression:

Stored size: 661 Bytes

Contents

require 'spec_helper'
require 'earth/automobile/automobile_make'

describe AutomobileMake do
  describe 'Sanity check', :sanity => true do
    let(:total) { AutomobileMake.count }
    
    it { total.should == 81 }
    it { AutomobileMake.where("fuel_efficiency > 0").count.should == total }
    it { AutomobileMake.where(:fuel_efficiency_units => 'kilometres_per_litre').count.should == total }
    
    # spot checks
    it { AutomobileMake.find('Honda').fuel_efficiency.should be_within(1e-4).of(13.0594) } # fe from CAFE data
    it { AutomobileMake.find('Acura').fuel_efficiency.should be_within(1e-4).of(9.1347) }  # fe from average of variants
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-1.2.1 spec/earth/automobile/automobile_make_spec.rb
earth-1.1.2 spec/earth/automobile/automobile_make_spec.rb
earth-1.1.1 spec/earth/automobile/automobile_make_spec.rb
earth-1.1.0 spec/earth/automobile/automobile_make_spec.rb
earth-1.0.3 spec/earth/automobile/automobile_make_spec.rb
earth-1.0.2 spec/earth/automobile/automobile_make_spec.rb
earth-1.0.1 spec/earth/automobile/automobile_make_spec.rb