diff options
| author | _Tradam <[email protected]> | 2022-01-03 08:26:24 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-03 08:26:24 -0500 |
| commit | a0f792d8feadf919290b8349dbc0eac143545927 (patch) | |
| tree | ee70c5357d5969caaed08446c32746e656b223e6 /spec/scene_manager_spec.rb | |
| parent | b535a6b1bd8019dbeba17f3853b338383208c9b3 (diff) | |
| download | FelECS-v4.0.0.tar.gz FelECS-v4.0.0.zip | |
See Changelog
Diffstat (limited to 'spec/scene_manager_spec.rb')
| -rw-r--r-- | spec/scene_manager_spec.rb | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/spec/scene_manager_spec.rb b/spec/scene_manager_spec.rb index f2aee01..e1984dc 100644 --- a/spec/scene_manager_spec.rb +++ b/spec/scene_manager_spec.rb @@ -1,6 +1,8 @@ -require 'felflame' +# frozen_string_literal: true -#class EntitiesTest < Minitest::Test +require_relative '../lib/felflame' + +# class EntitiesTest < Minitest::Test describe 'Scenes' do before :all do @@ -35,6 +37,9 @@ describe 'Scenes' do it 'can add Systems' do @scene.add @system2, @system3, @system1 + expect(@system1.scenes.length).to eq(1) + expect(@system2.scenes.length).to eq(1) + expect(@system3.scenes.length).to eq(1) expect(@scene.systems).to eq([@system1, @system2, @system3]) end @@ -47,18 +52,23 @@ describe 'Scenes' do it 'can clear Systems' do @scene.add @system2, @system3, @system1 @scene.clear + expect(@system1.scenes.length).to eq(0) + expect(@system2.scenes.length).to eq(0) + expect(@system3.scenes.length).to eq(0) expect(@scene.systems).to eq([]) end - it 'has the correct constant name' do - match = FelFlame::Scenes.new('Match') - expect(FelFlame::Scenes::Match.const_name).to eq('Match') - expect(match.const_name).to eq('Match') - end - it 'can execute Systems in the correct order' do @scene.add @system2, @system3, @system1 @scene.call expect(@cmp.order).to eq([1, 2, 3]) + @cmp.order = [] + @system3.priority = -1 + @scene.call + expect(@cmp.order).to eq([3, 1, 2]) + end + + it 'will return priority when setting priority' do + expect(@scene.priority = 3).to eq(3) end end |
