Sha256: 692f09c6c0dc6c7f65516220d82604141ea2010289f2346c6156edb404244c3c

Contents?: true

Size: 1.02 KB

Versions: 48

Compression:

Stored size: 1.02 KB

Contents

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

class GoldenMiddlewareTest < Test::Unit::TestCase
  def test_default_golden_set_to_false
    receiver = flexmock
    m = Tracksperanto::Middleware::Golden.new(receiver)
    assert_equal false, m.enabled
  end
  
  def test_golden_supports_hash_init
    receiver = flexmock
    m = Tracksperanto::Middleware::Golden.new(receiver, :enabled => true)
    assert_equal true, m.enabled
  end
  
  def test_golden_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(0, 100, 100, 0.0)
    receiver.should_receive(:end_tracker_segment).once
    receiver.should_receive(:end_export).once
    
    m = Tracksperanto::Middleware::Golden.new(receiver, :enabled => true)
    m.start_export(120, 120)
    m.start_tracker_segment("Tracker")
    m.export_point(0, 100, 100, 0.56)
    m.end_tracker_segment
    m.end_export
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
tracksperanto-1.7.0 test/middleware/test_golden_middleware.rb
tracksperanto-1.6.9 test/middleware/test_golden_middleware.rb
tracksperanto-1.6.8 test/middleware/test_golden_middleware.rb
tracksperanto-1.6.7 test/middleware/test_golden_middleware.rb
tracksperanto-1.6.6 test/middleware/test_golden_middleware.rb
tracksperanto-1.6.5 test/middleware/test_golden_middleware.rb
tracksperanto-1.6.4 test/middleware/test_golden_middleware.rb
tracksperanto-1.6.3 test/middleware/test_golden_middleware.rb
tracksperanto-1.6.2 test/middleware/test_golden_middleware.rb
tracksperanto-1.6.1 test/middleware/test_golden_middleware.rb
tracksperanto-1.6.0 test/middleware/test_golden_middleware.rb
tracksperanto-1.5.7 test/middleware/test_golden_middleware.rb
tracksperanto-1.5.6 test/middleware/test_golden_middleware.rb
tracksperanto-1.5.5 test/middleware/test_golden_middleware.rb
tracksperanto-1.5.4 test/middleware/test_golden_middleware.rb
tracksperanto-1.5.3 test/middleware/test_golden_middleware.rb
tracksperanto-1.5.2 test/middleware/test_golden_middleware.rb
tracksperanto-1.5.1 test/middleware/test_golden_middleware.rb
tracksperanto-1.5.0 test/middleware/test_golden_middleware.rb
tracksperanto-1.4.0 test/middleware/test_golden_middleware.rb