Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2465deee69
Fetching contributors…

Cannot retrieve contributors at this time

executable file 29 lines (19 sloc) 0.635 kb
require "test/unit"
require "sudoku.rb"
class SudokuTester < Test::Unit::TestCase
@@sudokus_file = File.open(File.join(File.dirname(__FILE__),'sudokus_gth_level_88'))
@@solutions_file = File.open(File.join(File.dirname(__FILE__),'sudokus_gth_level_88_solved'))
def setup
@sudokus, @solutions = sudokus(@@sudokus_file),sudokus(@@solutions_file)
end
def test_hard_sudokus
@sudokus.each_with_index do |sudoku,i|
sudoku.solve
assert sudoku == @solutions[i]
end
end
private
def sudokus (file)
file.map {|l|Sudoku.new(l.split(",").map {|x| x.to_i})}
end
end
Jump to Line
Something went wrong with that request. Please try again.