Sha256: fcb84590eac7ea0802bd168ac8e7364f1a5a2431c3c6a38bf4f99a0e2921d979

Contents?: true

Size: 894 Bytes

Versions: 23

Compression:

Stored size: 894 Bytes

Contents

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

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

23 entries across 23 versions & 1 rubygems

Version Path
tracksperanto-2.8.6 test/middleware/test_shift_middleware.rb
tracksperanto-2.8.5 test/middleware/test_shift_middleware.rb
tracksperanto-2.8.4 test/middleware/test_shift_middleware.rb
tracksperanto-2.8.2 test/middleware/test_shift_middleware.rb
tracksperanto-2.8.1 test/middleware/test_shift_middleware.rb
tracksperanto-2.8.0 test/middleware/test_shift_middleware.rb
tracksperanto-2.7.0 test/middleware/test_shift_middleware.rb
tracksperanto-2.6.3 test/middleware/test_shift_middleware.rb
tracksperanto-2.6.2 test/middleware/test_shift_middleware.rb
tracksperanto-2.6.1 test/middleware/test_shift_middleware.rb
tracksperanto-2.6.0 test/middleware/test_shift_middleware.rb
tracksperanto-2.5.0 test/middleware/test_shift_middleware.rb
tracksperanto-2.4.1 test/middleware/test_shift_middleware.rb
tracksperanto-2.3.3 test/middleware/test_shift_middleware.rb
tracksperanto-2.3.2 test/middleware/test_shift_middleware.rb
tracksperanto-2.3.1 test/middleware/test_shift_middleware.rb
tracksperanto-2.3.0 test/middleware/test_shift_middleware.rb
tracksperanto-2.2.4 test/middleware/test_shift_middleware.rb
tracksperanto-2.2.2 test/middleware/test_shift_middleware.rb
tracksperanto-2.2.0 test/middleware/test_shift_middleware.rb