-
Notifications
You must be signed in to change notification settings - Fork 827
Expand file tree
/
Copy pathexplode_spec.rb
More file actions
32 lines (29 loc) · 831 Bytes
/
explode_spec.rb
File metadata and controls
32 lines (29 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'spec_helper'
describe RubyWarrior::Abilities::Explode do
before(:each) do
@floor = RubyWarrior::Floor.new
@floor.width = 2
@floor.height = 3
@captive = RubyWarrior::Units::Captive.new
@floor.add(@captive, 0, 0)
@explode = RubyWarrior::Abilities::Explode.new(@captive)
end
it "should subtract up to 100 health from each unit on the floor" do
unit = RubyWarrior::Units::Base.new
unit.health = 20
@floor.add(unit, 0, 1)
@captive.health = 10
@explode.perform
@captive.health.should == 0
unit.health.should == 0
end
it "should explode when bomb time reaches zero" do
@captive.health = 10
@explode.time = 3
@explode.pass_turn
@explode.pass_turn
@captive.health.should == 10
@explode.pass_turn
@captive.health.should == 0
end
end