jimweirich-rake 0.8.3.1 → 0.8.3.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +22 -0
- data/README +84 -173
- data/Rakefile +2 -4
- data/doc/command_line_usage.rdoc +102 -0
- data/doc/rakefile.rdoc +4 -4
- data/doc/release_notes/rake-0.8.4.rdoc +125 -0
- data/lib/rake/gempackagetask.rb +0 -6
- data/lib/rake/loaders/makefile.rb +8 -1
- data/lib/rake/packagetask.rb +0 -1
- data/lib/rake/rdoctask.rb +80 -18
- data/lib/rake/testtask.rb +2 -2
- data/lib/rake/win32.rb +7 -4
- data/lib/rake.rb +33 -23
- data/test/data/sample.mf +2 -0
- data/test/rake_test_setup.rb +14 -0
- data/test/session_functional.rb +2 -0
- data/test/test_application.rb +33 -14
- data/test/test_definitions.rb +4 -1
- data/test/test_file_task.rb +20 -16
- data/test/test_filelist.rb +3 -1
- data/test/test_fileutils.rb +24 -8
- data/test/test_invocation_chain.rb +8 -2
- data/test/test_makefile_loader.rb +2 -1
- data/test/test_namespace.rb +30 -11
- data/test/test_package_task.rb +3 -1
- data/test/test_pathmap.rb +3 -2
- data/test/test_rdoc_task.rb +88 -0
- data/test/test_require.rb +3 -1
- data/test/test_rules.rb +6 -4
- data/test/test_task_manager.rb +4 -1
- data/test/test_tasks.rb +6 -3
- data/test/test_test_task.rb +2 -0
- data/test/test_top_level_functions.rb +4 -2
- data/test/test_win32.rb +29 -14
- metadata +8 -2
data/test/test_fileutils.rb
CHANGED
@@ -5,9 +5,11 @@ require 'test/unit'
|
|
5
5
|
require 'test/filecreation'
|
6
6
|
require 'fileutils'
|
7
7
|
require 'stringio'
|
8
|
+
require 'test/rake_test_setup'
|
8
9
|
|
9
10
|
class TestFileUtils < Test::Unit::TestCase
|
10
11
|
include FileCreation
|
12
|
+
include TestMethods
|
11
13
|
|
12
14
|
def setup
|
13
15
|
File.chmod(0750,"test/shellcommand.rb")
|
@@ -81,7 +83,7 @@ class TestFileUtils < Test::Unit::TestCase
|
|
81
83
|
def test_safe_ln_fails_on_script_error
|
82
84
|
FileUtils::LN_SUPPORTED[0] = true
|
83
85
|
c = BadLink.new(ScriptError)
|
84
|
-
|
86
|
+
assert_exception(ScriptError) do c.safe_ln "a", "b" end
|
85
87
|
end
|
86
88
|
|
87
89
|
def test_verbose
|
@@ -114,8 +116,8 @@ class TestFileUtils < Test::Unit::TestCase
|
|
114
116
|
|
115
117
|
def test_fileutils_methods_dont_leak
|
116
118
|
obj = Object.new
|
117
|
-
|
118
|
-
|
119
|
+
assert_exception(NoMethodError) { obj.copy } # from FileUtils
|
120
|
+
assert_exception(NoMethodError) { obj.ruby } # from RubyFileUtils
|
119
121
|
end
|
120
122
|
|
121
123
|
def test_sh
|
@@ -123,21 +125,35 @@ class TestFileUtils < Test::Unit::TestCase
|
|
123
125
|
assert true, "should not fail"
|
124
126
|
end
|
125
127
|
|
128
|
+
# If the :sh method is invoked directly from a test unit instance
|
129
|
+
# (under mini/test), the mini/test version of fail is invoked rather
|
130
|
+
# than the kernel version of fail. So we run :sh from within a
|
131
|
+
# non-test class to avoid the problem.
|
132
|
+
class Sh
|
133
|
+
include FileUtils
|
134
|
+
def run(*args)
|
135
|
+
sh(*args)
|
136
|
+
end
|
137
|
+
def self.run(*args)
|
138
|
+
new.run(*args)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
126
142
|
def test_sh_multiple_arguments
|
127
143
|
ENV['RAKE_TEST_SH'] = 'someval'
|
128
144
|
expanded = windows? ? '%RAKE_TEST_SH%' : '$RAKE_TEST_SH'
|
129
145
|
# This one gets expanded by the shell
|
130
146
|
verbose(false) { sh %{ruby test/check_expansion.rb #{expanded} someval} }
|
131
147
|
assert true, "should not fail"
|
132
|
-
|
148
|
+
assert_exception(RuntimeError) {
|
133
149
|
# This one does not get expanded
|
134
|
-
verbose(false) {
|
150
|
+
verbose(false) { Sh.run 'ruby', 'test/check_expansion.rb', expanded, 'someval' }
|
135
151
|
}
|
136
152
|
end
|
137
153
|
|
138
154
|
def test_sh_failure
|
139
|
-
|
140
|
-
verbose(false) {
|
155
|
+
assert_exception(RuntimeError) {
|
156
|
+
verbose(false) { Sh.run %{ruby test/shellcommand.rb 1} }
|
141
157
|
}
|
142
158
|
end
|
143
159
|
|
@@ -164,7 +180,7 @@ class TestFileUtils < Test::Unit::TestCase
|
|
164
180
|
end
|
165
181
|
|
166
182
|
def test_sh_bad_option
|
167
|
-
ex =
|
183
|
+
ex = assert_exception(ArgumentError) {
|
168
184
|
verbose(false) { sh %{test/shellcommand.rb}, :bad_option=>true }
|
169
185
|
}
|
170
186
|
assert_match(/bad_option/, ex.message)
|
@@ -2,9 +2,11 @@
|
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'rake'
|
5
|
+
require 'test/rake_test_setup'
|
5
6
|
|
6
7
|
######################################################################
|
7
8
|
class TestAnEmptyInvocationChain < Test::Unit::TestCase
|
9
|
+
include TestMethods
|
8
10
|
|
9
11
|
def setup
|
10
12
|
@empty = Rake::InvocationChain::EMPTY
|
@@ -23,6 +25,8 @@ end
|
|
23
25
|
|
24
26
|
######################################################################
|
25
27
|
class TestAnInvocationChainWithOneMember < Test::Unit::TestCase
|
28
|
+
include TestMethods
|
29
|
+
|
26
30
|
def setup
|
27
31
|
@empty = Rake::InvocationChain::EMPTY
|
28
32
|
@first_member = "A"
|
@@ -34,7 +38,7 @@ class TestAnInvocationChainWithOneMember < Test::Unit::TestCase
|
|
34
38
|
end
|
35
39
|
|
36
40
|
def test_should_fail_when_adding_original_member
|
37
|
-
ex =
|
41
|
+
ex = assert_exception RuntimeError do
|
38
42
|
@chain.append(@first_member)
|
39
43
|
end
|
40
44
|
assert_match(/circular +dependency/i, ex.message)
|
@@ -49,6 +53,8 @@ end
|
|
49
53
|
|
50
54
|
######################################################################
|
51
55
|
class TestAnInvocationChainWithMultipleMember < Test::Unit::TestCase
|
56
|
+
include TestMethods
|
57
|
+
|
52
58
|
def setup
|
53
59
|
@first_member = "A"
|
54
60
|
@second_member = "B"
|
@@ -65,7 +71,7 @@ class TestAnInvocationChainWithMultipleMember < Test::Unit::TestCase
|
|
65
71
|
end
|
66
72
|
|
67
73
|
def test_should_fail_when_adding_original_member
|
68
|
-
ex =
|
74
|
+
ex = assert_exception RuntimeError do
|
69
75
|
@chain.append(@first_member)
|
70
76
|
end
|
71
77
|
assert_match(/A.*=>.*B.*=>.*A/, ex.message)
|
@@ -20,6 +20,7 @@ class TestMakefileLoader < Test::Unit::TestCase
|
|
20
20
|
assert_equal %w(d1 d2).sort, Task['d'].prerequisites.sort
|
21
21
|
assert_equal %w(e1 f1).sort, Task['e'].prerequisites.sort
|
22
22
|
assert_equal %w(e1 f1).sort, Task['f'].prerequisites.sort
|
23
|
-
assert_equal
|
23
|
+
assert_equal ["g1", "g 2", "g 3", "g4"].sort, Task['g 0'].prerequisites.sort
|
24
|
+
assert_equal 7, Task.tasks.size
|
24
25
|
end
|
25
26
|
end
|
data/test/test_namespace.rb
CHANGED
@@ -9,28 +9,47 @@ end
|
|
9
9
|
require 'test/unit'
|
10
10
|
require 'flexmock/test_unit'
|
11
11
|
require 'rake'
|
12
|
+
require 'test/rake_test_setup'
|
12
13
|
|
13
14
|
class TestNameSpace < Test::Unit::TestCase
|
15
|
+
include TestMethods
|
16
|
+
|
17
|
+
class TM
|
18
|
+
include Rake::TaskManager
|
19
|
+
end
|
14
20
|
|
15
21
|
def test_namespace_creation
|
16
|
-
mgr =
|
22
|
+
mgr = TM.new
|
17
23
|
ns = Rake::NameSpace.new(mgr, [])
|
18
24
|
assert_not_nil ns
|
19
25
|
end
|
20
26
|
|
21
27
|
def test_namespace_lookup
|
22
|
-
mgr =
|
23
|
-
mgr.
|
24
|
-
|
25
|
-
|
26
|
-
|
28
|
+
mgr = TM.new
|
29
|
+
ns = mgr.in_namespace("n") do
|
30
|
+
mgr.define_task(Rake::Task, "t")
|
31
|
+
end
|
32
|
+
|
33
|
+
assert_not_nil ns["t"]
|
34
|
+
assert_equal mgr["n:t"], ns["t"]
|
27
35
|
end
|
28
36
|
|
29
37
|
def test_namespace_reports_tasks_it_owns
|
30
|
-
mgr =
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
38
|
+
mgr = TM.new
|
39
|
+
nns = nil
|
40
|
+
ns = mgr.in_namespace("n") do
|
41
|
+
mgr.define_task(Rake::Task, :x)
|
42
|
+
mgr.define_task(Rake::Task, :y)
|
43
|
+
nns = mgr.in_namespace("nn") do
|
44
|
+
mgr.define_task(Rake::Task, :z)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
mgr.in_namespace("m") do
|
48
|
+
mgr.define_task(Rake::Task, :x)
|
49
|
+
end
|
50
|
+
|
51
|
+
assert_equal ["n:nn:z", "n:x", "n:y"],
|
52
|
+
ns.tasks.map { |tsk| tsk.name }
|
53
|
+
assert_equal ["n:nn:z"], nns.tasks.map {|t| t.name}
|
35
54
|
end
|
36
55
|
end
|
data/test/test_package_task.rb
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'rake/packagetask'
|
5
|
+
require 'test/rake_test_setup'
|
5
6
|
|
6
7
|
class TestPackageTask < Test::Unit::TestCase
|
7
8
|
include Rake
|
9
|
+
include TestMethods
|
8
10
|
|
9
11
|
def test_create
|
10
12
|
pkg = Rake::PackageTask.new("pkgr", "1.2.3") { |p|
|
@@ -40,7 +42,7 @@ class TestPackageTask < Test::Unit::TestCase
|
|
40
42
|
end
|
41
43
|
|
42
44
|
def test_missing_version
|
43
|
-
|
45
|
+
assert_exception(RuntimeError) {
|
44
46
|
pkg = Rake::PackageTask.new("pkgr") { |p| }
|
45
47
|
}
|
46
48
|
end
|
data/test/test_pathmap.rb
CHANGED
@@ -5,6 +5,7 @@ require 'rake'
|
|
5
5
|
|
6
6
|
# ====================================================================
|
7
7
|
class TestPathMap < Test::Unit::TestCase
|
8
|
+
include TestMethods
|
8
9
|
|
9
10
|
def test_returns_self_with_no_args
|
10
11
|
assert_equal "abc.rb", "abc.rb".pathmap
|
@@ -86,7 +87,7 @@ class TestPathMap < Test::Unit::TestCase
|
|
86
87
|
end
|
87
88
|
|
88
89
|
def test_undefined_percent_causes_error
|
89
|
-
ex =
|
90
|
+
ex = assert_exception(ArgumentError) {
|
90
91
|
"dir/abc.rb".pathmap("%z")
|
91
92
|
}
|
92
93
|
end
|
@@ -130,7 +131,7 @@ class TestPathMap < Test::Unit::TestCase
|
|
130
131
|
end
|
131
132
|
|
132
133
|
def test_pattern_with_invalid_operator
|
133
|
-
ex =
|
134
|
+
ex = assert_exception(ArgumentError) do
|
134
135
|
"abc.xyz".pathmap("%{src,bin}z")
|
135
136
|
end
|
136
137
|
assert_match(/unknown.*pathmap.*spec.*z/i, ex.message)
|
@@ -0,0 +1,88 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
require 'rake/rdoctask'
|
5
|
+
require 'test/rake_test_setup'
|
6
|
+
|
7
|
+
class TestRDocTask < Test::Unit::TestCase
|
8
|
+
include Rake
|
9
|
+
include TestMethods
|
10
|
+
|
11
|
+
def setup
|
12
|
+
Task.clear
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_tasks_creation
|
16
|
+
Rake::RDocTask.new
|
17
|
+
assert Task[:rdoc]
|
18
|
+
assert Task[:clobber_rdoc]
|
19
|
+
assert Task[:rerdoc]
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_tasks_creation_with_custom_name_symbol
|
23
|
+
rd = Rake::RDocTask.new(:rdoc_dev)
|
24
|
+
assert Task[:rdoc_dev]
|
25
|
+
assert Task[:clobber_rdoc_dev]
|
26
|
+
assert Task[:rerdoc_dev]
|
27
|
+
assert_equal :rdoc_dev, rd.name
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_tasks_creation_with_custom_name_string
|
31
|
+
rd = Rake::RDocTask.new("rdoc_dev")
|
32
|
+
assert Task[:rdoc_dev]
|
33
|
+
assert Task[:clobber_rdoc_dev]
|
34
|
+
assert Task[:rerdoc_dev]
|
35
|
+
assert_equal "rdoc_dev", rd.name
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_tasks_creation_with_custom_name_hash
|
39
|
+
options = { :rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", :rerdoc => "rdoc:force" }
|
40
|
+
rd = Rake::RDocTask.new(options)
|
41
|
+
assert Task[:"rdoc"]
|
42
|
+
assert Task[:"rdoc:clean"]
|
43
|
+
assert Task[:"rdoc:force"]
|
44
|
+
assert_raises(RuntimeError) { Task[:clobber_rdoc] }
|
45
|
+
assert_equal options, rd.name
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_tasks_creation_with_custom_name_hash_will_use_default_if_an_option_isnt_given
|
49
|
+
rd = Rake::RDocTask.new(:clobber_rdoc => "rdoc:clean")
|
50
|
+
assert Task[:rdoc]
|
51
|
+
assert Task[:"rdoc:clean"]
|
52
|
+
assert Task[:rerdoc]
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_tasks_creation_with_custom_name_hash_raises_exception_if_invalid_option_given
|
56
|
+
assert_raises(ArgumentError) do
|
57
|
+
Rake::RDocTask.new(:foo => "bar")
|
58
|
+
end
|
59
|
+
|
60
|
+
begin
|
61
|
+
Rake::RDocTask.new(:foo => "bar")
|
62
|
+
rescue ArgumentError => e
|
63
|
+
assert_match(/foo/, e.message)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_inline_source_is_enabled_by_default
|
68
|
+
rd = Rake::RDocTask.new
|
69
|
+
assert rd.option_list.include?('--inline-source')
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_inline_source_option_is_only_appended_if_option_not_already_given
|
73
|
+
rd = Rake::RDocTask.new
|
74
|
+
rd.options << '--inline-source'
|
75
|
+
assert_equal 1, rd.option_list.grep('--inline-source').size
|
76
|
+
|
77
|
+
rd = Rake::RDocTask.new
|
78
|
+
rd.options << '-S'
|
79
|
+
assert_equal 1, rd.option_list.grep('-S').size
|
80
|
+
assert_equal 0, rd.option_list.grep('--inline-source').size
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_inline_source_option_can_be_disabled
|
84
|
+
rd = Rake::RDocTask.new
|
85
|
+
rd.inline_source = false
|
86
|
+
assert !rd.option_list.include?('--inline-source')
|
87
|
+
end
|
88
|
+
end
|
data/test/test_require.rb
CHANGED
@@ -2,9 +2,11 @@
|
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'rake'
|
5
|
+
require 'test/rake_test_setup'
|
5
6
|
|
6
7
|
# ====================================================================
|
7
8
|
class TestRequire < Test::Unit::TestCase
|
9
|
+
include TestMethods
|
8
10
|
|
9
11
|
def test_can_load_rake_library
|
10
12
|
app = Rake::Application.new
|
@@ -22,7 +24,7 @@ class TestRequire < Test::Unit::TestCase
|
|
22
24
|
|
23
25
|
def test_throws_error_if_library_not_found
|
24
26
|
app = Rake::Application.new
|
25
|
-
ex =
|
27
|
+
ex = assert_exception(LoadError) {
|
26
28
|
assert app.instance_eval {
|
27
29
|
rake_require("testx", ['test/data/rakelib'], [])
|
28
30
|
}
|
data/test/test_rules.rb
CHANGED
@@ -4,11 +4,13 @@ require 'test/unit'
|
|
4
4
|
require 'fileutils'
|
5
5
|
require 'rake'
|
6
6
|
require 'test/filecreation'
|
7
|
+
require 'test/rake_test_setup'
|
7
8
|
|
8
9
|
######################################################################
|
9
10
|
class TestRules < Test::Unit::TestCase
|
10
11
|
include Rake
|
11
12
|
include FileCreation
|
13
|
+
include TestMethods
|
12
14
|
|
13
15
|
SRCFILE = "testdata/abc.c"
|
14
16
|
SRCFILE2 = "testdata/xyz.c"
|
@@ -190,8 +192,8 @@ class TestRules < Test::Unit::TestCase
|
|
190
192
|
rule '.o' => ['.c'] do |t|
|
191
193
|
@runs << t.name
|
192
194
|
end
|
193
|
-
|
194
|
-
|
195
|
+
assert_exception(RuntimeError) { Task['testdata/x.obj'].invoke }
|
196
|
+
assert_exception(RuntimeError) { Task['testdata/x.xyo'].invoke }
|
195
197
|
end
|
196
198
|
|
197
199
|
def test_rule_rebuilds_obj_when_source_is_newer
|
@@ -332,7 +334,7 @@ class TestRules < Test::Unit::TestCase
|
|
332
334
|
rule ".#{letter}" => ".#{prev}" do |t| puts "#{t.name}" end
|
333
335
|
prev = letter
|
334
336
|
end
|
335
|
-
ex =
|
337
|
+
ex = assert_exception(Rake::RuleRecursionOverflowError) {
|
336
338
|
Task["testdata/a.z"].invoke
|
337
339
|
}
|
338
340
|
assert_match(/a\.z => testdata\/a.y/, ex.message)
|
@@ -340,7 +342,7 @@ class TestRules < Test::Unit::TestCase
|
|
340
342
|
|
341
343
|
def test_rules_with_bad_dependents_will_fail
|
342
344
|
rule "a" => [ 1 ] do |t| puts t.name end
|
343
|
-
|
345
|
+
assert_exception(RuntimeError) do Task['a'].invoke end
|
344
346
|
end
|
345
347
|
|
346
348
|
end
|
data/test/test_task_manager.rb
CHANGED
@@ -2,12 +2,15 @@
|
|
2
2
|
|
3
3
|
require 'test/unit'
|
4
4
|
require 'rake'
|
5
|
+
require 'test/rake_test_setup'
|
5
6
|
|
6
7
|
class TaskManager
|
7
8
|
include Rake::TaskManager
|
8
9
|
end
|
9
10
|
|
10
11
|
class TestTaskManager < Test::Unit::TestCase
|
12
|
+
include TestMethods
|
13
|
+
|
11
14
|
def setup
|
12
15
|
@tm = TaskManager.new
|
13
16
|
end
|
@@ -68,7 +71,7 @@ class TestTaskManager < Test::Unit::TestCase
|
|
68
71
|
end
|
69
72
|
|
70
73
|
def test_name_lookup_with_nonexistent_task
|
71
|
-
|
74
|
+
assert_exception(RuntimeError) {
|
72
75
|
t = @tm["DOES NOT EXIST"]
|
73
76
|
}
|
74
77
|
end
|
data/test/test_tasks.rb
CHANGED
@@ -5,11 +5,13 @@ require 'fileutils'
|
|
5
5
|
require 'rake'
|
6
6
|
require 'test/filecreation'
|
7
7
|
require 'test/capture_stdout'
|
8
|
+
require 'test/rake_test_setup'
|
8
9
|
|
9
10
|
######################################################################
|
10
11
|
class TestTask < Test::Unit::TestCase
|
11
12
|
include CaptureStdout
|
12
13
|
include Rake
|
14
|
+
include TestMethods
|
13
15
|
|
14
16
|
def setup
|
15
17
|
Task.clear
|
@@ -48,7 +50,7 @@ class TestTask < Test::Unit::TestCase
|
|
48
50
|
t2 = task(:t2 => [:t1]) { |t| runlist << t.name }
|
49
51
|
assert_equal ["t2"], t1.prerequisites
|
50
52
|
assert_equal ["t1"], t2.prerequisites
|
51
|
-
ex =
|
53
|
+
ex = assert_exception RuntimeError do
|
52
54
|
t1.invoke
|
53
55
|
end
|
54
56
|
assert_match(/circular dependency/i, ex.message)
|
@@ -121,7 +123,7 @@ class TestTask < Test::Unit::TestCase
|
|
121
123
|
def test_find
|
122
124
|
task :tfind
|
123
125
|
assert_equal "tfind", Task[:tfind].name
|
124
|
-
ex =
|
126
|
+
ex = assert_exception(RuntimeError) { Task[:leaves] }
|
125
127
|
assert_equal "Don't know how to build task 'leaves'", ex.message
|
126
128
|
end
|
127
129
|
|
@@ -218,6 +220,7 @@ end
|
|
218
220
|
class TestTaskWithArguments < Test::Unit::TestCase
|
219
221
|
include CaptureStdout
|
220
222
|
include Rake
|
223
|
+
include TestMethods
|
221
224
|
|
222
225
|
def setup
|
223
226
|
Task.clear
|
@@ -255,7 +258,7 @@ class TestTaskWithArguments < Test::Unit::TestCase
|
|
255
258
|
end
|
256
259
|
|
257
260
|
def test_illegal_keys_in_task_name_hash
|
258
|
-
|
261
|
+
assert_exception RuntimeError do
|
259
262
|
t = task(:t, :x, :y => 1, :needs => [:pre])
|
260
263
|
end
|
261
264
|
end
|
data/test/test_test_task.rb
CHANGED
@@ -7,12 +7,14 @@ rescue LoadError
|
|
7
7
|
end
|
8
8
|
|
9
9
|
require 'test/unit'
|
10
|
+
require 'flexmock/test_unit'
|
10
11
|
require 'test/capture_stdout'
|
12
|
+
require 'test/rake_test_setup'
|
11
13
|
require 'rake'
|
12
|
-
require 'flexmock/test_unit'
|
13
14
|
|
14
15
|
class TestTopLevelFunctions < Test::Unit::TestCase
|
15
16
|
include CaptureStdout
|
17
|
+
include TestMethods
|
16
18
|
|
17
19
|
def setup
|
18
20
|
super
|
@@ -79,6 +81,6 @@ class TestTopLevelFunctions < Test::Unit::TestCase
|
|
79
81
|
end
|
80
82
|
|
81
83
|
def test_missing_other_constant
|
82
|
-
|
84
|
+
assert_exception(NameError) do Object.const_missing(:Xyz) end
|
83
85
|
end
|
84
86
|
end
|
data/test/test_win32.rb
CHANGED
@@ -8,47 +8,62 @@ require 'rake'
|
|
8
8
|
|
9
9
|
class TestWin32 < Test::Unit::TestCase
|
10
10
|
include InEnvironment
|
11
|
+
include TestMethods
|
11
12
|
|
12
13
|
Win32 = Rake::Win32
|
13
|
-
|
14
|
-
def
|
15
|
-
in_environment('RAKE_SYSTEM' => nil, '
|
16
|
-
assert_equal "/
|
14
|
+
|
15
|
+
def test_win32_system_dir_uses_home_if_defined
|
16
|
+
in_environment('RAKE_SYSTEM' => nil, 'HOME' => 'C:\\HP') do
|
17
|
+
assert_equal "C:/HP/Rake", Win32.win32_system_dir
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
20
|
-
def
|
21
|
+
def test_win32_system_dir_uses_homedrive_homepath_when_no_home_defined
|
21
22
|
in_environment(
|
22
23
|
'RAKE_SYSTEM' => nil,
|
23
|
-
'
|
24
|
+
'HOME' => nil,
|
24
25
|
'HOMEDRIVE' => "C:",
|
25
|
-
|
26
|
+
'HOMEPATH' => "\\HP"
|
26
27
|
) do
|
27
28
|
assert_equal "C:/HP/Rake", Win32.win32_system_dir
|
28
29
|
end
|
29
30
|
end
|
30
31
|
|
31
|
-
def
|
32
|
+
def test_win32_system_dir_uses_appdata_when_no_home_or_home_combo
|
32
33
|
in_environment(
|
33
34
|
'RAKE_SYSTEM' => nil,
|
34
|
-
'
|
35
|
+
'HOME' => nil,
|
35
36
|
'HOMEDRIVE' => nil,
|
36
|
-
|
37
|
-
|
37
|
+
'HOMEPATH' => nil,
|
38
|
+
'APPDATA' => "C:\\Documents and Settings\\HP\\Application Data"
|
38
39
|
) do
|
39
|
-
assert_equal "/
|
40
|
+
assert_equal "C:/Documents and Settings/HP/Application Data/Rake", Win32.win32_system_dir
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
43
|
-
def
|
44
|
+
def test_win32_system_dir_fallback_to_userprofile_otherwise
|
44
45
|
in_environment(
|
45
46
|
'RAKE_SYSTEM' => nil,
|
47
|
+
'HOME' => nil,
|
48
|
+
'HOMEDRIVE' => nil,
|
49
|
+
'HOMEPATH' => nil,
|
46
50
|
'APPDATA' => nil,
|
51
|
+
'USERPROFILE' => "C:\\Documents and Settings\\HP"
|
52
|
+
) do
|
53
|
+
assert_equal "C:/Documents and Settings/HP/Rake", Win32.win32_system_dir
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_win32_system_dir_nil_of_no_env_vars
|
58
|
+
in_environment(
|
59
|
+
'RAKE_SYSTEM' => nil,
|
60
|
+
'HOME' => nil,
|
47
61
|
'HOMEDRIVE' => nil,
|
48
62
|
"HOMEPATH" => nil,
|
63
|
+
'APPDATA' => nil,
|
49
64
|
"USERPROFILE" => nil
|
50
65
|
) do
|
51
|
-
|
66
|
+
assert_exception(Rake::Win32::Win32HomeError) do
|
52
67
|
Win32.win32_system_dir
|
53
68
|
end
|
54
69
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jimweirich-rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.3.
|
4
|
+
version: 0.8.3.99
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Weirich
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-10-31 21:00:00 -07:00
|
13
13
|
default_executable: rake
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -24,6 +24,7 @@ extra_rdoc_files:
|
|
24
24
|
- MIT-LICENSE
|
25
25
|
- TODO
|
26
26
|
- CHANGES
|
27
|
+
- doc/command_line_usage.rdoc
|
27
28
|
- doc/glossary.rdoc
|
28
29
|
- doc/proto_rake.rdoc
|
29
30
|
- doc/rakefile.rdoc
|
@@ -41,12 +42,14 @@ extra_rdoc_files:
|
|
41
42
|
- doc/release_notes/rake-0.8.0.rdoc
|
42
43
|
- doc/release_notes/rake-0.8.2.rdoc
|
43
44
|
- doc/release_notes/rake-0.8.3.rdoc
|
45
|
+
- doc/release_notes/rake-0.8.4.rdoc
|
44
46
|
files:
|
45
47
|
- install.rb
|
46
48
|
- CHANGES
|
47
49
|
- MIT-LICENSE
|
48
50
|
- Rakefile
|
49
51
|
- README
|
52
|
+
- TAGS
|
50
53
|
- TODO
|
51
54
|
- bin/rake
|
52
55
|
- lib/rake/classic_namespace.rb
|
@@ -98,6 +101,7 @@ files:
|
|
98
101
|
- test/test_package_task.rb
|
99
102
|
- test/test_pathmap.rb
|
100
103
|
- test/test_rake.rb
|
104
|
+
- test/test_rdoc_task.rb
|
101
105
|
- test/test_require.rb
|
102
106
|
- test/test_rules.rb
|
103
107
|
- test/test_task_arguments.rb
|
@@ -119,6 +123,7 @@ files:
|
|
119
123
|
- test/data/statusreturn/Rakefile
|
120
124
|
- test/data/unittest/Rakefile
|
121
125
|
- test/data/unittest/subdir
|
126
|
+
- doc/command_line_usage.rdoc
|
122
127
|
- doc/example
|
123
128
|
- doc/example/a.c
|
124
129
|
- doc/example/b.c
|
@@ -145,6 +150,7 @@ files:
|
|
145
150
|
- doc/release_notes/rake-0.8.0.rdoc
|
146
151
|
- doc/release_notes/rake-0.8.2.rdoc
|
147
152
|
- doc/release_notes/rake-0.8.3.rdoc
|
153
|
+
- doc/release_notes/rake-0.8.4.rdoc
|
148
154
|
has_rdoc: true
|
149
155
|
homepage: http://rake.rubyforge.org
|
150
156
|
post_install_message:
|