From f492ec79f371e35b2ca62a0d45e4e668e430aba2 Mon Sep 17 00:00:00 2001 From: Chadowo <83732118+Chadowo@users.noreply.github.com> Date: Tue, 5 Mar 2024 19:31:51 -0300 Subject: [PATCH] Add new test, and make the width and height arguments for the animation constructor be on the same line while I'm here. --- test/test_animation.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/test_animation.rb b/test/test_animation.rb index c85a012..ff7307f 100644 --- a/test/test_animation.rb +++ b/test/test_animation.rb @@ -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