Sha256: 6d493658a9775bb1ba63536825ffb054bbc01e9ceae068ad0e0ea59d7901cae8

Contents?: true

Size: 776 Bytes

Versions: 5

Compression:

Stored size: 776 Bytes

Contents

require 'spec_helper'
require 'earth/automobile/automobile_type_fuel_control'

describe AutomobileTypeFuelControl do
  before :all do
    Earth.init :automobile, :load_data_miner => true
    require 'earth/acronyms'
  end
  
  describe 'import', :data_miner => true do
    it 'should import data' do
      ATFC.run_data_miner!
    end
  end
  
  describe 'verify imported data', :sanity => true do
    it { ATFC.count.should == 20 }
    it { ATFC.where("ch4_emission_factor > 0").count.should == ATFC.count }
    it { ATFC.where("n2o_emission_factor > 0").count.should == ATFC.count }
    
    # spot checks
    it { ATFC.first.ch4_emission_factor.should be_within(1e-9).of(1.5534e-5) }
    it { ATFC.first.n2o_emission_factor.should be_within(1e-8).of(2.7775e-4) }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
earth-0.12.4 spec/earth/automobile/automobile_type_fuel_control_spec.rb
earth-0.12.3 spec/earth/automobile/automobile_type_fuel_control_spec.rb
earth-0.12.2 spec/earth/automobile/automobile_type_fuel_control_spec.rb
earth-0.12.1 spec/earth/automobile/automobile_type_fuel_control_spec.rb
earth-0.12.0 spec/earth/automobile/automobile_type_fuel_control_spec.rb