a guest Apr 16th, 2018 53 Never
- require 'spec_helper'
- require 'managers/basic_game_object_manager'
- describe 'BasicGameObjectManager' do
- before :each do
- @state = Jemini::BaseState.new(mock('Container', :null_object => true), mock('Game', :null_object => true))
- @manager = BasicGameObjectManager.new(@state)
- @state.send(:set_manager, :game_object, @manager)
- it "tracks objects added to state" do
- object = @state.create :GameObject
- @manager.game_objects.should include(object)
- describe "#remove_game_object" do
- it "calls unload on an object when removing it" do
- object = @state.create :GameObject, :ReceivesEvents
- object.on_remove_game_object :before
- # NoMethodError in 'BasicGameObjectManager#remove_game_object calls unload on an object when removing it'
- # undefined method `on_remove_game_object' for #<Jemini::GameObject:0x7c3cfaab>
- it "triggers before and after callbacks for removal"
- it "deletes all behaviors on an object after removing it"
- it "removes all listeners on an object after removing it"
RAW Paste Data