test/units/hand_detection_test.rb in hands-0.1.0 vs test/units/hand_detection_test.rb in hands-0.2.0

- old
+ new

@@ -7,11 +7,11 @@ hand << Hands::Card[7, :hearts] hand << Hands::Card[7, :spades] hand << Hands::Card[4, :diamonds] hand << Hands::Card[9, :hearts] hand << Hands::Card[9, :clubs] - assert_equal 'two_pair', hand.best_hand[:type] + assert_equal :two_pair, hand.best_hand[:type] end #### High Card @@ -63,11 +63,11 @@ hand << Hands::Card[7, :hearts] hand << Hands::Card[7, :spades] hand << Hands::Card[7, :diamonds] hand << Hands::Card[3, :hearts] hand << Hands::Card[9, :clubs] - assert_equal 'three_of_a_kind', hand.best_hand[:type] + assert_equal :three_of_a_kind, hand.best_hand[:type] end #### Straight @@ -76,41 +76,41 @@ hand << Hands::Card[2, :hearts] hand << Hands::Card[3, :spades] hand << Hands::Card[4, :diamonds] hand << Hands::Card[5, :hearts] hand << Hands::Card[6, :clubs] - assert_equal 'straight', hand.best_hand[:type] + assert_equal :straight, hand.best_hand[:type] end def test_straight_when_ace_is_low hand = Hands::Hand.new hand << Hands::Card['A', :hearts] hand << Hands::Card[2, :spades] hand << Hands::Card[3, :diamonds] hand << Hands::Card[4, :hearts] hand << Hands::Card[5, :clubs] - assert_equal 'straight', hand.best_hand[:type] + assert_equal :straight, hand.best_hand[:type] end def test_straight_when_ace_is_high hand = Hands::Hand.new hand << Hands::Card[10, :hearts] hand << Hands::Card['J', :spades] hand << Hands::Card['Q', :diamonds] hand << Hands::Card['K', :hearts] hand << Hands::Card['A', :clubs] - assert_equal 'straight', hand.best_hand[:type] + assert_equal :straight, hand.best_hand[:type] end def test_straights_dont_wrap_around hand = Hands::Hand.new hand << Hands::Card['J', :spades] hand << Hands::Card['Q', :diamonds] hand << Hands::Card['K', :hearts] hand << Hands::Card['A', :clubs] hand << Hands::Card[2, :hearts] - assert_equal 'high_card', hand.best_hand[:type] + assert_equal :high_card, hand.best_hand[:type] end #### Flush @@ -119,11 +119,11 @@ hand << Hands::Card[6, :hearts] hand << Hands::Card[7, :hearts] hand << Hands::Card[8, :hearts] hand << Hands::Card[2, :hearts] hand << Hands::Card[4, :hearts] - assert_equal 'flush', hand.best_hand[:type] + assert_equal :flush, hand.best_hand[:type] end #### Full House @@ -132,11 +132,11 @@ hand << Hands::Card[7, :hearts] hand << Hands::Card[7, :spades] hand << Hands::Card[7, :diamonds] hand << Hands::Card[9, :spades] hand << Hands::Card[9, :clubs] - assert_equal 'full_house', hand.best_hand[:type] + assert_equal :full_house, hand.best_hand[:type] end #### Four of a Kind @@ -145,11 +145,11 @@ hand << Hands::Card[7, :hearts] hand << Hands::Card[7, :spades] hand << Hands::Card[7, :diamonds] hand << Hands::Card[7, :clubs] hand << Hands::Card[9, :clubs] - assert_equal 'four_of_a_kind', hand.best_hand[:type] + assert_equal :four_of_a_kind, hand.best_hand[:type] end #### Straight Flush @@ -158,8 +158,8 @@ hand << Hands::Card[2, :hearts] hand << Hands::Card[3, :hearts] hand << Hands::Card[4, :hearts] hand << Hands::Card[5, :hearts] hand << Hands::Card[6, :hearts] - assert_equal 'straight_flush', hand.best_hand[:type] + assert_equal :straight_flush, hand.best_hand[:type] end end