Sha256: adf44f568dbdb2ec299a9bcf3394a50b0a7aaeabef9af62f83155317048b1667

Contents?: true

Size: 1.09 KB

Versions: 26

Compression:

Stored size: 1.09 KB

Contents

# -*- encoding : utf-8 -*-
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

26 entries across 26 versions & 1 rubygems

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