diff options
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 |
