2 require 'animation_field'
5 class SimpleAnimationTest < Test::Unit::TestCase
7 anim = SimpleAnimation.new "test", 10,
8 mock("init") {|x| x.expects(:[]).once.with },
9 mock("step") {|x| x.expects(:[]).once.with(0.0) },
10 mock("post") {|x| x.expects(:[]).never }
17 step_mock = mock("step") do |x|
18 x.expects(:[]).once.with(0.0)
19 x.expects(:[]).once.with(1.0)
22 anim = SimpleAnimation.new "test", 10,
23 mock("init") {|x| x.expects(:[]).once.with },
25 mock("post") {|x| x.expects(:[]).once.with }
32 steps = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
33 step_mock = mock("step") do |x|
35 x.expects(:[]).once.with(s)
38 anim = SimpleAnimation.new "test", 10, nil, step_mock
41 anim[start + s * 10.0]
46 anim = SimpleAnimation.new "hello", 10, nil, lambda {}
47 assert_match /hello/, anim.to_s