diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-02 19:07:55 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-10-02 19:07:55 +0000 |
| commit | 8da109fa1ec17fb4096470fe97135f41cdd3345b (patch) | |
| tree | c5a08c8c9abae9b7f0514f680f56553a7a03656a /test/rake/test_rake.rb | |
| parent | b43ab1d7f1a8bc1a6fbca4d193c37fb0c6d28281 (diff) | |
| download | ruby-8da109fa1ec17fb4096470fe97135f41cdd3345b.tar.gz ruby-8da109fa1ec17fb4096470fe97135f41cdd3345b.tar.xz ruby-8da109fa1ec17fb4096470fe97135f41cdd3345b.zip | |
* lib/rake: updated to rake code to rake-0.8.7 source code base.
* lib/rake/loaders/makefile.rb (Rake::MakefileLoader#process_line):
respace dependencies too.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake/test_rake.rb')
| -rw-r--r-- | test/rake/test_rake.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/rake/test_rake.rb b/test/rake/test_rake.rb new file mode 100644 index 000000000..0f0f6a843 --- /dev/null +++ b/test/rake/test_rake.rb @@ -0,0 +1,39 @@ +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 |
