PageRenderTime 98ms CodeModel.GetById 72ms app.highlight 9ms RepoModel.GetById 12ms app.codeStats 0ms

/tools/Ruby/lib/ruby/gems/1.8/gems/rake-0.9.2/test/test_rake_path_map_explode.rb

http://github.com/agross/netopenspace
Ruby | 31 lines | 26 code | 5 blank | 0 comment | 1 complexity | 42ee0e76e37410e5426d0de39e5b5664 MD5 | raw file
 1require File.expand_path('../helper', __FILE__)
 2
 3class TestRakePathMapExplode < Rake::TestCase
 4  def setup
 5    super
 6
 7    String.class_eval { public :pathmap_explode }
 8  end
 9
10  def teardown
11    String.class_eval { protected :pathmap_explode }
12  end
13
14  def test_explode
15    assert_equal ['a'], 'a'.pathmap_explode
16    assert_equal ['a', 'b'], 'a/b'.pathmap_explode
17    assert_equal ['a', 'b', 'c'], 'a/b/c'.pathmap_explode
18    assert_equal ['/', 'a'], '/a'.pathmap_explode
19    assert_equal ['/', 'a', 'b'], '/a/b'.pathmap_explode
20    assert_equal ['/', 'a', 'b', 'c'], '/a/b/c'.pathmap_explode
21    if File::ALT_SEPARATOR
22      assert_equal ['c:.', 'a'], 'c:a'.pathmap_explode
23      assert_equal ['c:.', 'a', 'b'], 'c:a/b'.pathmap_explode
24      assert_equal ['c:.', 'a', 'b', 'c'], 'c:a/b/c'.pathmap_explode
25      assert_equal ['c:/', 'a'], 'c:/a'.pathmap_explode
26      assert_equal ['c:/', 'a', 'b'], 'c:/a/b'.pathmap_explode
27      assert_equal ['c:/', 'a', 'b', 'c'], 'c:/a/b/c'.pathmap_explode
28    end
29  end
30end
31