spec/earth/automobile/automobile_make_spec.rb in earth-1.0.0 vs spec/earth/automobile/automobile_make_spec.rb in earth-1.0.1
- old
+ new
@@ -1,16 +1,16 @@
require 'spec_helper'
require 'earth/automobile/automobile_make'
describe AutomobileMake do
- let(:honda) { AutomobileMake.find('Honda') } # MakeYear with fe from CAFE data
- let(:acura) { AutomobileMake.find('Acura') } # MakeYear with fe from average of variants
-
- describe 'verify', :sanity => true do
- it { AutomobileMake.where("fuel_efficiency > 0").count.should == AutomobileMake.count }
- it { AutomobileMake.where(:fuel_efficiency_units => 'kilometres_per_litre').count.should == AutomobileMake.count }
+ 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 { honda.fuel_efficiency.should be_within(1e-4).of(13.0594) }
- it { acura.fuel_efficiency.should be_within(1e-4).of(9.1347) }
+ 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