rake 0.8.7 → 0.9.0.beta.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rake might be problematic. Click here for more details.

Files changed (122) hide show
  1. data/.gemtest +0 -0
  2. data/CHANGES +77 -9
  3. data/{README → README.rdoc} +14 -10
  4. data/Rakefile +113 -110
  5. data/TODO +1 -1
  6. data/doc/command_line_usage.rdoc +18 -6
  7. data/doc/glossary.rdoc +2 -2
  8. data/doc/jamis.rb +2 -2
  9. data/doc/proto_rake.rdoc +22 -22
  10. data/doc/rake.1.gz +0 -0
  11. data/doc/rakefile.rdoc +60 -28
  12. data/doc/rational.rdoc +6 -6
  13. data/doc/release_notes/rake-0.4.15.rdoc +1 -1
  14. data/doc/release_notes/rake-0.5.0.rdoc +1 -1
  15. data/doc/release_notes/rake-0.7.0.rdoc +1 -1
  16. data/doc/release_notes/rake-0.7.2.rdoc +3 -3
  17. data/doc/release_notes/rake-0.7.3.rdoc +2 -2
  18. data/doc/release_notes/rake-0.8.0.rdoc +1 -1
  19. data/doc/release_notes/rake-0.8.2.rdoc +3 -3
  20. data/doc/release_notes/rake-0.8.3.rdoc +2 -2
  21. data/doc/release_notes/rake-0.8.4.rdoc +1 -1
  22. data/doc/release_notes/rake-0.8.5.rdoc +1 -1
  23. data/doc/release_notes/rake-0.8.6.rdoc +1 -1
  24. data/doc/release_notes/rake-0.8.7.rdoc +1 -1
  25. data/install.rb +14 -12
  26. data/lib/rake.rb +28 -2470
  27. data/lib/rake/alt_system.rb +7 -6
  28. data/lib/rake/application.rb +585 -0
  29. data/lib/rake/classic_namespace.rb +1 -0
  30. data/lib/rake/clean.rb +14 -14
  31. data/lib/rake/cloneable.rb +25 -0
  32. data/lib/rake/contrib/compositepublisher.rb +2 -5
  33. data/lib/rake/contrib/ftptools.rb +5 -8
  34. data/lib/rake/contrib/publisher.rb +2 -8
  35. data/lib/rake/contrib/rubyforgepublisher.rb +2 -4
  36. data/lib/rake/contrib/sshpublisher.rb +4 -6
  37. data/lib/rake/contrib/sys.rb +7 -25
  38. data/lib/rake/default_loader.rb +10 -0
  39. data/lib/rake/dsl.rb +2 -0
  40. data/lib/rake/dsl_definition.rb +146 -0
  41. data/lib/rake/early_time.rb +18 -0
  42. data/lib/rake/environment.rb +40 -0
  43. data/lib/rake/ext/core.rb +27 -0
  44. data/lib/rake/ext/module.rb +39 -0
  45. data/lib/rake/ext/string.rb +167 -0
  46. data/lib/rake/ext/time.rb +14 -0
  47. data/lib/rake/file_creation_task.rb +24 -0
  48. data/lib/rake/file_list.rb +403 -0
  49. data/lib/rake/file_task.rb +47 -0
  50. data/lib/rake/file_utils.rb +112 -0
  51. data/lib/rake/file_utils_ext.rb +132 -0
  52. data/lib/rake/gempackagetask.rb +6 -90
  53. data/lib/rake/invocation_chain.rb +51 -0
  54. data/lib/rake/invocation_exception_mixin.rb +16 -0
  55. data/lib/rake/loaders/makefile.rb +13 -15
  56. data/lib/rake/multi_task.rb +16 -0
  57. data/lib/rake/name_space.rb +25 -0
  58. data/lib/rake/packagetask.rb +13 -12
  59. data/lib/rake/pathmap.rb +1 -0
  60. data/lib/rake/pseudo_status.rb +24 -0
  61. data/lib/rake/rake_module.rb +25 -0
  62. data/lib/rake/rake_test_loader.rb +10 -2
  63. data/lib/rake/rdoctask.rb +211 -190
  64. data/lib/rake/ruby182_test_unit_fix.rb +9 -7
  65. data/lib/rake/rule_recursion_overflow_error.rb +20 -0
  66. data/lib/rake/runtest.rb +4 -6
  67. data/lib/rake/task.rb +327 -0
  68. data/lib/rake/task_argument_error.rb +7 -0
  69. data/lib/rake/task_arguments.rb +74 -0
  70. data/lib/rake/task_manager.rb +329 -0
  71. data/lib/rake/tasklib.rb +1 -2
  72. data/lib/rake/testtask.rb +51 -26
  73. data/lib/rake/version.rb +12 -0
  74. data/lib/rake/win32.rb +4 -4
  75. data/test/contrib/test_sys.rb +7 -30
  76. data/test/data/comments/Rakefile +18 -0
  77. data/test/data/default/Rakefile +1 -1
  78. data/test/data/dryrun/Rakefile +1 -1
  79. data/test/data/file_creation_task/Rakefile +1 -1
  80. data/test/data/namespace/Rakefile +9 -0
  81. data/test/data/rakelib/test1.rb +4 -2
  82. data/test/data/verbose/Rakefile +34 -0
  83. data/test/functional/functional_test.rb +25 -0
  84. data/test/{session_functional.rb → functional/session_based_tests.rb} +134 -23
  85. data/test/in_environment.rb +6 -4
  86. data/test/{test_application.rb → lib/application_test.rb} +277 -136
  87. data/test/{test_clean.rb → lib/clean_test.rb} +1 -0
  88. data/test/{test_definitions.rb → lib/definitions_test.rb} +2 -2
  89. data/test/lib/dsl_test.rb +52 -0
  90. data/test/{test_earlytime.rb → lib/earlytime_test.rb} +1 -2
  91. data/test/lib/environment_test.rb +18 -0
  92. data/test/{test_extension.rb → lib/extension_test.rb} +2 -2
  93. data/test/{test_file_creation_task.rb → lib/file_creation_task_test.rb} +0 -0
  94. data/test/{test_file_task.rb → lib/file_task_test.rb} +3 -3
  95. data/test/{test_filelist.rb → lib/filelist_test.rb} +28 -24
  96. data/test/{test_fileutils.rb → lib/fileutils_test.rb} +26 -21
  97. data/test/{test_ftp.rb → lib/ftp_test.rb} +0 -0
  98. data/test/{test_invocation_chain.rb → lib/invocation_chain_test.rb} +0 -0
  99. data/test/{test_makefile_loader.rb → lib/makefile_loader_test.rb} +0 -0
  100. data/test/{test_multitask.rb → lib/multitask_test.rb} +14 -6
  101. data/test/{test_namespace.rb → lib/namespace_test.rb} +0 -0
  102. data/test/lib/package_task_test.rb +82 -0
  103. data/test/{test_pathmap.rb → lib/pathmap_test.rb} +3 -2
  104. data/test/{test_pseudo_status.rb → lib/pseudo_status_test.rb} +0 -0
  105. data/test/{test_rake.rb → lib/rake_test.rb} +1 -1
  106. data/test/{test_rdoc_task.rb → lib/rdoc_task_test.rb} +19 -23
  107. data/test/{test_require.rb → lib/require_test.rb} +8 -2
  108. data/test/{test_rules.rb → lib/rules_test.rb} +1 -2
  109. data/test/{test_task_arguments.rb → lib/task_arguments_test.rb} +5 -5
  110. data/test/{test_task_manager.rb → lib/task_manager_test.rb} +5 -5
  111. data/test/{test_tasks.rb → lib/task_test.rb} +69 -4
  112. data/test/{test_tasklib.rb → lib/tasklib_test.rb} +0 -0
  113. data/test/{test_test_task.rb → lib/test_task_test.rb} +3 -3
  114. data/test/lib/testtask_test.rb +49 -0
  115. data/test/{test_top_level_functions.rb → lib/top_level_functions_test.rb} +3 -3
  116. data/test/{test_win32.rb → lib/win32_test.rb} +19 -0
  117. data/test/rake_test_setup.rb +4 -9
  118. data/test/ruby_version_test.rb +3 -0
  119. data/test/test_helper.rb +12 -0
  120. metadata +100 -44
  121. data/test/functional.rb +0 -15
  122. data/test/test_package_task.rb +0 -118
