add test_move_1_step

This commit is contained in:
Gwenhael Le Moine 2011-05-21 15:42:53 +07:00
parent c26136dd3b
commit a9eba6657c

17
star.rb
View file

@ -284,6 +284,13 @@ class Star
load_level
end
def positions()
@positions
end
def move_1_step( direction, objectToMove)
end
def move( direction, objectToMove )
@ -397,4 +404,14 @@ class TestBla < Test::Unit::TestCase
puts st.to_s
assert_equal( true, st.is_it_over? )
end
def test_move_1_step
st = Star.new
puts st.to_s
st.move_1_step( :down, :ball )
assert_equal( 1, st.positions[ :ball ][ :x ] )
assert_equal( 2, st.positions[ :ball ][ :y ] )
end
end