Sha256: 4bea9f8cab77530d5ddadc77a11a16592e8eff5d63d0e756ddeffe782903ecf8

Contents?: true

Size: 972 Bytes

Versions: 6

Compression:

Stored size: 972 Bytes

Contents

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

class CropMiddlewareTest < Test::Unit::TestCase
  def test_crop_supports_hash_init
    receiver = flexmock
    m = Tracksperanto::Middleware::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::Middleware::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

6 entries across 6 versions & 1 rubygems

Version Path
tracksperanto-2.9.5 test/middleware/test_crop_middleware.rb
tracksperanto-2.9.4 test/middleware/test_crop_middleware.rb
tracksperanto-2.9.3 test/middleware/test_crop_middleware.rb
tracksperanto-2.9.2 test/middleware/test_crop_middleware.rb
tracksperanto-2.9.1 test/middleware/test_crop_middleware.rb
tracksperanto-2.9.0 test/middleware/test_crop_middleware.rb