@@ -6,7 +6,7 @@ require 'rake/testtask'
6
6
  class TestTestTask < Test::Unit::TestCase
7
7
  include Rake
8
8
  include TestMethods
9
-
9
+
10
10
  def setup
11
11
  Task.clear
12
12
  ENV.delete('TEST')
@@ -48,7 +48,7 @@ class TestTestTask < Test::Unit::TestCase
48
48
  tt = Rake::TestTask.new do |t|
49
49
  t.pattern = '*.rb'
50
50
  end
51
- assert_equal ['install.rb'], tt.file_list.to_a
51
+ assert_equal ['*.rb'], tt.file_list.to_a
52
52
  end
53
53
 
54
54
  def test_env_test
@@ -71,7 +71,7 @@ class TestTestTask < Test::Unit::TestCase
71
71
  t.test_files = FileList['a.rb', 'b.rb']
72
72
  t.pattern = '*.rb'
73
73
  end
74
- assert_equal ['a.rb', 'b.rb', 'install.rb'], tt.file_list.to_a
74
+ assert_equal ['a.rb', 'b.rb', '*.rb'], tt.file_list.to_a
75
75
  end
76
76
 
77
77
  end
@@ -0,0 +1,49 @@
1
+ require 'test/test_helper'
2
+ require 'rake/testtask'
3
+
4
+ class TestTaskTest < Test::Unit::TestCase
5
+ def test_direct_run_has_quoted_paths
6
+ test_task = Rake::TestTask.new(:tx) do |t|
7
+ t.loader = :direct
8
+ end
9
+ assert_match(/-e ".*"/, test_task.run_code)
10
+ end
11
+
12
+ def test_testrb_run_has_quoted_paths_on_ruby_182
13
+ test_task = Rake::TestTask.new(:tx) do |t|
14
+ t.loader = :testrb
15
+ end
16
+ flexmock(test_task).should_receive(:ruby_version).and_return('1.8.2')
17
+ assert_match(/^-S testrb +".*"$/, test_task.run_code)
18
+ end
19
+
20
+ def test_testrb_run_has_quoted_paths_on_ruby_186
21
+ test_task = Rake::TestTask.new(:tx) do |t|
22
+ t.loader = :testrb
23
+ end
24
+ flexmock(test_task).should_receive(:ruby_version).and_return('1.8.6')
25
+ assert_match(/^-S testrb +$/, test_task.run_code)
26
+ end
27
+
28
+ def test_rake_run_has_quoted_paths
29
+ test_task = Rake::TestTask.new(:tx) do |t|
30
+ t.loader = :rake
31
+ end
32
+ assert_match(/".*"/, test_task.run_code)
33
+ end
34
+
35
+ def test_nested_libs_will_be_flattened
36
+ test_task = Rake::TestTask.new(:tx) do |t|
37
+ t.libs << ["A", "B"]
38
+ end
39
+ sep = File::PATH_SEPARATOR
40
+ assert_match(/lib#{sep}A#{sep}B/, test_task.ruby_opts_string)
41
+ end
42
+
43
+ def test_empty_lib_path_implies_no_dash_I_option
44
+ test_task = Rake::TestTask.new(:tx) do |t|
45
+ t.libs = []
46
+ end
47
+ assert_no_match(/-I/, test_task.ruby_opts_string)
48
+ end
49
+ end
@@ -49,15 +49,15 @@ class TestTopLevelFunctions < Test::Unit::TestCase
49
49
  end
50
50
 
51
51
  def test_when_not_writing
52
- RakeFileUtils.nowrite_flag = true
53
- out = capture_stdout do
52
+ Rake::FileUtilsExt.nowrite_flag = true
53
+ out = capture_stderr do
54
54
  when_writing("NOTWRITING") do
55
55
  puts "WRITING"
56
56
  end
57
57
  end
58
58
  assert_equal "DRYRUN: NOTWRITING\n", out
59
59
  ensure
60
- RakeFileUtils.nowrite_flag = false
60
+ Rake::FileUtilsExt.nowrite_flag = false
61
61
  end
62
62
 
63
63
  def test_missing_constants_task
@@ -9,6 +9,7 @@ require 'rake'
9
9
  class TestWin32 < Test::Unit::TestCase
10
10
  include InEnvironment
11
11
  include TestMethods
12
+ include CaptureStdout
12
13
 
13
14
  Win32 = Rake::Win32
14
15
 
@@ -69,4 +70,22 @@ class TestWin32 < Test::Unit::TestCase
69
70
  end
70
71
  end
71
72
 
73
+ def test_win32_backtrace_with_different_case
74
+ ex = nil
75
+ begin
76
+ raise 'test exception'
77
+ rescue => ex
78
+ end
79
+
80
+ ex.set_backtrace ['abc', 'rakefile']
81
+
82
+ rake = Rake::Application.new
83
+ rake.options.trace = true
84
+ rake.instance_variable_set(:@rakefile, 'Rakefile')
85
+
86
+ err = capture_stderr { rake.display_error_message(ex) }
87
+
88
+ assert_match(/rakefile/, err)
89
+ end
90
+
72
91
  end
@@ -8,17 +8,12 @@ rescue LoadError
8
8
  end
9
9
 
10
10
  require 'flexmock/test_unit'
11
-
12
- if RUBY_VERSION >= "1.9.0"
13
- class Test::Unit::TestCase
14
- # def passed?
15
- # true
16
- # end
17
- end
18
- end
11
+ require 'test/filecreation'
12
+ require 'test/capture_stdout'
19
13
 
20
14
  module TestMethods
21
- def assert_exception(ex, msg=nil, &block)
15
+ # Shim method for compatibility
16
+ def assert_exception(ex, msg="", &block)
22
17
  assert_raise(ex, msg, &block)
23
18
  end
24
19
  end
@@ -0,0 +1,3 @@
1
+ require 'test/unit'
2
+
3
+ puts "\nRUBY VERSION = #{RUBY_VERSION}"
@@ -0,0 +1,12 @@
1
+ begin
2
+ require 'rubygems'
3
+ rescue LoadError
4
+ end
5
+ require 'test/unit'
6
+ require 'flexmock/test_unit'
7
+
8
+ require 'rake'
9
+
10
+ class Test::Unit::TestCase
11
+ include Rake::DSL
12
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.9.0.beta.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -9,18 +9,37 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-15 00:00:00 -04:00
12
+ date: 2011-02-22 00:00:00 -05:00
13
13
  default_executable: rake
14
- dependencies: []
15
-
16
- description: Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax.
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: session
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: "2.4"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: flexmock
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.11
34
+ version:
35
+ description: " Rake is a Make-like program implemented in Ruby. Tasks\n and dependencies are specified in standard Ruby syntax.\n"
17
36
  email: jim@weirichhouse.org
18
37
  executables:
19
38
  - rake
20
39
  extensions: []
21
40
 
22
41
  extra_rdoc_files:
23
- - README
42
+ - README.rdoc
24
43
  - MIT-LICENSE
25
44
  - TODO
26
45
  - CHANGES
@@ -47,31 +66,61 @@ extra_rdoc_files:
47
66
  - doc/release_notes/rake-0.8.6.rdoc
48
67
  - doc/release_notes/rake-0.8.7.rdoc
49
68
  files:
69
+ - .gemtest
50
70
  - install.rb
51
71
  - CHANGES
52
72
  - MIT-LICENSE
53
73
  - Rakefile
54
- - README
74
+ - README.rdoc
55
75
  - TODO
56
76
  - bin/rake
57
77
  - lib/rake/alt_system.rb
78
+ - lib/rake/application.rb
58
79
  - lib/rake/classic_namespace.rb
59
80
  - lib/rake/clean.rb
81
+ - lib/rake/cloneable.rb
60
82
  - lib/rake/contrib/compositepublisher.rb
61
83
  - lib/rake/contrib/ftptools.rb
62
84
  - lib/rake/contrib/publisher.rb
63
85
  - lib/rake/contrib/rubyforgepublisher.rb
64
86
  - lib/rake/contrib/sshpublisher.rb
65
87
  - lib/rake/contrib/sys.rb
88
+ - lib/rake/default_loader.rb
89
+ - lib/rake/dsl.rb
90
+ - lib/rake/dsl_definition.rb
91
+ - lib/rake/early_time.rb
92
+ - lib/rake/environment.rb
93
+ - lib/rake/ext/core.rb
94
+ - lib/rake/ext/module.rb
95
+ - lib/rake/ext/string.rb
96
+ - lib/rake/ext/time.rb
97
+ - lib/rake/file_creation_task.rb
98
+ - lib/rake/file_list.rb
99
+ - lib/rake/file_task.rb
100
+ - lib/rake/file_utils.rb
101
+ - lib/rake/file_utils_ext.rb
66
102
  - lib/rake/gempackagetask.rb
103
+ - lib/rake/invocation_chain.rb
104
+ - lib/rake/invocation_exception_mixin.rb
67
105
  - lib/rake/loaders/makefile.rb
106
+ - lib/rake/multi_task.rb
107
+ - lib/rake/name_space.rb
68
108
  - lib/rake/packagetask.rb
109
+ - lib/rake/pathmap.rb
110
+ - lib/rake/pseudo_status.rb
111
+ - lib/rake/rake_module.rb
69
112
  - lib/rake/rake_test_loader.rb
70
113
  - lib/rake/rdoctask.rb
71
114
  - lib/rake/ruby182_test_unit_fix.rb
115
+ - lib/rake/rule_recursion_overflow_error.rb
72
116
  - lib/rake/runtest.rb
117
+ - lib/rake/task.rb
118
+ - lib/rake/task_argument_error.rb
119
+ - lib/rake/task_arguments.rb
120
+ - lib/rake/task_manager.rb
73
121
  - lib/rake/tasklib.rb
74
122
  - lib/rake/testtask.rb
123
+ - lib/rake/version.rb
75
124
  - lib/rake/win32.rb
76
125
  - lib/rake.rb
77
126
  - test/capture_stdout.rb
@@ -81,44 +130,50 @@ files:
81
130
  - test/data/rakelib/test1.rb
82
131
  - test/data/rbext/rakefile.rb
83
132
  - test/filecreation.rb
84
- - test/functional.rb
133
+ - test/functional/functional_test.rb
134
+ - test/functional/session_based_tests.rb
85
135
  - test/in_environment.rb
136
+ - test/lib/application_test.rb
137
+ - test/lib/clean_test.rb
138
+ - test/lib/definitions_test.rb
139
+ - test/lib/dsl_test.rb
140
+ - test/lib/earlytime_test.rb
141
+ - test/lib/environment_test.rb
142
+ - test/lib/extension_test.rb
143
+ - test/lib/file_creation_task_test.rb
144
+ - test/lib/file_task_test.rb
145
+ - test/lib/filelist_test.rb
146
+ - test/lib/fileutils_test.rb
147
+ - test/lib/ftp_test.rb
148
+ - test/lib/invocation_chain_test.rb
149
+ - test/lib/makefile_loader_test.rb
150
+ - test/lib/multitask_test.rb
151
+ - test/lib/namespace_test.rb
152
+ - test/lib/package_task_test.rb
153
+ - test/lib/pathmap_test.rb
154
+ - test/lib/pseudo_status_test.rb
155
+ - test/lib/rake_test.rb
156
+ - test/lib/rdoc_task_test.rb
157
+ - test/lib/require_test.rb
158
+ - test/lib/rules_test.rb
159
+ - test/lib/task_arguments_test.rb
160
+ - test/lib/task_manager_test.rb
161
+ - test/lib/task_test.rb
162
+ - test/lib/tasklib_test.rb
163
+ - test/lib/test_task_test.rb
164
+ - test/lib/testtask_test.rb
165
+ - test/lib/top_level_functions_test.rb
166
+ - test/lib/win32_test.rb
86
167
  - test/rake_test_setup.rb
87
168
  - test/reqfile.rb
88
169
  - test/reqfile2.rb
89
- - test/session_functional.rb
170
+ - test/ruby_version_test.rb
90
171
  - test/shellcommand.rb
91
- - test/test_application.rb
92
- - test/test_clean.rb
93
- - test/test_definitions.rb
94
- - test/test_earlytime.rb
95
- - test/test_extension.rb
96
- - test/test_file_creation_task.rb
97
- - test/test_file_task.rb
98
- - test/test_filelist.rb
99
- - test/test_fileutils.rb
100
- - test/test_ftp.rb
101
- - test/test_invocation_chain.rb
102
- - test/test_makefile_loader.rb
103
- - test/test_multitask.rb
104
- - test/test_namespace.rb
105
- - test/test_package_task.rb
106
- - test/test_pathmap.rb
107
- - test/test_pseudo_status.rb
108
- - test/test_rake.rb
109
- - test/test_rdoc_task.rb
110
- - test/test_require.rb
111
- - test/test_rules.rb
112
- - test/test_task_arguments.rb
113
- - test/test_task_manager.rb
114
- - test/test_tasklib.rb
115
- - test/test_tasks.rb
116
- - test/test_test_task.rb
117
- - test/test_top_level_functions.rb
118
- - test/test_win32.rb
172
+ - test/test_helper.rb
119
173
  - test/data/imports/deps.mf
120
174
  - test/data/sample.mf
121
175
  - test/data/chains/Rakefile
176
+ - test/data/comments/Rakefile
122
177
  - test/data/default/Rakefile
123
178
  - test/data/dryrun/Rakefile
124
179
  - test/data/file_creation_task/Rakefile
@@ -127,9 +182,8 @@ files:
127
182
  - test/data/namespace/Rakefile
128
183
  - test/data/statusreturn/Rakefile
129
184
  - test/data/unittest/Rakefile
130
- - test/data/unittest/subdir
185
+ - test/data/verbose/Rakefile
131
186
  - doc/command_line_usage.rdoc
132
- - doc/example
133
187
  - doc/example/a.c
134
188
  - doc/example/b.c
135
189
  - doc/example/main.c
@@ -141,7 +195,6 @@ files:
141
195
  - doc/rake.1.gz
142
196
  - doc/rakefile.rdoc
143
197
  - doc/rational.rdoc
144
- - doc/release_notes
145
198
  - doc/release_notes/rake-0.4.14.rdoc
146
199
  - doc/release_notes/rake-0.4.15.rdoc
147
200
  - doc/release_notes/rake-0.5.0.rdoc
@@ -161,11 +214,14 @@ files:
161
214
  - doc/release_notes/rake-0.8.7.rdoc
162
215
  has_rdoc: true
163
216
  homepage: http://rake.rubyforge.org
217
+ licenses: []
218
+
164
219
  post_install_message:
165
220
  rdoc_options:
166
221
  - --line-numbers
222
+ - --show-hash
167
223
  - --main
168
- - README
224
+ - README.rdoc
169
225
  - --title
170
226
  - Rake -- Ruby Make
171
227
  require_paths:
@@ -180,14 +236,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
236
  requirements:
181
237
  - - ">="
182
238
  - !ruby/object:Gem::Version
183
- version: "0"
239
+ version: 1.3.2
184
240
  version:
185
241
  requirements: []
186
242
 
187
243
  rubyforge_project: rake
188
- rubygems_version: 1.3.1
244
+ rubygems_version: 1.3.5
189
245
  signing_key:
190
- specification_version: 2
246
+ specification_version: 3
191
247
  summary: Ruby based make-like utility.
192
248
  test_files: []
193
249
 
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- begin
4
- require 'rubygems'
5
- gem 'session'
6
- require 'session'
7
- rescue LoadError
8
- puts "UNABLE TO RUN FUNCTIONAL TESTS"
9
- puts "No Session Found (gem install session)"
10
- end
11
-
12
- if defined?(Session)
13
- puts "RUNNING WITH SESSIONS"
14
- require 'test/session_functional'
15
- end
@@ -1,118 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'test/unit'
4
- require 'rake/packagetask'
5
- require 'test/rake_test_setup'
6
-
7
- class TestPackageTask < Test::Unit::TestCase
8
- include Rake
9
- include TestMethods
10
-
11
- def test_create
12
- pkg = Rake::PackageTask.new("pkgr", "1.2.3") { |p|
13
- p.package_files << "install.rb"
14
- p.package_files.include(
15
- '[A-Z]*',
16
- 'bin/**/*',
17
- 'lib/**/*.rb',
18
- 'test/**/*.rb',
19
- 'doc/**/*',
20
- 'build/rubyapp.rb',
21
- '*.blurb')
22
- p.package_files.exclude(/\bCVS\b/)
23
- p.package_files.exclude(/~$/)
24
- p.package_dir = 'pkg'
25
- p.need_tar = true
26
- p.need_tar_gz = true
27
- p.need_tar_bz2 = true
28
- p.need_zip = true
29
- }
30
- assert_equal "pkg", pkg.package_dir
31
- assert pkg.package_files.include?("bin/rake")
32
- assert "pkgr", pkg.name
33
- assert "1.2.3", pkg.version
34
- assert Task[:package]
35
- assert Task['pkg/pkgr-1.2.3.tgz']
36
- assert Task['pkg/pkgr-1.2.3.tar.gz']
37
- assert Task['pkg/pkgr-1.2.3.tar.bz2']
38
- assert Task['pkg/pkgr-1.2.3.zip']
39
- assert Task["pkg/pkgr-1.2.3"]
40
- assert Task[:clobber_package]
41
- assert Task[:repackage]
42
- end
43
-
44
- def test_missing_version
45
- assert_exception(RuntimeError) {
46
- pkg = Rake::PackageTask.new("pkgr") { |p| }
47
- }
48
- end
49
-
50
- def test_no_version
51
- pkg = Rake::PackageTask.new("pkgr", :noversion) { |p| }
52
- assert "pkgr", pkg.send(:package_name)
53
- end
54
-
55
- def test_clone
56
- pkg = Rake::PackageTask.new("x", :noversion)
57
- p2 = pkg.clone
58
- pkg.package_files << "y"
59
- p2.package_files << "x"
60
- assert_equal ["y"], pkg.package_files
61
- assert_equal ["x"], p2.package_files
62
- end
63
- end
64
-
65
-
66
- begin
67
- require 'rubygems'
68
- require 'rake/gempackagetask'
69
- rescue Exception
70
- puts "WARNING: RubyGems not installed"
71
- end
72
-
73
- if ! defined?(Gem)
74
- puts "WARNING: Unable to test GemPackaging ... requires RubyGems"
75
- else
76
- class TestGemPackageTask < Test::Unit::TestCase
77
- def test_gem_package
78
- gem = Gem::Specification.new do |g|
79
- g.name = "pkgr"
80
- g.version = "1.2.3"
81
- g.files = FileList["x"].resolve
82
- end
83
- pkg = Rake::GemPackageTask.new(gem) do |p|
84
- p.package_files << "y"
85
- end
86
- assert_equal ["x", "y"], pkg.package_files
87
- assert_equal "pkgr-1.2.3.gem", pkg.gem_file
88
- end
89
-
90
- def test_gem_package_with_current_platform
91
- gem = Gem::Specification.new do |g|
92
- g.name = "pkgr"
93
- g.version = "1.2.3"
94
- g.files = FileList["x"].resolve
95
- g.platform = Gem::Platform::CURRENT
96
- end
97
- pkg = Rake::GemPackageTask.new(gem) do |p|
98
- p.package_files << "y"
99
- end
100
- assert_equal ["x", "y"], pkg.package_files
101
- assert_match(/^pkgr-1\.2\.3-(\S+)\.gem$/, pkg.gem_file)
102
- end
103
-
104
- def test_gem_package_with_ruby_platform
105
- gem = Gem::Specification.new do |g|
106
- g.name = "pkgr"
107
- g.version = "1.2.3"
108
- g.files = FileList["x"].resolve
109
- g.platform = Gem::Platform::RUBY
110
- end
111
- pkg = Rake::GemPackageTask.new(gem) do |p|
112
- p.package_files << "y"
113
- end
114
- assert_equal ["x", "y"], pkg.package_files
115
- assert_equal "pkgr-1.2.3.gem", pkg.gem_file
116
- end
117
- end
118
- end