Sha256: f3dbbb6e31b39882e5d195b51c3073af286f24ba5785e70dbbe1bba36a20ca67
Contents?: true
Size: 1017 Bytes
Versions: 125
Compression:
Stored size: 1017 Bytes
Contents
#!/usr/bin/env ruby require 'test/unit' require 'rake' class TestRake < Test::Unit::TestCase def test_each_dir_parent assert_equal ['a'], alldirs('a') assert_equal ['a/b', 'a'], alldirs('a/b') assert_equal ['/a/b', '/a', '/'], alldirs('/a/b') if File.dirname("c:/foo") == "c:" # Under Unix assert_equal ['c:/a/b', 'c:/a', 'c:'], alldirs('c:/a/b') assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b') else # Under Windows assert_equal ['c:/a/b', 'c:/a', 'c:/'], alldirs('c:/a/b') assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b') end end def alldirs(fn) result = [] Rake.each_dir_parent(fn) { |d| result << d } result end def test_can_override_application old_app = Rake.application fake_app = Object.new Rake.application = fake_app assert_equal fake_app, Rake.application ensure Rake.application = old_app end def test_original_dir_reports_current_dir assert_equal Dir.pwd, Rake.original_dir end end
Version data entries
125 entries across 97 versions & 11 rubygems
Version | Path |
---|---|
rake-0.8.6 | test/test_rake.rb |
rake-0.8.2 | test/test_rake.rb |
rake-0.8.5 | test/test_rake.rb |
rake-0.8.3 | test/test_rake.rb |
rake-0.8.4 | test/test_rake.rb |