Sha256: 248f6f89ccb905cca203b57a5b76cf0015564b3a509dde296471bf28a41a70f6

Contents?: true

Size: 1.06 KB

Versions: 3

Compression:

Stored size: 1.06 KB

Contents

require File.expand_path(File.dirname(__FILE__)) + '/../helper'

class CropToolTest < Test::Unit::TestCase
  
  def test_action_description
    assert_equal "Crop or pad the image by a specified number of pixels", Tracksperanto::Tool::Crop.action_description
  end
  
  def test_crop_supports_hash_init
    receiver = flexmock
    m = Tracksperanto::Tool::Crop.new(receiver, :left => 13, :right => 0, :top => 25)
  end
  
  def test_shift_bypasses_methods
    receiver = flexmock
    padded_w, padded_h = 720 - 60, 576 + 58
    
    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, 120.0, -28.0, 0)
    receiver.should_receive(:end_tracker_segment).once
    receiver.should_receive(:end_export).once
    
    m = Tracksperanto::Tool::Crop.new(receiver, :left => -60, :bottom => 58)
    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

3 entries across 3 versions & 1 rubygems

Version Path
tracksperanto-4.1.2 test/tools/test_crop_middleware.rb
tracksperanto-4.1.0 test/tools/test_crop_middleware.rb
tracksperanto-4.0.0 test/tools/test_crop_middleware.rb