Sha256: 30853c9a427a2b38e4510dbe1222ed55a4d7d3c48e155e312c0849e76641c000

Contents?: true

Size: 708 Bytes

Versions: 7

Compression:

Stored size: 708 Bytes

Contents

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

describe ResidenceAppliance do
  describe '.annual_energy_from_electricity_for(appliance_plural)' do
    it "should return the appliance's annual energy from electricity" do
      FactoryGirl.create :residence_appliance, :fridge
      ResidenceAppliance.annual_energy_from_electricity_for('fridges').should == 1000
      ResidenceAppliance.annual_energy_from_electricity_for('computers').should be_nil
    end
  end
  
  describe "Sanity check", :sanity => true do
    it { ResidenceAppliance.count.should == 2 }
    
    # spot check
    it { ResidenceAppliance.first.annual_energy_from_electricity.should == 1754840000 }
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-1.2.1 spec/earth/residence/residence_appliance_spec.rb
earth-1.1.2 spec/earth/residence/residence_appliance_spec.rb
earth-1.1.1 spec/earth/residence/residence_appliance_spec.rb
earth-1.1.0 spec/earth/residence/residence_appliance_spec.rb
earth-1.0.3 spec/earth/residence/residence_appliance_spec.rb
earth-1.0.2 spec/earth/residence/residence_appliance_spec.rb
earth-1.0.1 spec/earth/residence/residence_appliance_spec.rb