Sha256: b30773381401e50a3194b7f854c0a38281116e329b1cd1cbe59631ca2245a757

Contents?: true

Size: 1.42 KB

Versions: 26

Compression:

Stored size: 1.42 KB

Contents

# -*- encoding : utf-8 -*-
require File.expand_path(File.dirname(__FILE__)) + '/../helper'

class LengthCutoffToolTest < Test::Unit::TestCase
  
  def test_action_description
    assert_equal "Remove trackers that have less than the specified number of keyframes", Tracksperanto::Tool::LengthCutoff.action_description
  end
  
  def test_default_length_set_to_zero_and_ignored
    receiver = flexmock
    m = Tracksperanto::Tool::LengthCutoff.new(receiver)
    assert_equal 0, m.min_length
  end
  
  def test_slip_supports_hash_init
    receiver = flexmock
    m = Tracksperanto::Tool::LengthCutoff.new(receiver, :min_length => 23)
    assert_equal 23, m.min_length
  end
  
  def test_slipper_bypasses_methods
    receiver = flexmock
    receiver.should_receive(:start_export).once.with(120,120)
    receiver.should_receive(:start_tracker_segment).once.with("Tracker")
    12.times do | i |
      receiver.should_receive(:export_point).with(i, 100, 100, 0)
    end
    receiver.should_receive(:end_tracker_segment).once
    receiver.should_receive(:end_export).once
    
    
    m = Tracksperanto::Tool::LengthCutoff.new(receiver, :min_length => 12)
    m.start_export(120, 120)
    m.start_tracker_segment("Tracker")
    12.times {|t|  m.export_point(t, 100, 100, 0) }
    m.end_tracker_segment
    m.start_tracker_segment("Tracker2")
    11.times {|t|  m.export_point(t, 100, 100, 0) }
    m.end_tracker_segment
    m.end_export
    
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
tracksperanto-3.5.9 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.5.8 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.5.7 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.5.6 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.5.5 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.5.4 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.5.2 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.5.1 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.5.0 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.4.1 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.4.0 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.3.13 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.3.12 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.3.11 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.3.10 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.3.9 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.3.8 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.3.7 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.3.6 test/tools/test_length_cutoff_middleware.rb
tracksperanto-3.3.0.pre test/tools/test_length_cutoff_middleware.rb