Sha256: a928c7fcef85756d5785fc2862c49927e674d9854a38d6a6c3693cc58034ede8

Contents?: true

Size: 1 KB

Versions: 23

Compression:

Stored size: 1 KB

Contents

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

class SlipMiddlewareTest < Test::Unit::TestCase
  def test_default_slip_set_to_zero
    receiver = flexmock
    m = Tracksperanto::Middleware::Slipper.new(receiver)
    assert_equal 0, m.slip
  end
  
  def test_slip_supports_hash_init
    receiver = flexmock
    m = Tracksperanto::Middleware::Slipper.new(receiver, :slip => -1)
    assert_equal -1, m.slip
  end
  
  def test_slipper_bypasses_methods
    receiver = flexmock
    receiver.should_receive(:start_export).once.with(120,120)
    receiver.should_receive(:start_tracker_segment).once.with("Tracker")
    receiver.should_receive(:export_point).once.with(32, 100, 100, 0)
    receiver.should_receive(:end_tracker_segment).once
    receiver.should_receive(:end_export).once
    
    m = Tracksperanto::Middleware::Slipper.new(receiver, :slip => 32)
    m.start_export(120, 120)
    m.start_tracker_segment("Tracker")
    m.export_point(0, 100, 100, 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_slip_middleware.rb
tracksperanto-2.8.5 test/middleware/test_slip_middleware.rb
tracksperanto-2.8.4 test/middleware/test_slip_middleware.rb
tracksperanto-2.8.2 test/middleware/test_slip_middleware.rb
tracksperanto-2.8.1 test/middleware/test_slip_middleware.rb
tracksperanto-2.8.0 test/middleware/test_slip_middleware.rb
tracksperanto-2.7.0 test/middleware/test_slip_middleware.rb
tracksperanto-2.6.3 test/middleware/test_slip_middleware.rb
tracksperanto-2.6.2 test/middleware/test_slip_middleware.rb
tracksperanto-2.6.1 test/middleware/test_slip_middleware.rb
tracksperanto-2.6.0 test/middleware/test_slip_middleware.rb
tracksperanto-2.5.0 test/middleware/test_slip_middleware.rb
tracksperanto-2.4.1 test/middleware/test_slip_middleware.rb
tracksperanto-2.3.3 test/middleware/test_slip_middleware.rb
tracksperanto-2.3.2 test/middleware/test_slip_middleware.rb
tracksperanto-2.3.1 test/middleware/test_slip_middleware.rb
tracksperanto-2.3.0 test/middleware/test_slip_middleware.rb
tracksperanto-2.2.4 test/middleware/test_slip_middleware.rb
tracksperanto-2.2.2 test/middleware/test_slip_middleware.rb
tracksperanto-2.2.0 test/middleware/test_slip_middleware.rb