acpc_poker_types 7.8.5 → 7.8.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7084a475af9591c14e3acbb9c4e6175f5c7bdeb9
4
- data.tar.gz: 8278322d9a1df82e20e61c2594f8d89f63afbf6d
3
+ metadata.gz: adf52cb90bef01a1dcbd805525dc0c2d8202a5c2
4
+ data.tar.gz: 71f5d03ae1cbba90710bc6cc7048db272652f9e2
5
5
  SHA512:
6
- metadata.gz: 1afae92e4aaef2ebca49f077fa51eadda232272d363458683242d21d5929263b2e3eb8c8dfddd0d735d175e75febee5fc18b20a0131193e73033a1c11ef652f4
7
- data.tar.gz: ace19dcb18b1fe1dccb30c217ade1b9104f93e79171e06299733993c9563c4ca3224e1a95d9648cf8af707ac5b0b277f9d8d824219e7d3e06671648202a11f56
6
+ metadata.gz: 0deb35c38b6f913c344ede565a40363ae565a42376bce19d259e952740c60201f368990aa7323a59966ee206d905a3dc7524934115fdf0380e924f8bf5951943
7
+ data.tar.gz: b71fdbd0981c9202ec48f241c6faed391c39955206869237769ec4918c6fa5d289eb81cf5d1f652a4cb4b36d12501a96a79f6de14feccb51507c893437763a40
@@ -10,7 +10,7 @@ module AcpcPokerTypes
10
10
 
11
11
  # Class to model a player during a hand from information in a +MatchState+
12
12
  class HandPlayer
13
- exceptions :unable_to_pay_ante, :inactive
13
+ exceptions :inactive
14
14
 
15
15
  # @return [AcpcPokerTypes::ChipStack] This player's chip stack at the beginning of the
16
16
  # hand before paying their ante.
@@ -33,11 +33,9 @@ class HandPlayer
33
33
  # @param initial_chip_stack [#to_i]
34
34
  # @param ante [#to_i]
35
35
  def initialize(hand, initial_stack, ante)
36
- raise UnableToPayAnte if ante > initial_stack
37
-
38
36
  @hand = hand
39
37
  @initial_stack = ChipStack.new initial_stack
40
- @ante = ChipStack.new ante
38
+ @ante = ChipStack.new [ante, initial_stack].min
41
39
  @actions = [[]]
42
40
  @winnings = ChipStack.new 0
43
41
  end
@@ -162,4 +160,4 @@ class HandPlayer
162
160
  betting_type != GameDefinition::BETTING_TYPES[:limit] && min_wager_by_cost < stack
163
161
  end
164
162
  end
165
- end
163
+ end
@@ -1,3 +1,3 @@
1
1
  module AcpcPokerTypes
2
- VERSION = '7.8.5'
2
+ VERSION = '7.8.6'
3
3
  end
@@ -26,8 +26,9 @@ describe HandPlayer do
26
26
  end
27
27
 
28
28
  describe '::new' do
29
- it 'raises an exception if the player is unable to pay the ante' do
30
- -> { HandPlayer.new HAND, INITIAL_CHIP_STACK, INITIAL_CHIP_STACK + 1 }.must_raise HandPlayer::UnableToPayAnte
29
+ it 'works properly if the player is unable to pay the ante' do
30
+ patient = HandPlayer.new HAND, INITIAL_CHIP_STACK, INITIAL_CHIP_STACK + 1
31
+ patient.ante.must_equal INITIAL_CHIP_STACK
31
32
  end
32
33
  it 'works' do
33
34
  [0, 100].each do |ante|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acpc_poker_types
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.8.5
4
+ version: 7.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dustin Morrill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-31 00:00:00.000000000 Z
11
+ date: 2017-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: process_runner