Sha256: 5eea7070b5581603bfb04796fa4b9d10179fe338dbd2b042ec8190d8ed97162e

Contents?: true

Size: 960 Bytes

Versions: 10

Compression:

Stored size: 960 Bytes

Contents

# -*- encoding : utf-8 -*-
require File.expand_path(File.dirname(__FILE__)) + '/../helper'

class PrefixMiddlewareTest < Test::Unit::TestCase
  
  def test_action_description
    assert_equal "Prefix tracker names with text", Tracksperanto::Middleware::Prefix.action_description
  end
  
  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

10 entries across 10 versions & 1 rubygems

Version Path
tracksperanto-2.12.0 test/middleware/test_prefix.rb
tracksperanto-2.11.3 test/middleware/test_prefix.rb
tracksperanto-2.11.2 test/middleware/test_prefix.rb
tracksperanto-2.11.1 test/middleware/test_prefix.rb
tracksperanto-2.11.0 test/middleware/test_prefix.rb
tracksperanto-2.10.0 test/middleware/test_prefix.rb
tracksperanto-2.9.9 test/middleware/test_prefix.rb
tracksperanto-2.9.8 test/middleware/test_prefix.rb
tracksperanto-2.9.7 test/middleware/test_prefix.rb
tracksperanto-2.9.6 test/middleware/test_prefix.rb