Sha256: 010f38b75f63f44fa9e75703fae0da03858d66ed9712ff0508e9b7abbcf9d3ca

Contents?: true

Size: 928 Bytes

Versions: 5

Compression:

Stored size: 928 Bytes

Contents

require 'spec_helper'
require 'earth/automobile/automobile_activity_year'

describe AutomobileActivityYear 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
      AAY.run_data_miner!
    end
  end
  
  describe 'verify', :sanity => true do
    it { AAY.count.should == 15 }
    it { AAY.where("hfc_emission_factor > 0").count.should == AAY.count }
    
    # spot check
    it { AAY.first.hfc_emission_factor.should be_within(1e-5).of(0.01656) }
    it { AAY.first.hfc_emission_factor_units.should == 'kilograms_co2e_per_kilometre' }
  end
  
  describe '.find_by_closest_year' do
    it { AAY.find_by_closest_year(1994).should == AAY.find(1995) }
    it { AAY.find_by_closest_year(2005).should == AAY.find(2005) }
    it { AAY.find_by_closest_year(2010).should == AAY.find(2009) }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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