Sha256: c7a9f9198a6831750306e6921b2019a012ad162cda6326078a090a8025d1c8a2

Contents?: true

Size: 903 Bytes

Versions: 3

Compression:

Stored size: 903 Bytes

Contents

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

class PrefixToolTest < Test::Unit::TestCase
  
  def test_action_description
    assert_equal "Prefix tracker names with text", Tracksperanto::Tool::Prefix.action_description
  end
  
  def test_prefix_supports_hash_init
    receiver = flexmock
    m = Tracksperanto::Tool::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::Tool::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::Tool::Prefix.new(receiver)
    m.start_tracker_segment("Tracker")
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tracksperanto-4.1.2 test/tools/test_prefix.rb
tracksperanto-4.1.0 test/tools/test_prefix.rb
tracksperanto-4.0.0 test/tools/test_prefix.rb