acpc_poker_types 7.2.3 → 7.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/acpc_poker_types/match_state.rb +3 -5
- data/lib/acpc_poker_types/version.rb +1 -1
- data/spec/match_state_spec.rb +9 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29d52abf33b84eca7383eae28cb21589864f6047
|
4
|
+
data.tar.gz: b25c8d6b77c61bb65a82fc5efe5b22de9fabb8a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89baac270d2453a97e52ffe7d62a9a0277a58eb13150017327544b9e5e7c340dcb417d59ebeb5504bf1f386c158e68950be1797e2d416ebb3d43b4b8541c769a
|
7
|
+
data.tar.gz: 039f04569ffa7f0f1b99fa62633194b83a78511f4f9a05e516b8eb9b58cd743107cfcfc03519f423ef49105368bbbbb0e97c6d3451ce086ccd1cd1278fed6e50
|
@@ -230,12 +230,10 @@ class MatchState < DelegateClass(String)
|
|
230
230
|
|
231
231
|
# @return [PokerAction] The last action taken.
|
232
232
|
def last_action
|
233
|
-
@last_action ||= if
|
234
|
-
/([^#{BETTING_SEQUENCE_SEPARATOR}])#{BETTING_SEQUENCE_SEPARATOR}*$/
|
235
|
-
)
|
236
|
-
PokerAction.new($1)
|
237
|
-
else
|
233
|
+
@last_action ||= if betting_sequence.flatten.empty?
|
238
234
|
nil
|
235
|
+
else
|
236
|
+
betting_sequence[round_in_which_last_action_taken].last
|
239
237
|
end
|
240
238
|
end
|
241
239
|
|
data/spec/match_state_spec.rb
CHANGED
@@ -29,13 +29,18 @@ include AcpcPokerTypes
|
|
29
29
|
|
30
30
|
describe MatchState do
|
31
31
|
describe '#parse' do
|
32
|
-
it "parses every possible
|
33
|
-
partial_match_state = MatchState::LABEL
|
32
|
+
it "parses every possible action" do
|
33
|
+
partial_match_state = "#{MatchState::LABEL}:1:1:"
|
34
34
|
hole_cards = arbitrary_hole_card_hand
|
35
35
|
PokerAction::CANONICAL_ACTIONS.each do |action|
|
36
|
-
|
36
|
+
action_string = if PokerAction::MODIFIABLE_ACTIONS.include?(action)
|
37
|
+
"#{action}123"
|
38
|
+
else
|
39
|
+
action
|
40
|
+
end
|
41
|
+
match_state = "#{partial_match_state}#{action_string}/:#{hole_cards.to_acpc}"
|
37
42
|
patient = test_match_state_success match_state
|
38
|
-
patient.last_action.to_s.must_equal
|
43
|
+
patient.last_action.to_s.must_equal action_string
|
39
44
|
end
|
40
45
|
end
|
41
46
|
it "parses every possible hole card hand" do
|
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.2.
|
4
|
+
version: 7.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Morrill
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
11
|
+
date: 2013-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: process_runner
|