-
-
Save 8th-Light-Blog/1054208 to your computer and use it in GitHub Desktop.
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
Blog Title: Limelight Tutorial: Tic Tac Toe Example (Part 3) | |
Author: Paul Pagel | |
Date: September 29th, 2008 |
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
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 |
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
module Cell | |
def mouse_clicked(event) | |
cell_prop = scene.find(id) | |
cell_prop.text = "X" | |
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
$ jruby -S limelight open . |
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
$ mkdir lib | |
$ mkdir spec/lib |
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
$: << File.expand_path(File.dirname(__FILE__) + "/../lib") |
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
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 |
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
class Game | |
def move(row, column) | |
end | |
def mark_at(row, column) | |
return "X" | |
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
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 |
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
$: << 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