rake 0.9.2 → 13.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.rdoc +43 -0
  3. data/Gemfile +10 -0
  4. data/History.rdoc +2386 -0
  5. data/MIT-LICENSE +1 -1
  6. data/README.rdoc +64 -109
  7. data/Rakefile +22 -386
  8. data/bin/bundle +105 -0
  9. data/bin/console +7 -0
  10. data/bin/rake +20 -23
  11. data/bin/rdoc +29 -0
  12. data/bin/rubocop +29 -0
  13. data/bin/setup +6 -0
  14. data/doc/command_line_usage.rdoc +65 -21
  15. data/doc/glossary.rdoc +40 -49
  16. data/doc/jamis.rb +1 -0
  17. data/doc/rake.1 +156 -0
  18. data/doc/rakefile.rdoc +127 -62
  19. data/exe/rake +27 -0
  20. data/lib/rake.rb +37 -31
  21. data/lib/rake/application.rb +507 -272
  22. data/lib/rake/backtrace.rb +24 -0
  23. data/lib/rake/clean.rb +55 -8
  24. data/lib/rake/cloneable.rb +11 -19
  25. data/lib/rake/cpu_counter.rb +107 -0
  26. data/lib/rake/default_loader.rb +5 -0
  27. data/lib/rake/dsl_definition.rb +74 -46
  28. data/lib/rake/early_time.rb +5 -1
  29. data/lib/rake/ext/core.rb +5 -6
  30. data/lib/rake/ext/string.rb +61 -52
  31. data/lib/rake/file_creation_task.rb +4 -3
  32. data/lib/rake/file_list.rb +81 -49
  33. data/lib/rake/file_task.rb +15 -8
  34. data/lib/rake/file_utils.rb +69 -47
  35. data/lib/rake/file_utils_ext.rb +18 -26
  36. data/lib/rake/invocation_chain.rb +25 -19
  37. data/lib/rake/invocation_exception_mixin.rb +1 -0
  38. data/lib/rake/late_time.rb +18 -0
  39. data/lib/rake/linked_list.rb +112 -0
  40. data/lib/rake/loaders/makefile.rb +23 -9
  41. data/lib/rake/multi_task.rb +4 -6
  42. data/lib/rake/name_space.rb +36 -23
  43. data/lib/rake/packagetask.rb +71 -34
  44. data/lib/rake/phony.rb +16 -0
  45. data/lib/rake/private_reader.rb +21 -0
  46. data/lib/rake/promise.rb +100 -0
  47. data/lib/rake/pseudo_status.rb +8 -2
  48. data/lib/rake/rake_module.rb +41 -3
  49. data/lib/rake/rake_test_loader.rb +21 -7
  50. data/lib/rake/rule_recursion_overflow_error.rb +2 -2
  51. data/lib/rake/scope.rb +43 -0
  52. data/lib/rake/task.rb +186 -79
  53. data/lib/rake/task_argument_error.rb +1 -0
  54. data/lib/rake/task_arguments.rb +50 -15
  55. data/lib/rake/task_manager.rb +89 -65
  56. data/lib/rake/tasklib.rb +2 -12
  57. data/lib/rake/testtask.rb +61 -63
  58. data/lib/rake/thread_history_display.rb +49 -0
  59. data/lib/rake/thread_pool.rb +163 -0
  60. data/lib/rake/trace_output.rb +23 -0
  61. data/lib/rake/version.rb +7 -7
  62. data/lib/rake/win32.rb +14 -18
  63. data/rake.gemspec +43 -0
  64. metadata +82 -221
  65. data/.gemtest +0 -0
  66. data/CHANGES +0 -509
  67. data/RRR +0 -9
  68. data/TODO +0 -20
  69. data/doc/rake.1.gz +0 -0
  70. data/doc/release_notes/rake-0.4.14.rdoc +0 -23
  71. data/doc/release_notes/rake-0.4.15.rdoc +0 -35
  72. data/doc/release_notes/rake-0.5.0.rdoc +0 -53
  73. data/doc/release_notes/rake-0.5.3.rdoc +0 -78
  74. data/doc/release_notes/rake-0.5.4.rdoc +0 -46
  75. data/doc/release_notes/rake-0.6.0.rdoc +0 -141
  76. data/doc/release_notes/rake-0.7.0.rdoc +0 -119
  77. data/doc/release_notes/rake-0.7.1.rdoc +0 -59
  78. data/doc/release_notes/rake-0.7.2.rdoc +0 -121
  79. data/doc/release_notes/rake-0.7.3.rdoc +0 -47
  80. data/doc/release_notes/rake-0.8.0.rdoc +0 -114
  81. data/doc/release_notes/rake-0.8.2.rdoc +0 -165
  82. data/doc/release_notes/rake-0.8.3.rdoc +0 -112
  83. data/doc/release_notes/rake-0.8.4.rdoc +0 -147
  84. data/doc/release_notes/rake-0.8.5.rdoc +0 -53
  85. data/doc/release_notes/rake-0.8.6.rdoc +0 -55
  86. data/doc/release_notes/rake-0.8.7.rdoc +0 -55
  87. data/doc/release_notes/rake-0.9.0.rdoc +0 -112
  88. data/doc/release_notes/rake-0.9.1.rdoc +0 -52
  89. data/doc/release_notes/rake-0.9.2.rdoc +0 -49
  90. data/install.rb +0 -90
  91. data/lib/rake/alt_system.rb +0 -109
  92. data/lib/rake/classic_namespace.rb +0 -9
  93. data/lib/rake/contrib/compositepublisher.rb +0 -21
  94. data/lib/rake/contrib/ftptools.rb +0 -150
  95. data/lib/rake/contrib/publisher.rb +0 -69
  96. data/lib/rake/contrib/rubyforgepublisher.rb +0 -16
  97. data/lib/rake/contrib/sshpublisher.rb +0 -45
  98. data/lib/rake/contrib/sys.rb +0 -191
  99. data/lib/rake/ext/module.rb +0 -39
  100. data/lib/rake/ext/time.rb +0 -14
  101. data/lib/rake/gempackagetask.rb +0 -13
  102. data/lib/rake/pathmap.rb +0 -1
  103. data/lib/rake/rdoctask.rb +0 -230
  104. data/lib/rake/ruby182_test_unit_fix.rb +0 -25
  105. data/lib/rake/runtest.rb +0 -21
  106. data/test/check_expansion.rb +0 -5
  107. data/test/check_no_expansion.rb +0 -5
  108. data/test/data/access/Rakefile +0 -35
  109. data/test/data/chains/Rakefile +0 -15
  110. data/test/data/comments/Rakefile +0 -18
  111. data/test/data/default/Rakefile +0 -17
  112. data/test/data/deprecated_import/Rakefile +0 -1
  113. data/test/data/dryrun/Rakefile +0 -22
  114. data/test/data/extra/Rakefile +0 -1
  115. data/test/data/file_creation_task/Rakefile +0 -31
  116. data/test/data/imports/Rakefile +0 -19
  117. data/test/data/imports/deps.mf +0 -1
  118. data/test/data/multidesc/Rakefile +0 -15
  119. data/test/data/namespace/Rakefile +0 -64
  120. data/test/data/rakelib/test1.rb +0 -4
  121. data/test/data/rbext/rakefile.rb +0 -3
  122. data/test/data/sample.mf +0 -14
  123. data/test/data/statusreturn/Rakefile +0 -6
  124. data/test/data/unittest/Rakefile +0 -1
  125. data/test/data/verbose/Rakefile +0 -34
  126. data/test/file_creation.rb +0 -34
  127. data/test/helper.rb +0 -44
  128. data/test/in_environment.rb +0 -35
  129. data/test/reqfile.rb +0 -3
  130. data/test/reqfile2.rb +0 -3
  131. data/test/shellcommand.rb +0 -3
  132. data/test/test_rake.rb +0 -38
  133. data/test/test_rake_application.rb +0 -364
  134. data/test/test_rake_application_options.rb +0 -382
  135. data/test/test_rake_clean.rb +0 -12
  136. data/test/test_rake_definitions.rb +0 -80
  137. data/test/test_rake_directory_task.rb +0 -55
  138. data/test/test_rake_dsl.rb +0 -73
  139. data/test/test_rake_early_time.rb +0 -31
  140. data/test/test_rake_extension.rb +0 -59
  141. data/test/test_rake_file_creation_task.rb +0 -62
  142. data/test/test_rake_file_list.rb +0 -633
  143. data/test/test_rake_file_list_path_map.rb +0 -8
  144. data/test/test_rake_file_task.rb +0 -104
  145. data/test/test_rake_file_utils.rb +0 -252
  146. data/test/test_rake_ftp_file.rb +0 -59
  147. data/test/test_rake_functional.rb +0 -468
  148. data/test/test_rake_invocation_chain.rb +0 -52
  149. data/test/test_rake_makefile_loader.rb +0 -23
  150. data/test/test_rake_multi_task.rb +0 -51
  151. data/test/test_rake_name_space.rb +0 -43
  152. data/test/test_rake_package_task.rb +0 -78
  153. data/test/test_rake_path_map.rb +0 -157
  154. data/test/test_rake_path_map_explode.rb +0 -31
  155. data/test/test_rake_path_map_partial.rb +0 -18
  156. data/test/test_rake_pseudo_status.rb +0 -20
  157. data/test/test_rake_rdoc_task.rb +0 -81
  158. data/test/test_rake_require.rb +0 -35
  159. data/test/test_rake_rules.rb +0 -346
  160. data/test/test_rake_task.rb +0 -271
  161. data/test/test_rake_task_argument_parsing.rb +0 -116
  162. data/test/test_rake_task_arguments.rb +0 -86
  163. data/test/test_rake_task_lib.rb +0 -9
  164. data/test/test_rake_task_manager.rb +0 -145
  165. data/test/test_rake_task_manager_argument_resolution.rb +0 -36
  166. data/test/test_rake_task_with_arguments.rb +0 -162
  167. data/test/test_rake_test_task.rb +0 -122
  168. data/test/test_rake_top_level_functions.rb +0 -76
  169. data/test/test_rake_win32.rb +0 -83
  170. data/test/test_sys.rb +0 -20
