Skip to content

Commit

Permalink
Write first turn test GREEN
Browse files Browse the repository at this point in the history
  • Loading branch information
MeriFW committed May 11, 2017
1 parent 98bc59c commit e41a1ae
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
25 changes: 25 additions & 0 deletions spec/player_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,31 @@
expect(player.cards_in_deck?(initial_cards_in_deck)).to be(true)
end

it 'draws cards' do
player = Player.new

player.draw

expect(player.cards_in_hand?(1)).to be(true)
end

it 'obtains mana slots' do
player = Player.new

player.obtain_mana_slot

expect(player.available_mana_slots?(1)).to be(true)
end

it 'knows remaining mana' do
player = Player.new
player.obtain_mana_slot

player.refill_mana

expect(player.remaining_mana?(1)).to be(true)
end

def initial_health
30
end
Expand Down
4 changes: 4 additions & 0 deletions system/game.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ def initialize(players)
end

def start
player = @players[0]

4.times { player.draw }
player.obtain_mana_slot
end

private
Expand Down
15 changes: 12 additions & 3 deletions system/player.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,19 @@ def receive_deck(deck)
@deck = deck
end

private

def draw(card)
def draw
card = @deck.draw
@hand.receive(card)
end

def obtain_mana_slot
@mana_slots += 1
end

def refill_mana
end

def remaining_mana?(amount)
true
end
end

0 comments on commit e41a1ae

Please sign in to comment.