Sha256: 554f20976b483c6069fab865911f3e3189b7483156fb4689f49a632b74fe8dce
Contents?: true
Size: 1.96 KB
Versions: 2
Compression:
Stored size: 1.96 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.auto_upgrade! $:.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.not_to raise_error end it 'should state its own scope' do Airship.impact_scope.should == 'Anthropogenic impacts resulting from the inflation, launching, and acceleration of dirigibles' end it 'should state its emitter name' do Airship.emitter.should == 'Airship' end it 'should have extra data_miner steps' do Airship.data_miner_script.steps[0].description.should == :auto_upgrade! Airship.data_miner_script.steps[1].description.should == "the first step defined in the emitter module" Airship.data_miner_script.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-1.0.0 | spec/emitter_spec.rb |
emitter-0.12.1 | spec/emitter_spec.rb |