diff options
| author | realtradam <[email protected]> | 2021-12-30 04:26:26 -0500 |
|---|---|---|
| committer | realtradam <[email protected]> | 2021-12-30 04:26:26 -0500 |
| commit | 38e1a046dcc0ecf5e3ec672ca466f02038b86a02 (patch) | |
| tree | 18420cfd465fa56e6da891563cd84e2ace406e0e /spec/system_manager_spec.rb | |
| parent | 8badd8f55231a5b569027501ed28d2e13bf9810e (diff) | |
| download | FelECS-38e1a046dcc0ecf5e3ec672ca466f02038b86a02.tar.gz FelECS-38e1a046dcc0ecf5e3ec672ca466f02038b86a02.zip | |
check the changelog bro
Diffstat (limited to 'spec/system_manager_spec.rb')
| -rw-r--r-- | spec/system_manager_spec.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/spec/system_manager_spec.rb b/spec/system_manager_spec.rb index f9df439..3d2e3dc 100644 --- a/spec/system_manager_spec.rb +++ b/spec/system_manager_spec.rb @@ -1,4 +1,4 @@ -require 'felflame' +require_relative '../lib/felflame.rb' describe 'Components' do @@ -73,6 +73,16 @@ describe 'Components' do expect(second.health).to eq(init2 - (multiple * 10)) end + it 'can clear triggers from components and systems' do + @cmp0 = @component_manager.new + @system.trigger_when_added @cmp0 + expect(@cmp0.addition_triggers.length).to eq(1) + expect(@system.addition_triggers.length).to eq(1) + expect(@cmp0.delete).to be true + expect(@cmp0.addition_triggers.length).to eq(0) + expect(@system.addition_triggers.length).to eq(0) + end + it 'can trigger when a single Component is added' do @cmp0 = @component_manager.new @cmp1 = @component_manager.new health: 20 @@ -326,7 +336,7 @@ describe 'Components' do expect(@cmp0.health).to eq(10) expect(@cmp1.health).to eq(20) end - + it 'can clear addition_trigger, with component' do @cmp0 = @component_manager.new health: 10 @cmp1 = @component_manager.new health: 20 @@ -369,7 +379,7 @@ describe 'Components' do expect(@cmp0.health).to eq(10) expect(@cmp1.health).to eq(20) end - + it 'can clear removal_trigger, with component' do @cmp0 = @component_manager.new health: 10 @cmp1 = @component_manager.new health: 20 |
