tic_tac_toes 0.0.6 → 0.0.7

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: 961f1ca9125169c762eac941829d166fb4ba42a2
4
- data.tar.gz: a067d71fefcd398e645959f8fa798b805d753e5e
3
+ metadata.gz: 46bd6a4b98b10769789684336cfc57eca3541e20
4
+ data.tar.gz: 95409188361e77e87b4eb687748dfeb34f7d2dc2
5
5
  SHA512:
6
- metadata.gz: 0e689cbb947b0bae18400a45b578f2b68b85eb18c148923ad763301a37e90483f640b80227161c95f5532535964b93fbaeaad616c017658b34d820b1c48158ac
7
- data.tar.gz: ee969a45d65f3702ed0d3ac10c496d2a380b4fd25c31c7d27a3479308f775d6795ba595b25a9fbf864fa21234324658537e627ad25f7356ff43ed0e11e984937
6
+ metadata.gz: 52ed4db96736d0fcc5ab1ce93d81acad04244aa77a7bdec19fd88021aaac87a76db638027419a5332a7aee59f2abe2f4734b5d6f5c66d2666b3f8d1f637f2a7c
7
+ data.tar.gz: 8c127e6cdec642f082c17f87f2626125343d2dafd66d0d5436fca4ceb088a8e0c198326339237387bec3589a3513945fd8ed7852dd67059ffbdb20c5df1d98cf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tic_tac_toes (0.0.6)
4
+ tic_tac_toes (0.0.7)
5
5
  pg
6
6
 
7
7
  GEM
@@ -1,3 +1,3 @@
1
1
  module TicTacToes
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/lib/ui/adapter.rb CHANGED
@@ -10,7 +10,7 @@ module UI
10
10
  board.spaces
11
11
  end
12
12
 
13
- def self.move_made(board_structure, move, listener)
13
+ def self.make_move(board_structure, move, listener)
14
14
  move = move.to_i
15
15
  game_state = game_state_from_board_structure(board_structure)
16
16
 
@@ -18,7 +18,7 @@ module UI
18
18
  game_state.board.place(human_player, move)
19
19
 
20
20
  if TicTacToes::Rules.game_over?(game_state.board, game_state.players)
21
- return listener.game_over(game_state_to_board_structure(game_state), "Game over")
21
+ return listener.game_is_over(game_state_to_board_structure(game_state), "Game over")
22
22
  end
23
23
 
24
24
  game_state.turn_over(move)
@@ -27,10 +27,10 @@ module UI
27
27
  computer_player.place_and_return_move(game_state.board, game_state.players)
28
28
 
29
29
  if TicTacToes::Rules.game_over?(game_state.board, game_state.players)
30
- return listener.game_over(game_state_to_board_structure(game_state), "Game over")
30
+ return listener.game_is_over(game_state_to_board_structure(game_state), "Game over")
31
31
  end
32
32
 
33
- listener.valid(game_state_to_board_structure(game_state))
33
+ listener.move_was_valid(game_state_to_board_structure(game_state))
34
34
  end
35
35
 
36
36
  def self.game_state_from_board_structure(board_structure)
@@ -11,7 +11,7 @@ describe UI::Adapter do
11
11
  end
12
12
  end
13
13
 
14
- describe '#move_made' do
14
+ describe '#make_move' do
15
15
  context 'when the game is still in progress' do
16
16
  it 'sends its listener a `valid` message with an updated board structure' do
17
17
  board_structure = ["X", nil, nil, nil, "O", nil, nil, nil, nil]
@@ -20,8 +20,8 @@ describe UI::Adapter do
20
20
 
21
21
  updated_board_structure = ["X", "O", "X", nil, "O", nil, nil, nil, nil]
22
22
 
23
- expect(listener).to receive(:valid).with(updated_board_structure)
24
- UI::Adapter.move_made(board_structure, move, listener)
23
+ expect(listener).to receive(:move_was_valid).with(updated_board_structure)
24
+ UI::Adapter.make_move(board_structure, move, listener)
25
25
  end
26
26
  end
27
27
 
@@ -34,8 +34,8 @@ describe UI::Adapter do
34
34
  updated_board_structure = ["X", "X", "X", nil, nil, nil, nil, nil, nil]
35
35
  game_over_message = "Game over"
36
36
 
37
- expect(listener).to receive(:game_over).with(updated_board_structure, game_over_message)
38
- UI::Adapter.move_made(board_structure, move, listener)
37
+ expect(listener).to receive(:game_is_over).with(updated_board_structure, game_over_message)
38
+ UI::Adapter.make_move(board_structure, move, listener)
39
39
  end
40
40
  end
41
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tic_tac_toes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Spatafora
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-22 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler