summaryrefslogtreecommitdiff
path: root/test/rake/test_rake_directory_task.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-15 21:59:37 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-15 21:59:37 +0000
commit9c66bad9f3d522d50d4a45ef8a3a92abbf93229f (patch)
tree8fc1ae219e41bdd711442b1d35149da4f45dfa8a /test/rake/test_rake_directory_task.rb
parentbfc95c6e1639edc909338ef4d20d990caf6f630e (diff)
* lib/rake*: Updated to rake 0.9.3
* test/rake*: ditto * bin/rake: ditto * NEWS: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rake/test_rake_directory_task.rb')
-rw-r--r--test/rake/test_rake_directory_task.rb43
1 files changed, 24 insertions, 19 deletions
diff --git a/test/rake/test_rake_directory_task.rb b/test/rake/test_rake_directory_task.rb
index 6ddb0d28709..d1154f90d5d 100644
--- a/test/rake/test_rake_directory_task.rb
+++ b/test/rake/test_rake_directory_task.rb
@@ -27,26 +27,31 @@ class TestRakeDirectoryTask < Rake::TestCase
if Rake::Win32.windows?
def test_directory_win32
- drive = Dir.pwd
- while drive != File.dirname(drive)
- drive = File.dirname(drive)
- end
- drive = drive[0...-1] if drive[-1] == ?/
-
desc "WIN32 DESC"
- directory File.join(Dir.pwd, 'a/b/c')
- assert_equal FileTask, Task[drive].class if drive[-1] == ?:
- assert_equal FileCreationTask, Task[File.join(Dir.pwd, 'a')].class
- assert_equal FileCreationTask, Task[File.join(Dir.pwd, 'a/b')].class
- assert_equal FileCreationTask, Task[File.join(Dir.pwd, 'a/b/c')].class
- assert_nil Task[drive].comment
- assert_equal "WIN32 DESC", Task[File.join(Dir.pwd, 'a/b/c')].comment
- assert_nil Task[File.join(Dir.pwd, 'a/b')].comment
- verbose(false) {
- Task[File.join(Dir.pwd, 'a/b')].invoke
- }
- assert File.exist?(File.join(Dir.pwd, 'a/b'))
- refute File.exist?(File.join(Dir.pwd, 'a/b/c'))
+ directory 'c:/a/b/c'
+ assert_equal FileTask, Task['c:'].class
+ assert_equal FileCreationTask, Task['c:/a'].class
+ assert_equal FileCreationTask, Task['c:/a/b'].class
+ assert_equal FileCreationTask, Task['c:/a/b/c'].class
+ assert_nil Task['c:/'].comment
+ assert_equal "WIN32 DESC", Task['c:/a/b/c'].comment
+ assert_nil Task['c:/a/b'].comment
end
end
+
+ def test_can_use_blocks
+ runlist = []
+
+ t1 = directory("a/b/c" => :t2) { |t| runlist << t.name }
+ t2 = task(:t2) { |t| runlist << t.name }
+
+ verbose(false) {
+ t1.invoke
+ }
+
+ assert_equal Task["a/b/c"], t1
+ assert_equal FileCreationTask, Task["a/b/c"].class
+ assert_equal ["t2", "a/b/c"], runlist
+ assert File.directory?("a/b/c")
+ end
end