tic_tac_toe_mchliakh 0.1.3 → 0.1.4
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/lib/tic_tac_toe_mchliakh.rb +1 -0
- data/lib/tic_tac_toe_mchliakh/version.rb +1 -1
- data/spec/tic_tac_toe_spec.rb +13 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0180757d7d76b94a4b58bfc145f77ae2429e52c2
|
|
4
|
+
data.tar.gz: cb154e39260c4169fa6512fd6afaf75a6c8c3b0f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6fa4d611faaf58df31f2acc916d6afd2e3c40af8ba0ba0a33662501bb30c091a82dd53d21e6477c72d7920184906cb0591451b3d18d707bc3b5ed639a805dbc3
|
|
7
|
+
data.tar.gz: 75711418630a2c94d0efdfac6c2f03e52f19e95e29a046a690db803a0c56150d60deec6bc149a6c77e0e23dc458916473f5a82c51bed0775c7b86af03aff2df3
|
data/lib/tic_tac_toe_mchliakh.rb
CHANGED
data/spec/tic_tac_toe_spec.rb
CHANGED
|
@@ -7,11 +7,23 @@ module TicTacToeMchliakh
|
|
|
7
7
|
.to eq([0, 1])
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
it 'accepts string input' do
|
|
10
|
+
it 'accepts string input for the square' do
|
|
11
11
|
expect(TicTacToeMchliakh.move(' 1')[:board].compact.sort)
|
|
12
12
|
.to eq([0, 1])
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
it 'makes a move on a saved board' do
|
|
16
|
+
board = [nil, nil, nil, 1, 0, nil, nil, nil, nil]
|
|
17
|
+
expect(TicTacToeMchliakh.move(1, board)[:board].compact.sort)
|
|
18
|
+
.to eq([0, 0, 1, 1])
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it 'makes accepts string input for the saved board' do
|
|
22
|
+
board = [nil, nil, nil, '1', '0', nil, nil, nil, nil]
|
|
23
|
+
expect(TicTacToeMchliakh.move(1, board)[:board].compact.sort)
|
|
24
|
+
.to eq([0, 0, 1, 1])
|
|
25
|
+
end
|
|
26
|
+
|
|
15
27
|
it 'returns an error when desired square is taken' do
|
|
16
28
|
expect(TicTacToeMchliakh.move(1, Array.new(9, 0)))
|
|
17
29
|
.to have_key(:error)
|