ruby-poker 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/ruby-poker.rb CHANGED
@@ -260,7 +260,7 @@ class PokerHand
260
260
  alias :to_ary :to_a
261
261
 
262
262
  def <=> other_hand
263
- self.score <=> other_hand.score
263
+ self.score[0] <=> other_hand.score[0]
264
264
  end
265
265
 
266
266
  # Add a card to the hand
@@ -111,13 +111,20 @@ class TestPokerHand < Test::Unit::TestCase
111
111
  end
112
112
 
113
113
  def test_comparisons
114
- assert_equal(0, @trips <=> @trips)
115
114
  hand1 = PokerHand.new("5C JC 2H 5S 3D")
116
115
  hand2 = PokerHand.new("6D 7C 5D 5H 3S")
117
116
  assert_equal(1, hand1 <=> hand2)
118
117
  assert_equal(-1, hand2 <=> hand1)
119
118
  end
120
119
 
120
+ def test_equality
121
+ assert_equal(0, @trips <=> @trips)
122
+
123
+ hand1 = PokerHand.new("Ac Qc Ks Kd 9d 3c")
124
+ hand2 = PokerHand.new("Ah Qs 9h Kh Kc 3s")
125
+ assert_equal(0, hand1 <=> hand2)
126
+ end
127
+
121
128
  def test_appending
122
129
  ph = PokerHand.new()
123
130
  ph << "Qd"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-poker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Olson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-08 00:00:00 -08:00
12
+ date: 2008-04-06 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  requirements: []
56
56
 
57
57
  rubyforge_project: rubypoker
58
- rubygems_version: 1.0.1
58
+ rubygems_version: 1.1.0
59
59
  signing_key:
60
60
  specification_version: 2
61
61
  summary: Ruby library for determining the winner in a game of poker.