acpc_poker_types 0.0.10 → 1.0.0
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 +4 -4
- data/Rakefile +7 -4
- data/acpc_poker_types.gemspec +4 -2
- data/lib/acpc_poker_types.rb +13 -12
- data/lib/acpc_poker_types/acpc_dealer_data.rb +9 -0
- data/lib/acpc_poker_types/acpc_dealer_data/action_messages.rb +133 -0
- data/lib/acpc_poker_types/acpc_dealer_data/hand_data.rb +182 -0
- data/lib/acpc_poker_types/acpc_dealer_data/hand_results.rb +79 -0
- data/lib/acpc_poker_types/acpc_dealer_data/log_file.rb +5 -0
- data/lib/acpc_poker_types/acpc_dealer_data/match_definition.rb +54 -0
- data/lib/acpc_poker_types/acpc_dealer_data/poker_match_data.rb +393 -0
- data/lib/acpc_poker_types/board_cards.rb +4 -4
- data/lib/acpc_poker_types/card.rb +16 -16
- data/lib/acpc_poker_types/chip_stack.rb +1 -1
- data/lib/acpc_poker_types/game_definition.rb +34 -38
- data/lib/acpc_poker_types/hand.rb +5 -5
- data/lib/acpc_poker_types/match_state.rb +31 -32
- data/lib/acpc_poker_types/pile_of_cards.rb +1 -1
- data/lib/acpc_poker_types/player.rb +16 -15
- data/lib/acpc_poker_types/poker_action.rb +6 -6
- data/lib/acpc_poker_types/rank.rb +2 -2
- data/lib/acpc_poker_types/suit.rb +4 -4
- data/lib/acpc_poker_types/version.rb +1 -1
- data/spec/action_messages_spec.rb +450 -0
- data/spec/board_cards_spec.rb +9 -9
- data/spec/card_spec.rb +20 -20
- data/spec/chip_stack_spec.rb +28 -29
- data/spec/game_definition_spec.rb +11 -11
- data/spec/hand_data_spec.rb +295 -0
- data/spec/hand_results_spec.rb +292 -0
- data/spec/hand_spec.rb +11 -11
- data/spec/match_definition_spec.rb +95 -0
- data/spec/match_state_spec.rb +105 -287
- data/spec/pile_of_cards_spec.rb +14 -14
- data/spec/player_spec.rb +61 -61
- data/spec/poker_action_spec.rb +49 -49
- data/spec/poker_match_data_spec.rb +388 -0
- data/spec/rank_spec.rb +19 -19
- data/spec/suit_spec.rb +19 -19
- data/spec/support/spec_helper.rb +28 -6
- metadata +55 -10
data/spec/suit_spec.rb
CHANGED
@@ -2,46 +2,46 @@
|
|
2
2
|
# Spec helper (must include first to track code coverage with SimpleCov)
|
3
3
|
require File.expand_path('../support/spec_helper', __FILE__)
|
4
4
|
|
5
|
-
require
|
5
|
+
require 'acpc_poker_types/suit'
|
6
6
|
|
7
|
-
describe Suit do
|
7
|
+
describe AcpcPokerTypes::Suit do
|
8
8
|
describe '#new' do
|
9
9
|
it 'raises an exception if the given suit is invalid' do
|
10
|
-
|
10
|
+
-> {AcpcPokerTypes::Suit.new(:not_a_suit)}.must_raise(AcpcPokerTypes::Suit::UnrecognizedSuit)
|
11
11
|
end
|
12
12
|
describe 'correctly understands all suits' do
|
13
13
|
it 'in symbol form' do
|
14
14
|
for_every_suit do
|
15
|
-
@patient = Suit.new(@symbol)
|
16
|
-
|
15
|
+
@patient = AcpcPokerTypes::Suit.new(@symbol)
|
16
|
+
|
17
17
|
check_patient!
|
18
18
|
end
|
19
19
|
end
|
20
20
|
it 'in ACPC form' do
|
21
21
|
for_every_suit do
|
22
|
-
@patient = Suit.new(@acpc)
|
23
|
-
|
22
|
+
@patient = AcpcPokerTypes::Suit.new(@acpc)
|
23
|
+
|
24
24
|
check_patient!
|
25
25
|
end
|
26
26
|
end
|
27
27
|
it 'in numeric ACPC form' do
|
28
28
|
for_every_suit do
|
29
|
-
@patient = Suit.new(@number)
|
30
|
-
|
29
|
+
@patient = AcpcPokerTypes::Suit.new(@number)
|
30
|
+
|
31
31
|
check_patient!
|
32
32
|
end
|
33
33
|
end
|
34
34
|
it 'in HTML form' do
|
35
35
|
for_every_suit do
|
36
|
-
@patient = Suit.new(@html)
|
37
|
-
|
36
|
+
@patient = AcpcPokerTypes::Suit.new(@html)
|
37
|
+
|
38
38
|
check_patient!
|
39
39
|
end
|
40
40
|
end
|
41
41
|
it 'in string form' do
|
42
42
|
for_every_suit do
|
43
|
-
@patient = Suit.new(@string)
|
44
|
-
|
43
|
+
@patient = AcpcPokerTypes::Suit.new(@string)
|
44
|
+
|
45
45
|
check_patient!
|
46
46
|
end
|
47
47
|
end
|
@@ -49,7 +49,7 @@ describe Suit do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def for_every_suit
|
52
|
-
Suit::DOMAIN.each do |suit, properties|
|
52
|
+
AcpcPokerTypes::Suit::DOMAIN.each do |suit, properties|
|
53
53
|
@symbol = suit
|
54
54
|
@number = properties[:number]
|
55
55
|
@string = properties[:acpc_character]
|
@@ -61,10 +61,10 @@ describe Suit do
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def check_patient!
|
64
|
-
@patient.to_sym.
|
65
|
-
@patient.to_i.
|
66
|
-
@patient.to_acpc.
|
67
|
-
@patient.to_s.
|
68
|
-
@patient.to_html.
|
64
|
+
@patient.to_sym.must_equal @symbol
|
65
|
+
@patient.to_i.must_equal @number
|
66
|
+
@patient.to_acpc.must_equal @acpc
|
67
|
+
@patient.to_s.must_equal @string
|
68
|
+
@patient.to_html.must_equal @html
|
69
69
|
end
|
70
70
|
end
|
data/spec/support/spec_helper.rb
CHANGED
@@ -2,11 +2,33 @@
|
|
2
2
|
require 'simplecov'
|
3
3
|
SimpleCov.start
|
4
4
|
|
5
|
-
require '
|
5
|
+
require 'minitest/spec'
|
6
|
+
require 'minitest/pride'
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
config.mock_with :mocha
|
10
|
-
end
|
8
|
+
begin
|
9
|
+
require 'turn'
|
11
10
|
|
12
|
-
|
11
|
+
Turn.config do |c|
|
12
|
+
# use one of output formats:
|
13
|
+
# :outline - turn's original case/test outline mode [default]
|
14
|
+
# :progress - indicates progress with progress bar
|
15
|
+
# :dotted - test/unit's traditional dot-progress mode
|
16
|
+
# :pretty - new pretty reporter
|
17
|
+
# :marshal - dump output as YAML (normal run mode only)
|
18
|
+
# :cue - interactive testing
|
19
|
+
c.format = :dotted
|
20
|
+
# use humanized test names (works only with :outline format)
|
21
|
+
c.natural = true
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'awesome_print'
|
25
|
+
module Minitest::Assertions
|
26
|
+
def mu_pp(obj)
|
27
|
+
obj.awesome_inspect
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
require 'pry-rescue/minitest'
|
32
|
+
require 'mocha/setup'
|
33
|
+
rescue LoadError
|
34
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acpc_poker_types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dustin Morrill
|
@@ -39,35 +39,63 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: celluloid
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0.13'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0.13'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: awesome_print
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: turn
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
98
|
+
name: pry-rescue
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
72
100
|
requirements:
|
73
101
|
- - '>='
|
@@ -120,11 +148,18 @@ files:
|
|
120
148
|
- lib/acpc_poker_types/player.rb
|
121
149
|
- lib/acpc_poker_types/pile_of_cards.rb
|
122
150
|
- lib/acpc_poker_types/board_cards.rb
|
151
|
+
- lib/acpc_poker_types/acpc_dealer_data/match_definition.rb
|
152
|
+
- lib/acpc_poker_types/acpc_dealer_data/log_file.rb
|
153
|
+
- lib/acpc_poker_types/acpc_dealer_data/hand_results.rb
|
154
|
+
- lib/acpc_poker_types/acpc_dealer_data/action_messages.rb
|
155
|
+
- lib/acpc_poker_types/acpc_dealer_data/poker_match_data.rb
|
156
|
+
- lib/acpc_poker_types/acpc_dealer_data/hand_data.rb
|
123
157
|
- lib/acpc_poker_types/suit.rb
|
124
158
|
- lib/acpc_poker_types/game_definition.rb
|
125
159
|
- lib/acpc_poker_types/chip_stack.rb
|
126
160
|
- lib/acpc_poker_types/poker_action.rb
|
127
161
|
- lib/acpc_poker_types/hand.rb
|
162
|
+
- lib/acpc_poker_types/acpc_dealer_data.rb
|
128
163
|
- lib/acpc_poker_types/match_state.rb
|
129
164
|
- lib/acpc_poker_types/rank.rb
|
130
165
|
- lib/acpc_poker_types/version.rb
|
@@ -133,6 +168,8 @@ files:
|
|
133
168
|
- acpc_poker_types.gemspec
|
134
169
|
- README.md
|
135
170
|
- spec/player_spec.rb
|
171
|
+
- spec/match_definition_spec.rb
|
172
|
+
- spec/hand_data_spec.rb
|
136
173
|
- spec/poker_action_spec.rb
|
137
174
|
- spec/chip_stack_spec.rb
|
138
175
|
- spec/support/spec_helper.rb
|
@@ -144,7 +181,10 @@ files:
|
|
144
181
|
- spec/support/dealer_logs/3p.nolimit.h1000.r0.actions.log
|
145
182
|
- spec/support/dealer_logs/3p.limit.h1000.r0.log
|
146
183
|
- spec/support/dealer_logs/2p.limit.h1000.r0.log
|
184
|
+
- spec/action_messages_spec.rb
|
185
|
+
- spec/hand_results_spec.rb
|
147
186
|
- spec/suit_spec.rb
|
187
|
+
- spec/poker_match_data_spec.rb
|
148
188
|
- spec/rank_spec.rb
|
149
189
|
- spec/pile_of_cards_spec.rb
|
150
190
|
- spec/hand_spec.rb
|
@@ -177,6 +217,8 @@ specification_version: 4
|
|
177
217
|
summary: ACPC Poker Types
|
178
218
|
test_files:
|
179
219
|
- spec/player_spec.rb
|
220
|
+
- spec/match_definition_spec.rb
|
221
|
+
- spec/hand_data_spec.rb
|
180
222
|
- spec/poker_action_spec.rb
|
181
223
|
- spec/chip_stack_spec.rb
|
182
224
|
- spec/support/spec_helper.rb
|
@@ -188,7 +230,10 @@ test_files:
|
|
188
230
|
- spec/support/dealer_logs/3p.nolimit.h1000.r0.actions.log
|
189
231
|
- spec/support/dealer_logs/3p.limit.h1000.r0.log
|
190
232
|
- spec/support/dealer_logs/2p.limit.h1000.r0.log
|
233
|
+
- spec/action_messages_spec.rb
|
234
|
+
- spec/hand_results_spec.rb
|
191
235
|
- spec/suit_spec.rb
|
236
|
+
- spec/poker_match_data_spec.rb
|
192
237
|
- spec/rank_spec.rb
|
193
238
|
- spec/pile_of_cards_spec.rb
|
194
239
|
- spec/hand_spec.rb
|