Sha256: 327343ed6277d48ff81591fbd85b89c370363a6a47c0427d8ed3a6bf2e4dcbb5

Contents?: true

Size: 960 Bytes

Versions: 2

Compression:

Stored size: 960 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 TestPath < Test::Unit::TestCase
  def test_join
    path = '/tmp'
    path.extend Path
    assert_equal '/tmp/foo', path.join(:foo)
    assert_equal '/tmp/foo/bar', path.join(:bar, :foo)
  end

  def test_get
    path = '/tmp'
    path.extend Path
    assert_equal '/tmp/foo', path[:foo]
    assert_equal '/tmp/foo/bar', path.foo[:bar]
    assert_equal '/tmp/foo/bar', path[:bar, :foo]
  end

  def test_slash
    path = '/tmp'
    path.extend Path
    assert_equal '/tmp/foo', path/:foo
    assert_equal '/tmp/foo/bar', path/:foo/:bar
    assert_equal '/tmp/foo/bar', path.foo/:bar
    assert_equal '/tmp/foo/bar', path./(:bar, :foo)
  end

  def test_setup
    path = 'tmp'
    Path.setup(path)
    assert_equal 'scout', path.pkgdir
    assert path.libdir.end_with?("scout-gear")
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
scout-gear-1.1.1 test/scout/test_path.rb
scout-gear-1.1.0 test/scout/test_path.rb