@@ -1,35 +0,0 @@
1
- module InEnvironment
2
- private
3
-
4
- # Create an environment for a test. At the completion of the yielded
5
- # block, the environment is restored to its original conditions.
6
- def in_environment(settings=nil)
7
- settings ||= {}
8
- full_settings = {"RAKEOPT" => nil}.merge(settings)
9
- original_settings = set_env(full_settings)
10
- yield
11
- ensure
12
- set_env(original_settings) rescue nil
13
- end
14
-
15
- # Set the environment according to the settings hash.
16
- def set_env(settings) # :nodoc:
17
- result = {}
18
-
19
- settings.each do |k, v|
20
- result[k] = ENV[k]
21
-
22
- if k == 'PWD'
23
- result[k] = Dir.pwd
24
- Dir.chdir(v)
25
- elsif v.nil?
26
- ENV.delete(k)
27
- else
28
- ENV[k] = v
29
- end
30
- end
31
-
32
- result
33
- end
34
-
35
- end
data/test/reqfile.rb DELETED
@@ -1,3 +0,0 @@
1
- # For --require testing
2
-
3
- TESTING_REQUIRE << 1
data/test/reqfile2.rb DELETED
@@ -1,3 +0,0 @@
1
- # For --require testing
2
-
3
- TESTING_REQUIRE << 2
data/test/shellcommand.rb DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- exit((ARGV[0] || "0").to_i)
data/test/test_rake.rb DELETED
@@ -1,38 +0,0 @@
1
- require File.expand_path('../helper', __FILE__)
2
-
3
- class TestRake < Rake::TestCase
4
- def test_each_dir_parent
5
- assert_equal ['a'], alldirs('a')
6
- assert_equal ['a/b', 'a'], alldirs('a/b')
7
- assert_equal ['/a/b', '/a', '/'], alldirs('/a/b')
8
- if File.dirname("c:/foo") == "c:"
9
- # Under Unix
10
- assert_equal ['c:/a/b', 'c:/a', 'c:'], alldirs('c:/a/b')
11
- assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b')
12
- else
13
- # Under Windows
14
- assert_equal ['c:/a/b', 'c:/a', 'c:/'], alldirs('c:/a/b')
15
- assert_equal ['c:a/b', 'c:a'], alldirs('c:a/b')
16
- end
17
- end
18
-
19
- def alldirs(fn)
20
- result = []
21
- Rake.each_dir_parent(fn) { |d| result << d }
22
- result
23
- end
24
-
25
- def test_can_override_application
26
- old_app = Rake.application
27
- fake_app = Object.new
28
- Rake.application = fake_app
29
- assert_equal fake_app, Rake.application
30
- ensure
31
- Rake.application = old_app
32
- end
33
-
34
- def test_original_dir_reports_current_dir
35
- assert_equal Dir.pwd, Rake.original_dir
36
- end
37
-
38
- end
@@ -1,364 +0,0 @@
1
- require File.expand_path('../helper', __FILE__)
2
-
3
- class TestRakeApplication < Rake::TestCase
4
- include InEnvironment
5
-
6
- def setup
7
- super
8
-
9
- @app = Rake::Application.new
10
- @app.options.rakelib = []
11
- Rake::TaskManager.record_task_metadata = true
12
- end
13
-
14
- def teardown
15
- Rake::TaskManager.record_task_metadata = false
16
-
17
- super
18
- end
19
-
20
- def test_constant_warning
21
- _, err = capture_io do @app.instance_eval { const_warning("Task") } end
22
- assert_match(/warning/i, err)
23
- assert_match(/deprecated/i, err)
24
- assert_match(/Task/i, err)
25
- end
26
-
27
- def test_display_tasks
28
- @app.options.show_tasks = :tasks
29
- @app.options.show_task_pattern = //
30
- @app.last_description = "COMMENT"
31
- @app.define_task(Rake::Task, "t")
32
- out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
33
- assert_match(/^rake t/, out)
34
- assert_match(/# COMMENT/, out)
35
- end
36
-
37
- def test_display_tasks_with_long_comments
38
- in_environment('RAKE_COLUMNS' => '80') do
39
- @app.options.show_tasks = :tasks
40
- @app.options.show_task_pattern = //
41
- @app.last_description = "1234567890" * 8
42
- @app.define_task(Rake::Task, "t")
43
- out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
44
- assert_match(/^rake t/, out)
45
- assert_match(/# 12345678901234567890123456789012345678901234567890123456789012345\.\.\./, out)
46
- end
47
- end
48
-
49
- def test_display_tasks_with_task_name_wider_than_tty_display
50
- in_environment('RAKE_COLUMNS' => '80') do
51
- @app.options.show_tasks = :tasks
52
- @app.options.show_task_pattern = //
53
- task_name = "task name" * 80
54
- @app.last_description = "something short"
55
- @app.define_task(Rake::Task, task_name )
56
- out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
57
- # Ensure the entire task name is output and we end up showing no description
58
- assert_match(/rake #{task_name} # .../, out)
59
- end
60
- end
61
-
62
- def test_display_tasks_with_very_long_task_name_to_a_non_tty_shows_name_and_comment
63
- @app.options.show_tasks = :tasks
64
- @app.options.show_task_pattern = //
65
- @app.tty_output = false
66
- description = "something short"
67
- task_name = "task name" * 80
68
- @app.last_description = "something short"
69
- @app.define_task(Rake::Task, task_name )
70
- out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
71
- # Ensure the entire task name is output and we end up showing no description
72
- assert_match(/rake #{task_name} # #{description}/, out)
73
- end
74
-
75
- def test_display_tasks_with_long_comments_to_a_non_tty_shows_entire_comment
76
- @app.options.show_tasks = :tasks
77
- @app.options.show_task_pattern = //
78
- @app.tty_output = false
79
- @app.last_description = "1234567890" * 8
80
- @app.define_task(Rake::Task, "t")
81
- out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
82
- assert_match(/^rake t/, out)
83
- assert_match(/# #{@app.last_description}/, out)
84
- end
85
-
86
- def test_display_tasks_with_long_comments_to_a_non_tty_with_columns_set_truncates_comments
87
- in_environment("RAKE_COLUMNS" => '80') do
88
- @app.options.show_tasks = :tasks
89
- @app.options.show_task_pattern = //
90
- @app.tty_output = false
91
- @app.last_description = "1234567890" * 8
92
- @app.define_task(Rake::Task, "t")
93
- out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
94
- assert_match(/^rake t/, out)
95
- assert_match(/# 12345678901234567890123456789012345678901234567890123456789012345\.\.\./, out)
96
- end
97
- end
98
-
99
- def test_describe_tasks
100
- @app.options.show_tasks = :describe
101
- @app.options.show_task_pattern = //
102
- @app.last_description = "COMMENT"
103
- @app.define_task(Rake::Task, "t")
104
- out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
105
- assert_match(/^rake t$/, out)
106
- assert_match(/^ {4}COMMENT$/, out)
107
- end
108
-
109
- def test_show_lines
110
- @app.options.show_tasks = :lines
111
- @app.options.show_task_pattern = //
112
- @app.last_description = "COMMENT"
113
- @app.define_task(Rake::Task, "t")
114
- @app['t'].locations << "HERE:1"
115
- out, = capture_io do @app.instance_eval { display_tasks_and_comments } end
116
- assert_match(/^rake t +[^:]+:\d+ *$/, out)
117
- end
118
-
119
- def test_finding_rakefile
120
- assert_match(/Rakefile/i, @app.instance_eval { have_rakefile })
121
- end
122
-
123
- def test_not_finding_rakefile
124
- @app.instance_eval { @rakefiles = ['NEVER_FOUND'] }
125
- assert( ! @app.instance_eval do have_rakefile end )
126
- assert_nil @app.rakefile
127
- end
128
-
129
- def test_load_rakefile
130
- in_environment("PWD" => "test/data/unittest") do
131
- @app.instance_eval do
132
- handle_options
133
- options.silent = true
134
- load_rakefile
135
- end
136
- assert_equal "rakefile", @app.rakefile.downcase
137
- assert_match(%r(unittest$), Dir.pwd)
138
- end
139
- end
140
-
141
- def test_load_rakefile_doesnt_print_rakefile_directory_from_same_dir
142
- in_environment("PWD" => "test/data/unittest") do
143
- _, err = capture_io do
144
- @app.instance_eval do
145
- @original_dir = File.expand_path(".") # pretend we started from the unittest dir
146
- raw_load_rakefile
147
- end
148
- end
149
- _, location = @app.find_rakefile_location
150
- refute_match(/\(in #{location}\)/, err)
151
- end
152
- end
153
-
154
- def test_load_rakefile_from_subdir
155
- in_environment("PWD" => "test/data/unittest/subdir") do
156
- @app.instance_eval do
157
- handle_options
158
- options.silent = true
159
- load_rakefile
160
- end
161
- assert_equal "rakefile", @app.rakefile.downcase
162
- assert_match(%r(unittest$), Dir.pwd)
163
- end
164
- end
165
-
166
- def test_load_rakefile_prints_rakefile_directory_from_subdir
167
- in_environment("PWD" => "test/data/unittest/subdir") do
168
- _, err = capture_io do
169
- @app.instance_eval do
170
- raw_load_rakefile
171
- end
172
- end
173
- _, location = @app.find_rakefile_location
174
- assert_match(/\(in #{location}\)/, err)
175
- end
176
- end
177
-
178
- def test_load_rakefile_doesnt_print_rakefile_directory_from_subdir_if_silent
179
- in_environment("PWD" => "test/data/unittest/subdir") do
180
- _, err = capture_io do
181
- @app.instance_eval do
182
- handle_options
183
- options.silent = true
184
- raw_load_rakefile
185
- end
186
- end
187
- _, location = @app.find_rakefile_location
188
- refute_match(/\(in #{location}\)/, err)
189
- end
190
- end
191
-
192
- def test_load_rakefile_not_found
193
- in_environment("PWD" => "/", "RAKE_SYSTEM" => 'not_exist') do
194
- @app.instance_eval do
195
- handle_options
196
- options.silent = true
197
- end
198
- ex = assert_raises(RuntimeError) do
199
- @app.instance_eval do raw_load_rakefile end
200
- end
201
- assert_match(/no rakefile found/i, ex.message)
202
- end
203
- end
204
-
205
- def test_load_from_system_rakefile
206
- in_environment('RAKE_SYSTEM' => 'test/data/sys') do
207
- @app.options.rakelib = []
208
- @app.instance_eval do
209
- handle_options
210
- options.silent = true
211
- options.load_system = true
212
- options.rakelib = []
213
- load_rakefile
214
- end
215
- assert_equal "test/data/sys", @app.system_dir
216
- assert_nil @app.rakefile
217
- end
218
- end
219
-
220
- def test_load_from_calculated_system_rakefile
221
- flexmock(@app, :standard_system_dir => "__STD_SYS_DIR__")
222
- in_environment('RAKE_SYSTEM' => nil) do
223
- @app.options.rakelib = []
224
- @app.instance_eval do
225
- handle_options
226
- options.silent = true
227
- options.load_system = true
228
- options.rakelib = []
229
- load_rakefile
230
- end
231
- assert_equal "__STD_SYS_DIR__", @app.system_dir
232
- end
233
- end
234
-
235
- def test_windows
236
- assert ! (@app.windows? && @app.unix?)
237
- end
238
-
239
- def test_loading_imports
240
- mock = flexmock("loader")
241
- mock.should_receive(:load).with("x.dummy").once
242
- @app.instance_eval do
243
- add_loader("dummy", mock)
244
- add_import("x.dummy")
245
- load_imports
246
- end
247
- end
248
-
249
- def test_building_imported_files_on_demand
250
- mock = flexmock("loader")
251
- mock.should_receive(:load).with("x.dummy").once
252
- mock.should_receive(:make_dummy).with_no_args.once
253
- @app.instance_eval do
254
- intern(Rake::Task, "x.dummy").enhance do mock.make_dummy end
255
- add_loader("dummy", mock)
256
- add_import("x.dummy")
257
- load_imports
258
- end
259
- end
260
-
261
- def test_handle_options_should_strip_options_from_ARGV
262
- assert !@app.options.trace
263
-
264
- valid_option = '--trace'
265
- ARGV.clear
266
- ARGV << valid_option
267
-
268
- @app.handle_options
269
-
270
- assert !ARGV.include?(valid_option)
271
- assert @app.options.trace
272
- end
273
-
274
- def test_good_run
275
- ran = false
276
- ARGV.clear
277
- ARGV << '--rakelib=""'
278
- @app.options.silent = true
279
- @app.instance_eval do
280
- intern(Rake::Task, "default").enhance { ran = true }
281
- end
282
- in_environment("PWD" => "test/data/default") do
283
- @app.run
284
- end
285
- assert ran
286
- end
287
-
288
- def test_display_task_run
289
- ran = false
290
- ARGV.clear
291
- ARGV << '-f' << '-s' << '--tasks' << '--rakelib=""'
292
- @app.last_description = "COMMENT"
293
- @app.define_task(Rake::Task, "default")
294
- out, = capture_io { @app.run }
295
- assert @app.options.show_tasks
296
- assert ! ran
297
- assert_match(/rake default/, out)
298
- assert_match(/# COMMENT/, out)
299
- end
300
-
301
- def test_display_prereqs
302
- ran = false
303
- ARGV.clear
304
- ARGV << '-f' << '-s' << '--prereqs' << '--rakelib=""'
305
- @app.last_description = "COMMENT"
306
- t = @app.define_task(Rake::Task, "default")
307
- t.enhance([:a, :b])
308
- @app.define_task(Rake::Task, "a")
309
- @app.define_task(Rake::Task, "b")
310
- out, = capture_io { @app.run }
311
- assert @app.options.show_prereqs
312
- assert ! ran
313
- assert_match(/rake a$/, out)
314
- assert_match(/rake b$/, out)
315
- assert_match(/rake default\n( *(a|b)\n){2}/m, out)
316
- end
317
-
318
- def test_bad_run
319
- @app.intern(Rake::Task, "default").enhance { fail }
320
- ARGV.clear
321
- ARGV << '-f' << '-s' << '--rakelib=""'
322
- assert_raises(SystemExit) {
323
- _, err = capture_io { @app.run }
324
- assert_match(/see full trace/, err)
325
- }
326
- ensure
327
- ARGV.clear
328
- end
329
-
330
- def test_bad_run_with_trace
331
- @app.intern(Rake::Task, "default").enhance { fail }
332
- ARGV.clear
333
- ARGV << '-f' << '-s' << '-t'
334
- assert_raises(SystemExit) {
335
- _, err = capture_io { @app.run }
336
- refute_match(/see full trace/, err)
337
- }
338
- ensure
339
- ARGV.clear
340
- end
341
-
342
- def test_run_with_bad_options
343
- @app.intern(Rake::Task, "default").enhance { fail }
344
- ARGV.clear
345
- ARGV << '-f' << '-s' << '--xyzzy'
346
- assert_raises(SystemExit) {
347
- capture_io { @app.run }
348
- }
349
- ensure
350
- ARGV.clear
351
- end
352
-
353
- def test_deprecation_message
354
- in_environment do
355
- _, err = capture_io do
356
- @app.deprecate("a", "b", "c")
357
- end
358
- assert_match(/'a' is deprecated/i, err)
359
- assert_match(/use 'b' instead/i, err)
360
- assert_match(/at c$/i, err)
361
- end
362
- end
363
- end
364
-