Permalink
Browse files

adds tentative show method.

  • Loading branch information...
yokolet committed Aug 8, 2011
1 parent e931e7b commit 77b72a5933b6cdd41668e0f8ba76cb90a23da01d
Showing with 11 additions and 0 deletions.
  1. +1 −0 lib/turtle.rb
  2. +10 −0 test/canvas_test.rb
View
@@ -29,6 +29,7 @@ def initialize(canvas_size)
@orientation = NORTH
@footsteps = []
@canvas = Canvas.new(canvas_size)
+ @canvas.insert(Footstep.new(@row, @col))
end
def rt(degree)
View
@@ -4,6 +4,7 @@
require 'contest'
require 'canvas'
require 'footstep'
+require 'turtle'
class CanvasTest < Test::Unit::TestCase
@@ -31,4 +32,13 @@ def teardown
@canvas.insert(Footstep.new(6, 1))
assert_equal(6, @canvas.footsteps.last.row)
end
+
+ test "canvas shows footsteps" do
+ turtle = Turtle.new(11)
+ turtle.rt(90)
+ turtle.fd(5)
+ turtle.rt(135)
+ turtle.fd(5)
+ turtle.canvas.show
+ end
end

0 comments on commit 77b72a5

Please sign in to comment.