Sha256: ed5ae9a723d1794dffd933c6c3f650359d553cc37a246315fe0e86e6c1a35ef1

Contents?: true

Size: 640 Bytes

Versions: 24

Compression:

Stored size: 640 Bytes

Contents

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

class TestPathUtil < Test::Unit::TestCase
  def test_dirname
    p = Path.setup("/usr/share/scout/data")

    assert_equal "/usr/share/scout", p.dirname
  end

  def test_glob
    TmpFile.in_dir :erase => false do |tmpdir|
      Path.setup tmpdir
      File.write(tmpdir.foo, 'foo')
      File.write(tmpdir.bar, 'bar')
      assert_equal 2, tmpdir.glob.length
      assert_equal %w(foo bar).sort, tmpdir.glob.collect{|p| p.basename }.sort
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
scout-essentials-1.6.5 test/scout/path/test_util.rb
scout-essentials-1.6.4 test/scout/path/test_util.rb
scout-essentials-1.6.3 test/scout/path/test_util.rb
scout-essentials-1.6.2 test/scout/path/test_util.rb
scout-essentials-1.6.1 test/scout/path/test_util.rb
scout-essentials-1.6.0 test/scout/path/test_util.rb
scout-essentials-1.3.1 test/scout/path/test_util.rb
scout-essentials-1.3.0 test/scout/path/test_util.rb
scout-essentials-1.2.0 test/scout/path/test_util.rb
scout-essentials-1.1.1 test/scout/path/test_util.rb
scout-essentials-1.1.0 test/scout/path/test_util.rb
scout-essentials-1.0.0 test/scout/path/test_util.rb
scout-gear-9.1.0 test/scout/path/test_util.rb
scout-gear-9.0.0 test/scout/path/test_util.rb
scout-gear-8.1.0 test/scout/path/test_util.rb
scout-gear-8.0.0 test/scout/path/test_util.rb
scout-gear-7.3.0 test/scout/path/test_util.rb
scout-gear-7.2.0 test/scout/path/test_util.rb
scout-gear-7.1.0 test/scout/path/test_util.rb
scout-gear-6.0.0 test/scout/path/test_util.rb