forked from aprendegit/fork
-
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.
Incluidos 3 nuevos archivos en script folder
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 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 |
---|---|---|
@@ -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 |
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,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 |
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,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 |