Sha256: ede9e927ccc23693f46ffca15095892c5dd699c6f63fea2321879774f84059b2

Contents?: true

Size: 1.26 KB

Versions: 7

Compression:

Stored size: 1.26 KB

Contents

require 'spec_helper'
require 'earth/automobile/automobile_size_class'

describe AutomobileSizeClass do
  describe 'Sanity check', :sanity => true do
    let(:total) { AutomobileSizeClass.count }
    it { total.should == 15 }
    it { AutomobileSizeClass.where("fuel_efficiency_city > 0").count.should == total }
    it { AutomobileSizeClass.where("fuel_efficiency_highway > 0").count.should == total }
    it { AutomobileSizeClass.where("hybrid_fuel_efficiency_city_multiplier > 1.0").count.should == 7 }
    it { AutomobileSizeClass.where("hybrid_fuel_efficiency_highway_multiplier > 1.0").count.should == 7 }
    it { AutomobileSizeClass.where("conventional_fuel_efficiency_city_multiplier < 1.0").count.should == 7 }
    it { AutomobileSizeClass.where("conventional_fuel_efficiency_highway_multiplier < 1.0").count.should == 7 }
    
    describe '.fallback' do
      it { AutomobileSizeClass.fallback.hybrid_fuel_efficiency_city_multiplier.should == 1.651 }
      it { AutomobileSizeClass.fallback.hybrid_fuel_efficiency_highway_multiplier.should == 1.213 }
      it { AutomobileSizeClass.fallback.conventional_fuel_efficiency_city_multiplier.should == 0.987 }
      it { AutomobileSizeClass.fallback.conventional_fuel_efficiency_highway_multiplier.should == 0.996 }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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