Sha256: 785e75de30a01e401999cccdbc66840d135ca522c13eeca6d4a8bae95f821fd5

Contents?: true

Size: 789 Bytes

Versions: 23

Compression:

Stored size: 789 Bytes

Contents

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

class PrefixMiddlewareTest < Test::Unit::TestCase
  
  def test_prefix_supports_hash_init
    receiver = flexmock
    m = Tracksperanto::Middleware::Prefix.new(receiver, :prefix => "foo")
    assert_equal "foo", m.prefix
  end
  
  def test_prefixes
    receiver = flexmock
    receiver.should_receive(:start_tracker_segment).once.with("Pre_Tracker")
    
    m = Tracksperanto::Middleware::Prefix.new(receiver, :prefix => "Pre_")
    m.start_tracker_segment("Tracker")
  end

  def test_does_not_prefix_with_empty
    receiver = flexmock
    receiver.should_receive(:start_tracker_segment).once.with("Tracker")
    
    m = Tracksperanto::Middleware::Prefix.new(receiver)
    m.start_tracker_segment("Tracker")
  end
  
end

Version data entries

23 entries across 23 versions & 1 rubygems

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