Permalink
Browse files

updated how TestingStage works

  • Loading branch information...
1 parent b80b574 commit d927b7154fe88aad1e088ffda0e77878f942722b @shawn42 committed Aug 31, 2012
Showing with 9 additions and 6 deletions.
  1. +9 −6 lib/gamebox/spec/helper.rb
View
@@ -137,18 +137,17 @@ def rotate(*args)
end
- class ::TestingStage < Stage
+ module ::TestStageHelpers
attr_accessor :actors
-
- def initialize
- @actors = []
+ def actors
+ @actors ||= []
end
def create_actor(actor_type, *args)
super.tap do |act|
- @actors << act
+ actors << act
act.when :remove_me do
- @actors.delete act
+ actors.delete act
end
end
end
@@ -159,6 +158,10 @@ def update(time)
end
end
+ class ::TestingStage < Stage
+ include TestStageHelpers
+ end
+
module MockCalls
attr_accessor :calls
def method_missing(*args)

0 comments on commit d927b71

Please sign in to comment.