diff options
| author | _Tradam <[email protected]> | 2021-12-30 07:33:12 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-12-30 07:33:12 -0500 |
| commit | 5ef652300e71b572ca58b061610d606840ce19a9 (patch) | |
| tree | b82c99051b378c18ad4a8af98292681869dfa5a7 /spec/system_manager_spec.rb | |
| parent | ac8888f6682c68d74bfb362789fb43044e1c0961 (diff) | |
| download | FelECS-5ef652300e71b572ca58b061610d606840ce19a9.tar.gz FelECS-5ef652300e71b572ca58b061610d606840ce19a9.zip | |
Major 4.0 update (#12)
Check the changelog
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 |
