Sha256: 2388ac2e8c5a2856a743b9ecd9c9e19d2d66500b39299b2c1ae39e5e994ea5c6
Contents?: true
Size: 1.88 KB
Versions: 2
Compression:
Stored size: 1.88 KB
Contents
require 'spec_helper' describe BrighterPlanet::Emitter do describe '.included' do before :all do require 'active_record' class Aircraft < ActiveRecord::Base; end class Airship < ActiveRecord::Base; end $:.unshift File.expand_path('fixtures/dirigible/lib', File.dirname(__FILE__)) require 'dirigible' Airship.send :include, BrighterPlanet::Dirigible Airship.force_schema! $:.unshift File.expand_path('fixtures/biplane/lib', File.dirname(__FILE__)) end it 'should include fallback if available' do Airship.new.kind_of?(BrighterPlanet::Dirigible::Fallback). should be_true end it 'should include relationships if available' do Airship.new.kind_of?(BrighterPlanet::Dirigible::Relationships). should be_true end it 'should not include fallback or relationships if there are none' do expect do require 'biplane' Aircraft.send :include, BrighterPlanet::Biplane end.should_not raise_error end it 'should state its own scope' do Airship.emission_scope.should == 'Anthropogenic emissions resulting from the inflation, launching, and acceleration of dirigibles' end it 'should have extra data_miner steps' do Airship.data_miner_config.steps[0].description.should == :force_schema! Airship.data_miner_config.steps[1].description.should == "the first step defined in the emitter module" Airship.data_miner_config.steps[2].description.should == :run_data_miner_on_parent_associations! end it 'should have units' do a = Airship.new :distance => 1500, :surface_area => 200, :payload => 1000 a.characteristics[:distance].units.to_s[0..2].should == 'met' # meters or metres a.characteristics[:payload].units.should == :kilograms a.characteristics[:surface_area].units.should == :square_metres end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
emitter-0.10.0 | spec/emitter_spec.rb |
emitter-0.5.2 | spec/emitter_spec.rb |