Sha256: d27dfa8ac35acd166a4026b47c8dc5a7f6b5f257ac12fbaf71810686ba4c889e

Contents?: true

Size: 1.23 KB

Versions: 26

Compression:

Stored size: 1.23 KB

Contents

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

class PadToolTest < Test::Unit::TestCase
  
  def test_action_description
    assert_equal "Pad or crop the image by a fraction of it's original size", Tracksperanto::Tool::Pad.action_description
  end
  
  def test_shift_supports_hash_init
    receiver = flexmock
    m = Tracksperanto::Tool::Pad.new(receiver, 
      :left_pad => 0.5, :right_pad => 0, :top_pad => -0.2)
    assert_in_delta 0.5, m.left_pad, 0.001 
    assert_in_delta 0.0, m.bottom_pad, 0.001 
  end
  
  def test_shift_bypasses_methods
    receiver = flexmock
    padded_w, padded_h = (720 * 0.75).ceil, (576 * 1.1).ceil
    
    receiver.should_receive(:start_export).once.with(padded_w, padded_h)
    receiver.should_receive(:start_tracker_segment).once.with("Tracker")
    receiver.should_receive(:export_point).once.with(1, 240.0, -27.6, 0)
    receiver.should_receive(:end_tracker_segment).once
    receiver.should_receive(:end_export).once
    
    m = Tracksperanto::Tool::Pad.new(receiver, :left_pad => -0.25, :bottom_pad => 0.10)
    m.start_export(720, 576)
    m.start_tracker_segment("Tracker")
    m.export_point(1, 60, 30, 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_pad_middleware.rb
tracksperanto-3.5.8 test/tools/test_pad_middleware.rb
tracksperanto-3.5.7 test/tools/test_pad_middleware.rb
tracksperanto-3.5.6 test/tools/test_pad_middleware.rb
tracksperanto-3.5.5 test/tools/test_pad_middleware.rb
tracksperanto-3.5.4 test/tools/test_pad_middleware.rb
tracksperanto-3.5.2 test/tools/test_pad_middleware.rb
tracksperanto-3.5.1 test/tools/test_pad_middleware.rb
tracksperanto-3.5.0 test/tools/test_pad_middleware.rb
tracksperanto-3.4.1 test/tools/test_pad_middleware.rb
tracksperanto-3.4.0 test/tools/test_pad_middleware.rb
tracksperanto-3.3.13 test/tools/test_pad_middleware.rb
tracksperanto-3.3.12 test/tools/test_pad_middleware.rb
tracksperanto-3.3.11 test/tools/test_pad_middleware.rb
tracksperanto-3.3.10 test/tools/test_pad_middleware.rb
tracksperanto-3.3.9 test/tools/test_pad_middleware.rb
tracksperanto-3.3.8 test/tools/test_pad_middleware.rb
tracksperanto-3.3.7 test/tools/test_pad_middleware.rb
tracksperanto-3.3.6 test/tools/test_pad_middleware.rb
tracksperanto-3.3.0.pre test/tools/test_pad_middleware.rb