Skip to content

Commit

Permalink
Incluidos 3 nuevos archivos en script folder
Browse files Browse the repository at this point in the history
  • Loading branch information
emecas committed Oct 17, 2014
1 parent 7434f92 commit 3597625
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
12 changes: 12 additions & 0 deletions script/dumpplayer_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'gema'

describe Gema::DumbPlayer do
before :each do
@dp = Gema::DumbPlayer.new("X")
end

it "Debe existir un metodo move" do
@dp.respond_to?("move").should == true
end

end
15 changes: 15 additions & 0 deletions script/humanplayer_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require 'gema'

describe Gema::HumanPlayer do
before :each do
@hp = Gema::HumanPlayer.new("X")
end

it "Debe existir un metodo move" do
@hp.respond_to?("move").should == true
end

it "Debe existir un metodo finish" do
@hp.respond_to?("finish").should == true
end
end
21 changes: 21 additions & 0 deletions script/minimaxplayer_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require "gema"

describe Gema::MinimaxPlayer do
before :each do
@mp = Gema::MinimaxPlayer.new("X")
end

it "Debe existir un metodo move" do
@mp.respond_to?("move").should == true
end

it "El metodo move debe tratar de evitar la derrota" do
@board = Gema::Board.new(["X", "X", "O", "O", "O", "X", " ", "O", " "])
@mp.move(@board).should == "c1"
end

it "El metodo move debe tratar de ganar" do
@board = Gema::Board.new([" ", "O", "X", " ", "X", " ", "O", "O", "X"])
@mp.move(@board).should == "a1"
end
end

0 comments on commit 3597625

Please sign in to comment.