Sha256: 8c9d2b9f9ea46c5a29bb8df66855c07fe24ece7f8f079b07510b0970a91e92a4

Contents?: true

Size: 803 Bytes

Versions: 7

Compression:

Stored size: 803 Bytes

Contents

require 'spec_helper'
require "#{Earth::FACTORY_DIR}/greenhouse_gas"

describe GreenhouseGas do
  describe '.[abbreviation]' do
    it {
      GreenhouseGas.delete_all
      co2 = FactoryGirl.create :ghg, :co2
      GreenhouseGas['co2'].should == co2
    }
  end
  
  describe 'Sanity check', :sanity => true do
    let(:total) { GreenhouseGas.count }
    
    it { total.should == 4 }
    it { GreenhouseGas.where('abbreviation IS NOT NULL').count.should == total }
    it { GreenhouseGas.where('ipcc_report IS NOT NULL').count.should == total }
    it { GreenhouseGas.where(:time_horizon => 100).count.should == total }
    it { GreenhouseGas.where(:time_horizon_units => 'years').count.should == total }
    it { GreenhouseGas.where('global_warming_potential >= 1').count.should == total }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-1.2.1 spec/earth/fuel/greenhouse_gas_spec.rb
earth-1.1.2 spec/earth/fuel/greenhouse_gas_spec.rb
earth-1.1.1 spec/earth/fuel/greenhouse_gas_spec.rb
earth-1.1.0 spec/earth/fuel/greenhouse_gas_spec.rb
earth-1.0.3 spec/earth/fuel/greenhouse_gas_spec.rb
earth-1.0.2 spec/earth/fuel/greenhouse_gas_spec.rb
earth-1.0.1 spec/earth/fuel/greenhouse_gas_spec.rb