Sha256: c0150b646e65061d65445e7d2369654ecabc66879b971ebf55a6d0d5ce3b175c

Contents?: true

Size: 1.12 KB

Versions: 19

Compression:

Stored size: 1.12 KB

Contents

require 'test/unit'
require 'rvc/path'

class ParsePathTest < Test::Unit::TestCase
  def test_empty
    els, absolute, trailing_slash = RVC::Path.parse('')
    assert_equal [], els
    assert_equal false, absolute
    assert_equal false, trailing_slash
  end

  def test_root
    els, absolute, trailing_slash = RVC::Path.parse('/')
    assert_equal [], els
    assert_equal true, absolute
    assert_equal true, trailing_slash
  end

  def test_normal
    els, absolute, trailing_slash = RVC::Path.parse('/foo/bar')
    assert_equal %w(foo bar), els
    assert_equal true, absolute
    assert_equal false, trailing_slash

    els, absolute, trailing_slash = RVC::Path.parse('/foo/bar/')
    assert_equal %w(foo bar), els
    assert_equal true, absolute
    assert_equal true, trailing_slash

    els, absolute, trailing_slash = RVC::Path.parse('foo/bar/')
    assert_equal %w(foo bar), els
    assert_equal false, absolute
    assert_equal true, trailing_slash

    els, absolute, trailing_slash = RVC::Path.parse('foo/bar')
    assert_equal %w(foo bar), els
    assert_equal false, absolute
    assert_equal false, trailing_slash
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
rvc-1.6.0 test/test_parse_path.rb
rvc-1.5.0 test/test_parse_path.rb
rvc-1.4.1 test/test_parse_path.rb
rvc-1.4.0 test/test_parse_path.rb
rvc-1.3.6 test/test_parse_path.rb
rvc-1.3.5 test/test_parse_path.rb
rvc-1.3.4 test/test_parse_path.rb
rvc-1.3.3 test/test_parse_path.rb
rvc-1.3.2 test/test_parse_path.rb
rvc-1.3.1 test/test_parse_path.rb
rvc-1.3.0 test/test_parse_path.rb
rvc-1.2.2 test/test_parse_path.rb
rvc-1.2.1 test/test_parse_path.rb
rvc-1.2.0 test/test_parse_path.rb
rvc-1.1.0 test/test_parse_path.rb
rvc-1.0.3 test/test_parse_path.rb
rvc-1.0.2 test/test_parse_path.rb
rvc-1.0.1 test/test_parse_path.rb
rvc-1.0.0 test/test_parse_path.rb