daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require 'spec_helper'
  2. require 'managers/basic_game_object_manager'
  3.  
  4. describe 'BasicGameObjectManager' do
  5.  
  6.   before :each do
  7.     @state = Jemini::BaseState.new(mock('Container', :null_object => true), mock('Game', :null_object => true))
  8.     @manager = BasicGameObjectManager.new(@state)
  9.     @state.send(:set_manager, :game_object, @manager)
  10.   end
  11.  
  12.   it "tracks objects added to state" do
  13.     object = @state.create :GameObject
  14.     @manager.game_objects.should include(object)
  15.   end
  16.  
  17.   describe "#remove_game_object" do
  18.  
  19.     it "calls unload on an object when removing it" do
  20.       object = @state.create :GameObject, :ReceivesEvents
  21.       object.on_remove_game_object :before
  22.       # NoMethodError in 'BasicGameObjectManager#remove_game_object calls unload on an object when removing it'
  23.       # undefined method `on_remove_game_object' for #<Jemini::GameObject:0x7c3cfaab>
  24.       object.should_recieve(:before).ordered
  25.       object.should_receive(:unload).ordered
  26.       @manager.remove_game_object(object)
  27.     end
  28.  
  29.     it "triggers before and after callbacks for removal"
  30.    
  31.     it "deletes all behaviors on an object after removing it"
  32.    
  33.     it "removes all listeners on an object after removing it"
  34.    
  35.   end
  36.    
  37. end
RAW Paste Data
Top