Sha256: 0ed081b07400819d39c86226deb498a4e7f37cf58e8b5160b89a4e8d8b5d400d
Contents?: true
Size: 1.52 KB
Versions: 13
Compression:
Stored size: 1.52 KB
Contents
require File.expand_path(File.dirname(__FILE__)) + '/../helper' class ShakeTextImportTest < Test::Unit::TestCase DELTA = 0.000001 def test_introspects_properly i = Tracksperanto::Import::ShakeText assert_equal "Shake .txt tracker file", i.human_name assert !i.autodetects_size? end def test_parsing fixture = File.open(File.dirname(__FILE__) + '/samples/shake_text/one_shake_tracker.txt') trackers = Tracksperanto::Import::ShakeText.new(:io => fixture).to_a assert_kind_of Enumerable, trackers assert_equal 1, trackers.length t = trackers[0] assert_kind_of Tracksperanto::Tracker, t assert_equal 46, t.keyframes.length assert_equal "track1", t.name second_kf = t.keyframes[1] assert_in_delta 121, second_kf.frame, DELTA assert_in_delta 373.746, second_kf.abs_x, DELTA assert_in_delta 984.564, second_kf.abs_y, DELTA assert_in_delta 0.002, second_kf.residual, DELTA end def test_parsing_two_trackers fixture = File.open(File.dirname(__FILE__) + '/samples/shake_text/two_shake_trackers.txt') trackers = Tracksperanto::Import::ShakeText.new(:io => fixture).to_a assert_kind_of Enumerable, trackers assert_equal 2, trackers.length t = trackers[0] assert_equal "track1", t.name assert_kind_of Tracksperanto::Tracker, t assert_equal 6, t.keyframes.length second_kf = t.keyframes[1] assert_in_delta 111, second_kf.frame, DELTA t2 = trackers[-1] assert_equal "track2", t2.name end end
Version data entries
13 entries across 13 versions & 1 rubygems