Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 46 lines (37 sloc) 1.203 kb
2d2859e Eric Hodel Break multi-testcase files into single-testcase files for autotest
drbrain authored
1 require File.expand_path('../helper', __FILE__)
2 require 'fileutils'
3
4 class TestRakeDirectoryTask < Rake::TestCase
5 include Rake
6
8f02e23 Eric Hodel Rake tests now create all files in a temporary directory
drbrain authored
7 def test_directory
8 desc "DESC"
2d2859e Eric Hodel Break multi-testcase files into single-testcase files for autotest
drbrain authored
9
8f02e23 Eric Hodel Rake tests now create all files in a temporary directory
drbrain authored
10 directory "a/b/c"
2d2859e Eric Hodel Break multi-testcase files into single-testcase files for autotest
drbrain authored
11
8f02e23 Eric Hodel Rake tests now create all files in a temporary directory
drbrain authored
12 assert_equal FileCreationTask, Task["a"].class
13 assert_equal FileCreationTask, Task["a/b"].class
14 assert_equal FileCreationTask, Task["a/b/c"].class
2d2859e Eric Hodel Break multi-testcase files into single-testcase files for autotest
drbrain authored
15
8f02e23 Eric Hodel Rake tests now create all files in a temporary directory
drbrain authored
16 assert_nil Task["a"].comment
17 assert_nil Task["a/b"].comment
18 assert_equal "DESC", Task["a/b/c"].comment
2d2859e Eric Hodel Break multi-testcase files into single-testcase files for autotest
drbrain authored
19
20 verbose(false) {
8f02e23 Eric Hodel Rake tests now create all files in a temporary directory
drbrain authored
21 Task['a/b'].invoke
2d2859e Eric Hodel Break multi-testcase files into single-testcase files for autotest
drbrain authored
22 }
8f02e23 Eric Hodel Rake tests now create all files in a temporary directory
drbrain authored
23
24 assert File.exist?("a/b")
25 refute File.exist?("a/b/c")
2d2859e Eric Hodel Break multi-testcase files into single-testcase files for autotest
drbrain authored
26 end
27
28 if Rake::Win32.windows?
29 def test_directory_win32
30 desc "WIN32 DESC"
8f02e23 Eric Hodel Rake tests now create all files in a temporary directory
drbrain authored
31 directory 'c:/a/b/c'
32 assert_equal FileCreationTask, Task['c:'].class
33 assert_equal FileCreationTask, Task['c:/a'].class
34 assert_equal FileCreationTask, Task['c:/a/b/c'].class
35 assert_nil Task['c:/'].comment
36 assert_equal "WIN32 DESC", Task['c:/a/b/c'].comment
37 assert_nil Task['c:/a/b'].comment
38 verbose(false) {
39 Task['c:/a/b'].invoke
40 }
41 assert File.exist?('c:/a/b')
42 refute File.exist?('c:/a/b/c')
2d2859e Eric Hodel Break multi-testcase files into single-testcase files for autotest
drbrain authored
43 end
44 end
45 end
Something went wrong with that request. Please try again.