Permalink
Browse files

Player now moves on screen on "Code".

  • Loading branch information...
1 parent 3a2d5a0 commit 1a5706c6881fe1f374d4ff547992650f15d90a78 @mauricioszabo committed Nov 28, 2011
Showing with 13 additions and 0 deletions.
  1. +4 −0 lib/code.rb
  2. +9 −0 spec/code_spec.rb
View
@@ -30,6 +30,10 @@ def define_methods(player)
end
player.turn_to(dir)
end
+
+ define_method :goto do |x, y|
+ player.goto(x, y)
+ end
end
private :define_methods
end
View
@@ -31,6 +31,15 @@
end
end
+ context "on moving" do
+ it 'should move a player to a given direction' do
+ player.should_receive(:goto).with(10, 20)
+ run {
+ goto 10, 20
+ }
+ end
+ end
+
context "on security" do
it 'should not register a new player' do
new_player = mock Player

0 comments on commit 1a5706c

Please sign in to comment.