Skip to content

Commit

Permalink
started creating the board.rb and it's test. follow complete document…
Browse files Browse the repository at this point in the history
…ation on TicTacToeDocumentation
  • Loading branch information
zassmin committed Mar 24, 2013
1 parent 56d193a commit 44b9764
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/models/board.rb
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
16 changes: 16 additions & 0 deletions db/schema.rb
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
22 changes: 22 additions & 0 deletions spec/models/board_spec.rb
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!

0 comments on commit 44b9764

Please sign in to comment.