Sha256: bf36292ab210f02880d44bba2380e4ac70363ad72e94d0152463d209e5742248

Contents?: true

Size: 1.59 KB

Versions: 23

Compression:

Stored size: 1.59 KB

Contents

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

class LerpMiddlewareTest < Test::Unit::TestCase
  def test_lerp
    receiver = flexmock
    m = Tracksperanto::Middleware::Lerp.new(receiver, :enabled => true)
    receiver.should_receive(:start_export).with(720, 576).once
    receiver.should_receive(:start_tracker_segment).with("Foo").once
    receiver.should_receive(:export_point).with(1, 1.0, 2.0, 0).once
    receiver.should_receive(:export_point).with(2, 2.0, 3.0, 0).once
    receiver.should_receive(:export_point).with(3, 3.0, 4.0, 0).once
    receiver.should_receive(:export_point).with(4, 4.0, 5.0, 0).once
    receiver.should_receive(:end_tracker_segment).once
    receiver.should_receive(:end_export).once
    
    m.start_export(720, 576)
    m.start_tracker_segment("Foo")
    m.export_point(1, 1.0, 2.0, 0)
    m.export_point(4, 4.0, 5.0, 0)
    m.end_tracker_segment
    m.end_export
  end
  
  def test_lerp_should_react_to_enabled_flag
    receiver = flexmock
    m = Tracksperanto::Middleware::Lerp.new(receiver, :enabled => false)
    receiver.should_receive(:start_export).with(720, 576).once
    receiver.should_receive(:start_tracker_segment).with("Foo").once
    receiver.should_receive(:export_point).with(1, 1.0, 2.0, 0).once
    receiver.should_receive(:export_point).with(4, 4.0, 5.0, 0).once
    receiver.should_receive(:end_tracker_segment).once
    receiver.should_receive(:end_export).once
    
    m.start_export(720, 576)
    m.start_tracker_segment("Foo")
    m.export_point(1, 1.0, 2.0, 0)
    m.export_point(4, 4.0, 5.0, 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_lerp_middleware.rb
tracksperanto-2.8.5 test/middleware/test_lerp_middleware.rb
tracksperanto-2.8.4 test/middleware/test_lerp_middleware.rb
tracksperanto-2.8.2 test/middleware/test_lerp_middleware.rb
tracksperanto-2.8.1 test/middleware/test_lerp_middleware.rb
tracksperanto-2.8.0 test/middleware/test_lerp_middleware.rb
tracksperanto-2.7.0 test/middleware/test_lerp_middleware.rb
tracksperanto-2.6.3 test/middleware/test_lerp_middleware.rb
tracksperanto-2.6.2 test/middleware/test_lerp_middleware.rb
tracksperanto-2.6.1 test/middleware/test_lerp_middleware.rb
tracksperanto-2.6.0 test/middleware/test_lerp_middleware.rb
tracksperanto-2.5.0 test/middleware/test_lerp_middleware.rb
tracksperanto-2.4.1 test/middleware/test_lerp_middleware.rb
tracksperanto-2.3.3 test/middleware/test_lerp_middleware.rb
tracksperanto-2.3.2 test/middleware/test_lerp_middleware.rb
tracksperanto-2.3.1 test/middleware/test_lerp_middleware.rb
tracksperanto-2.3.0 test/middleware/test_lerp_middleware.rb
tracksperanto-2.2.4 test/middleware/test_lerp_middleware.rb
tracksperanto-2.2.2 test/middleware/test_lerp_middleware.rb
tracksperanto-2.2.0 test/middleware/test_lerp_middleware.rb