Permalink
Browse files

Implement cards for highest hand

  • Loading branch information...
camillebaldock committed Sep 8, 2014
1 parent 7124f2e commit c90f4466c120e88f217bee23bde3e930039f9705
Showing with 8 additions and 1 deletion.
  1. +5 −1 lib/hand.rb
  2. +3 −0 spec/hand_spec.rb
View
@@ -48,7 +48,11 @@ def rank
elsif has_two
has_two
else
{ :type => :highest }
#TODO: possible duplication happening on pips_per_occurence[1].sort.reverse
{
:type => :highest,
:cards => pips_per_occurence[1].sort.reverse
}
end
end
View
@@ -50,6 +50,9 @@
it "ranks the hand correctly" do
expect(hand.rank.fetch(:type)).to eq :highest
end
it "returns the other cards correctly" do
expect(hand.rank.fetch(:cards)).to eq [9,7,6,5,4]
end
end
context "three of a kind" do

0 comments on commit c90f446

Please sign in to comment.