Skip to content

Instantly share code, notes, and snippets.

@8th-Light-Blog
Created June 29, 2011 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 8th-Light-Blog/1054208 to your computer and use it in GitHub Desktop.
Save 8th-Light-Blog/1054208 to your computer and use it in GitHub Desktop.
Blog Title: Limelight Tutorial: Tic Tac Toe Example (Part 3)
Author: Paul Pagel
Date: September 29th, 2008
F
1)
NoMethodError in 'Cell should make first move an X'
undefined method `mouse_clicked' for #
/Users/paulwpagel/Projects/tictac/spec/players/cell_spec.rb:14:
Finished in 0.007423 seconds
1 example, 1 failure
module Cell
def mouse_clicked(event)
cell_prop = scene.find(id)
cell_prop.text = "X"
end
end
$ jruby -S limelight open .
$ mkdir lib
$ mkdir spec/lib
$: << File.expand_path(File.dirname(__FILE__) + "/../lib")
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
require 'game'
describe Game do
it "make a move in the middle square" do
game = Game.new
game.move(1, 1)
game.mark_at(1, 1).should == "X"
end
end
class Game
def move(row, column)
end
def mark_at(row, column)
return "X"
end
end
require File.expand_path(File.dirname(__FILE__) + "/spec_helper")
require "game"
describe "init" do
it "should create new game on initialization" do
game = mock('game')
Game.should_receive(:new).and_return(game)
Game.should_receive(:current=).with(game)
require File.expand_path(File.dirname(__FILE__) + "/../init")
end
end
$: << File.expand_path(File.dirname(__FILE__) + "/lib")
require "game"
Game.current = Game.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment