2 require 'animation_field'
6 class TestSimpleAnimation < Test::Unit::TestCase
8 anim = SimpleAnimation.new "test", 10,
9 mock("init") {|x| x.expects(:[]).once.with },
10 mock("step") {|x| x.expects(:[]).once.with(0.0) },
11 mock("post") {|x| x.expects(:[]).never }
18 step_mock = mock("step") do |x|
19 x.expects(:[]).once.with(0.0)
20 x.expects(:[]).once.with(1.0)
23 anim = SimpleAnimation.new "test", 10,
24 mock("init") {|x| x.expects(:[]).once.with },
26 mock("post") {|x| x.expects(:[]).once.with }
33 steps = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
34 step_mock = mock("step") do |x|
36 x.expects(:[]).once.with(s)
39 anim = SimpleAnimation.new "test", 10, nil, step_mock
42 anim[start + s * 10.0]
47 anim = SimpleAnimation.new "hello", 10, nil, lambda {}
48 assert_match /hello/, anim.to_s