test/test_keyframe.rb in tracksperanto-2.8.6 vs test/test_keyframe.rb in tracksperanto-2.9.0

- old
+ new

@@ -1,5 +1,6 @@ +# -*- encoding : utf-8 -*- require File.expand_path(File.dirname(__FILE__)) + '/helper' class KeyframeTest < Test::Unit::TestCase def test_supports_block_init keyframe = Tracksperanto::Keyframe.new do |k| @@ -17,10 +18,23 @@ kf = Tracksperanto::Keyframe.new(:frame => 4, :abs_x => 10, :abs_y => 12.0) kf2 = Tracksperanto::Keyframe.new(:frame => 2, :abs_x => 10, :abs_y => 12.0) assert_equal [kf2, kf], [kf, kf2].sort end + def test_compares_equally_with_same_values + kf = Tracksperanto::Keyframe.new(:frame => 2, :abs_x => 10, :abs_y => 12.0) + kf2 = Tracksperanto::Keyframe.new(:frame => 2, :abs_x => 10, :abs_y => 12.0) + assert_equal kf, kf2 + end + + def test_dup + kf = Tracksperanto::Keyframe.new(:frame => 2, :abs_x => 10, :abs_y => 12.0) + kf2 = kf.dup + kf2.frame = 15 + assert_not_equal kf, kf2 + end + def test_inspect kf = Tracksperanto::Keyframe.new(:frame => 0, :abs_x => 10, :abs_y => 12.0) assert_equal "#< 10.0x12.0 @0 ~0.00) >", kf.inspect end @@ -38,6 +52,6 @@ kf = Tracksperanto::Keyframe.new {|k| k.abs_x = '123.45678'; k.abs_y = '321.45678' } assert_kind_of Float, kf.abs_x assert_kind_of Float, kf.abs_y end -end \ No newline at end of file +end