Skip to content

Commit

Permalink
Add new test, and make the width and height arguments for the
Browse files Browse the repository at this point in the history
animation constructor be on the same line while I'm here.
  • Loading branch information
Chadowo committed Mar 5, 2024
1 parent e4e1cd3 commit f492ec7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/test_animation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ def setup

# This animation has 4 frames
@sample_animation = AniRuby::Animation.new(media_dir('king_walk.png'),
@sprite_w,
@sprite_h,
@sprite_w, @sprite_h,
@duration)
end

def test_extra_durations_are_discarded
# The king's walk animation has only four frames, but here
# we passed six durations
AniRuby::Animation.new(media_dir('king_walk.png'),
@sprite_w, @sprite_h,
0.1, 0.2, 0.3, 0.4, 0.5, 0.6)
end

def test_starts_at_zero
assert_equal 0, @sample_animation.cursor
end
Expand Down

0 comments on commit f492ec7

Please sign in to comment.