Permalink
Browse files

don't consider a golem an enemy

  • Loading branch information...
1 parent 88911c9 commit 786a5fab825ffc1ff785f64f23d76637bd82f5f2 @ryanb committed Jun 6, 2010
Showing with 21 additions and 1 deletion.
  1. +5 −1 lib/ruby_warrior/space.rb
  2. +16 −0 spec/ruby_warrior/space_spec.rb
@@ -12,8 +12,12 @@ def warrior?
unit.kind_of? Units::Warrior
end
+ def golem?
+ unit.kind_of? Units::Golem
+ end
+
def enemy?
- unit && !warrior? && !captive?
+ unit && !warrior? && !captive? && !golem?
end
def captive?
@@ -149,6 +149,22 @@
end
end
+ describe "with golem" do
+ before(:each) do
+ @golem = RubyWarrior::Units::Golem.new
+ @floor.add(@golem, 0, 0)
+ @space = @floor.space(0, 0)
+ end
+
+ it "should be golem" do
+ @space.should be_golem
+ end
+
+ it "should not be enemy" do
+ @space.should_not be_enemy
+ end
+ end
+
describe "at stairs" do
before(:each) do
@floor.place_stairs(0, 0)

0 comments on commit 786a5fa

Please sign in to comment.