forked from zassmin/TicTacToeSkeleton
-
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.
started creating the board.rb and it's test. follow complete document…
…ation on TicTacToeDocumentation
- Loading branch information
Showing
3 changed files
with
49 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,11 @@ | ||
# board.rb | ||
|
||
class Board | ||
attr_accessor :board | ||
|
||
def initialize | ||
@board = [[nil, nil, nil], | ||
[nil, nil, nil], | ||
[nil, nil, nil]] | ||
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,16 @@ | ||
# encoding: UTF-8 | ||
# This file is auto-generated from the current state of the database. Instead | ||
# of editing this file, please use the migrations feature of Active Record to | ||
# incrementally modify your database, and then regenerate this schema definition. | ||
# | ||
# Note that this schema.rb definition is the authoritative source for your | ||
# database schema. If you need to create the application database on another | ||
# system, you should be using db:schema:load, not running all the migrations | ||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | ||
# you'll amass, the slower it'll run and the greater likelihood for issues). | ||
# | ||
# It's strongly recommended to check this file into your version control system. | ||
|
||
ActiveRecord::Schema.define(:version => 0) do | ||
|
||
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,22 @@ | ||
require 'spec_helper' | ||
require 'board.rb' | ||
|
||
describe Board do | ||
before do | ||
@show_board = Board.new | ||
end | ||
|
||
it "should be initialized with nil values inside of the array, [[]]" do | ||
@show_board.board.should == [[nil, nil, nil], | ||
[nil, nil, nil], | ||
[nil, nil, nil]] | ||
end | ||
end | ||
|
||
# rather than nil, i should test empty? or that there is an array! yes!!! | ||
# check out the data structures from connectfour | ||
# not quite helpful | ||
# just do it girl! | ||
# check that attributes for it exist | ||
# at which point do I migrate to the database? | ||
# jsut do this Z! |