Commit 786a5fa 1 parent 88911c9 commit 786a5fa Copy full SHA for 786a5fa
File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,12 @@ def warrior?
12
12
unit . kind_of? Units ::Warrior
13
13
end
14
14
15
+ def golem?
16
+ unit . kind_of? Units ::Golem
17
+ end
18
+
15
19
def enemy?
16
- unit && !warrior? && !captive?
20
+ unit && !warrior? && !captive? && ! golem?
17
21
end
18
22
19
23
def captive?
Original file line number Diff line number Diff line change 149
149
end
150
150
end
151
151
152
+ describe "with golem" do
153
+ before ( :each ) do
154
+ @golem = RubyWarrior ::Units ::Golem . new
155
+ @floor . add ( @golem , 0 , 0 )
156
+ @space = @floor . space ( 0 , 0 )
157
+ end
158
+
159
+ it "should be golem" do
160
+ @space . should be_golem
161
+ end
162
+
163
+ it "should not be enemy" do
164
+ @space . should_not be_enemy
165
+ end
166
+ end
167
+
152
168
describe "at stairs" do
153
169
before ( :each ) do
154
170
@floor . place_stairs ( 0 , 0 )
You can’t perform that action at this time.
0 commit comments