mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-11-16 19:48:26 +01:00
add test_move_1_step
This commit is contained in:
parent
c26136dd3b
commit
a9eba6657c
1 changed files with 17 additions and 0 deletions
17
star.rb
17
star.rb
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue