Skip to content

Commit

Permalink
corridos los primeros specs
Browse files Browse the repository at this point in the history
  • Loading branch information
marianogabriels committed Aug 29, 2013
1 parent 51627f0 commit a05bc25
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 18 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ source "https://rubygems.org"
gem 'rspec'
gem 'cucumber'
gem 'gherkin'
gem 'pry'
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ GEM
remote: https://rubygems.org/
specs:
builder (3.2.2)
coderay (1.0.9)
cucumber (1.3.6)
builder (>= 2.1.2)
diff-lcs (>= 1.1.3)
Expand All @@ -11,8 +12,13 @@ GEM
diff-lcs (1.2.4)
gherkin (2.12.0)
multi_json (~> 1.3)
method_source (0.8.2)
multi_json (1.7.8)
multi_test (0.0.2)
pry (0.9.12.2)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.4)
rspec (2.14.1)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
Expand All @@ -21,11 +27,13 @@ GEM
rspec-expectations (2.14.1)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.3)
slop (3.4.6)

PLATFORMS
ruby

DEPENDENCIES
cucumber
gherkin
pry
rspec
19 changes: 19 additions & 0 deletions katas/tateti.rb
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
42 changes: 24 additions & 18 deletions spec/tateti_spec.rb
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

0 comments on commit a05bc25

Please sign in to comment.