Sha256: 216be4bc4aa1ec55aa81c7aeacdb000d801e6f50035d4687bce8d7f493c8918d

Contents?: true

Size: 1.04 KB

Versions: 26

Compression:

Stored size: 1.04 KB

Contents

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

class ShiftToolTest < Test::Unit::TestCase
  
  def test_action_description
    assert_equal "Move all the trackers by a specified number of pixels", Tracksperanto::Tool::Shift.action_description
  end
  
  def test_shift_supports_hash_init
    receiver = flexmock
    m = Tracksperanto::Tool::Shift.new(receiver, :x_shift => 1.2)
    assert_equal 1.2, m.x_shift
  end
  
  def test_shift_bypasses_methods
    receiver = flexmock
    receiver.should_receive(:start_export).once.with(50, 60)
    receiver.should_receive(:start_tracker_segment).once.with("Tracker")
    receiver.should_receive(:export_point).once.with(1, 123, 95, 0)
    receiver.should_receive(:end_tracker_segment).once
    receiver.should_receive(:end_export).once
    
    m = Tracksperanto::Tool::Shift.new(receiver, :x_shift => 63, :y_shift => 65)
    m.start_export(50, 60)
    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.2.2 test/tools/test_shift_middleware.rb
tracksperanto-3.2.1 test/tools/test_shift_middleware.rb
tracksperanto-3.2.0 test/tools/test_shift_middleware.rb
tracksperanto-3.1.0 test/tools/test_shift_middleware.rb
tracksperanto-3.0.1 test/tools/test_shift_middleware.rb
tracksperanto-3.0.0 test/tools/test_shift_middleware.rb