Sha256: efd67521dfa5c661c0080c19e290f715bdcf88f49d97d4a77215e047d4e84f60

Contents?: true

Size: 846 Bytes

Versions: 8

Compression:

Stored size: 846 Bytes

Contents

require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')

class TestResourceUtil < Test::Unit::TestCase
  def test_identify
    path = Path.setup('share/data/somedir/somepath').find
    assert_equal 'share/data/somedir/somepath', Scout.identify(path)
  end

  def test_relocate
    TmpFile.with_file do |dir|
      Path.setup dir

      path_base = Path.setup("basedir").someother.file
      path_base.path_maps[:subdir1] = File.join(dir, 'subdir1', '{PATH}')
      path_base.path_maps[:subdir2] = File.join(dir, 'subdir2', '{PATH}')

      path1 = path_base.find(:subdir1)
      path2 = path_base.find(:subdir2)

      Open.write(path1, "TEST")
      Open.mv path1, path2
      assert_equal path2, Resource.relocate(path1)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
scout-gear-9.0.0 test/scout/resource/test_util.rb
scout-gear-8.1.0 test/scout/resource/test_util.rb
scout-gear-8.0.0 test/scout/resource/test_util.rb
scout-gear-7.3.0 test/scout/resource/test_util.rb
scout-gear-7.2.0 test/scout/resource/test_util.rb
scout-gear-7.1.0 test/scout/resource/test_util.rb
scout-gear-6.0.0 test/scout/resource/test_util.rb
scout-gear-5.2.0 test/scout/resource/test_util.rb