-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51627f0
commit a05bc25
Showing
4 changed files
with
52 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ source "https://rubygems.org" | |
gem 'rspec' | ||
gem 'cucumber' | ||
gem 'gherkin' | ||
gem 'pry' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
odule Tateti | ||
class Jugador | ||
attr_accessor :name | ||
def initialize(name) | ||
@name = name | ||
end | ||
end | ||
|
||
|
||
class Tablero | ||
def initialize(jugador_1,jugador_2) | ||
@jugador_1,@jugador_2 = jugador_1, jugador_2 | ||
end | ||
|
||
def empty? | ||
true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,43 @@ | ||
require_relative '../katas/tateti' | ||
require 'rspec' | ||
require 'pry' | ||
|
||
|
||
describe Tateti do | ||
|
||
before do | ||
jugador_a = Jugador.new('foo_name') | ||
jugador_b = Jugador.new('bar_name') | ||
@tablero = Tablero.new(jugador_a,jugador_b)#,Tablero.new()) | ||
jugador_a = Tateti::Jugador.new('foo_name') | ||
jugador_b = Tateti::Jugador.new('bar_name') | ||
@tablero = Tateti::Tablero.new(jugador_a,jugador_b) | ||
end | ||
|
||
describe Jugador do | ||
end | ||
it { true } | ||
|
||
|
||
|
||
describe Tablero do | ||
before do | ||
describe Tateti::Tablero do | ||
#before do | ||
# a b c | ||
# 1 x o x | ||
# 2 x o o | ||
# 3 o x x | ||
end | ||
#end | ||
|
||
describe 'tablero' do | ||
it { tablero.empty?.should_be true } | ||
@tablero.put(:a1,jugador_a) | ||
it { tablero.empty?.should_be false} | ||
pending | ||
it { @tablero.empty?.should_be true } | ||
#@tablero.put(:a1,jugador_a) | ||
#it { tablero.empty?.should_be false} | ||
end | ||
|
||
describe 'tablero ganado por x' do | ||
mock_tablero = Tablero.new | ||
#tablero.put(a1: 'x', a2: 'x', a3: 'x') | ||
it { mock_tablero.estado.should_be 'finalizado' } | ||
it { mock_tablero.get(:a1).should_be 'x' } | ||
it { mock_tablero.winner.should_be 'x' } | ||
end | ||
|
||
|
||
#describe 'tablero ganado por x' do | ||
# mock_tablero = Tateti::Tablero.new | ||
# #tablero.put(a1: 'x', a2: 'x', a3: 'x') | ||
# it { mock_tablero.estado.should_be 'finalizado' } | ||
# it { mock_tablero.get(:a1).should_be 'x' } | ||
# it { mock_tablero.winner.should_be 'x' } | ||
#end | ||
end | ||
end |