mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rake: Import Rake 0.9.2
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
3fbc9440fe
commit
d001539a05
119 changed files with 6777 additions and 4774 deletions
45
test/rake/test_rake_directory_task.rb
Normal file
45
test/rake/test_rake_directory_task.rb
Normal file
|
@ -0,0 +1,45 @@
|
|||
require File.expand_path('../helper', __FILE__)
|
||||
require 'fileutils'
|
||||
|
||||
class TestRakeDirectoryTask < Rake::TestCase
|
||||
include Rake
|
||||
|
||||
def test_directory
|
||||
desc "DESC"
|
||||
|
||||
directory "a/b/c"
|
||||
|
||||
assert_equal FileCreationTask, Task["a"].class
|
||||
assert_equal FileCreationTask, Task["a/b"].class
|
||||
assert_equal FileCreationTask, Task["a/b/c"].class
|
||||
|
||||
assert_nil Task["a"].comment
|
||||
assert_nil Task["a/b"].comment
|
||||
assert_equal "DESC", Task["a/b/c"].comment
|
||||
|
||||
verbose(false) {
|
||||
Task['a/b'].invoke
|
||||
}
|
||||
|
||||
assert File.exist?("a/b")
|
||||
refute File.exist?("a/b/c")
|
||||
end
|
||||
|
||||
if Rake::Win32.windows?
|
||||
def test_directory_win32
|
||||
desc "WIN32 DESC"
|
||||
directory 'c:/a/b/c'
|
||||
assert_equal FileCreationTask, Task['c:'].class
|
||||
assert_equal FileCreationTask, Task['c:/a'].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
|
||||
verbose(false) {
|
||||
Task['c:/a/b'].invoke
|
||||
}
|
||||
assert File.exist?('c:/a/b')
|
||||
refute File.exist?('c:/a/b/c')
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue