rake 0.9.0 → 0.9.1
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.
- data/CHANGES +9 -8
- data/RRR +10 -0
- data/Rakefile +9 -45
- data/bin/rake +4 -3
- data/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/lib/rake/dsl_definition.rb +19 -0
- data/lib/rake/version.rb +1 -1
- data/test/data/access/Rakefile +3 -1
- data/test/data/default/Rakefile +0 -2
- data/test/data/file_creation_task/Rakefile +0 -2
- data/test/data/multidesc/Rakefile +0 -2
- data/test/data/namespace/Rakefile +0 -2
- data/test/data/statusreturn/Rakefile +0 -2
- data/test/file_creation.rb +0 -2
- data/test/helper.rb +44 -0
- data/test/in_environment.rb +4 -1
- data/test/{lib/rake_test.rb → test_rake.rb} +2 -5
- data/test/test_rake_application.rb +364 -0
- data/test/test_rake_application_options.rb +382 -0
- data/test/{lib/clean_test.rb → test_rake_clean.rb} +2 -5
- data/test/{lib/definitions_test.rb → test_rake_definitions.rb} +5 -10
- data/test/test_rake_directory_task.rb +55 -0
- data/test/test_rake_dsl.rb +53 -0
- data/test/{lib/earlytime_test.rb → test_rake_early_time.rb} +2 -5
- data/test/{lib/extension_test.rb → test_rake_extension.rb} +2 -6
- data/test/{lib/file_creation_task_test.rb → test_rake_file_creation_task.rb} +7 -7
- data/test/{lib/filelist_test.rb → test_rake_file_list.rb} +18 -22
- data/test/test_rake_file_list_path_map.rb +8 -0
- data/test/{lib/file_task_test.rb → test_rake_file_task.rb} +22 -61
- data/test/{lib/fileutils_test.rb → test_rake_file_utils.rb} +11 -15
- data/test/{lib/ftp_test.rb → test_rake_ftp_file.rb} +5 -5
- data/test/{functional/session_based_tests.rb → test_rake_functional.rb} +35 -24
- data/test/test_rake_invocation_chain.rb +52 -0
- data/test/{lib/makefile_loader_test.rb → test_rake_makefile_loader.rb} +2 -5
- data/test/{lib/multitask_test.rb → test_rake_multi_task.rb} +5 -7
- data/test/{lib/namespace_test.rb → test_rake_name_space.rb} +4 -16
- data/test/{lib/package_task_test.rb → test_rake_package_task.rb} +2 -6
- data/test/{lib/pathmap_test.rb → test_rake_path_map.rb} +4 -58
- data/test/test_rake_path_map_explode.rb +31 -0
- data/test/test_rake_path_map_partial.rb +18 -0
- data/test/{lib/pseudo_status_test.rb → test_rake_pseudo_status.rb} +2 -8
- data/test/{lib/rdoc_task_test.rb → test_rake_rdoc_task.rb} +4 -7
- data/test/{lib/require_test.rb → test_rake_require.rb} +3 -9
- data/test/{lib/rules_test.rb → test_rake_rules.rb} +11 -13
- data/test/{lib/task_test.rb → test_rake_task.rb} +16 -182
- data/test/test_rake_task_argument_parsing.rb +116 -0
- data/test/{lib/task_arguments_test.rb → test_rake_task_arguments.rb} +2 -5
- data/test/{lib/tasklib_test.rb → test_rake_task_lib.rb} +2 -5
- data/test/{lib/task_manager_test.rb → test_rake_task_manager.rb} +7 -45
- data/test/test_rake_task_manager_argument_resolution.rb +36 -0
- data/test/test_rake_task_with_arguments.rb +162 -0
- data/test/{lib/test_task_test.rb → test_rake_test_task.rb} +52 -7
- data/test/{lib/top_level_functions_test.rb → test_rake_top_level_functions.rb} +8 -20
- data/test/{lib/win32_test.rb → test_rake_win32.rb} +4 -12
- data/test/{contrib/test_sys.rb → test_sys.rb} +2 -6
- metadata +60 -44
- data/lib/rake/dsl.rb +0 -2
- data/test/capture_stdout.rb +0 -26
- data/test/functional/functional_test.rb +0 -25
- data/test/lib/application_test.rb +0 -863
- data/test/lib/dsl_test.rb +0 -52
- data/test/lib/invocation_chain_test.rb +0 -81
- data/test/lib/testtask_test.rb +0 -49
- data/test/rake_test_setup.rb +0 -20
- data/test/ruby_version_test.rb +0 -3
- data/test/test_helper.rb +0 -19
data/test/lib/dsl_test.rb
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'rubygems'
|
5
|
-
rescue LoadError
|
6
|
-
# got no gems
|
7
|
-
end
|
8
|
-
|
9
|
-
require 'test/unit'
|
10
|
-
require 'flexmock/test_unit'
|
11
|
-
require 'rake'
|
12
|
-
require 'test/rake_test_setup'
|
13
|
-
|
14
|
-
class DslTest < Test::Unit::TestCase
|
15
|
-
|
16
|
-
def test_namespace_command
|
17
|
-
namespace "n" do
|
18
|
-
task "t"
|
19
|
-
end
|
20
|
-
assert_not_nil Rake::Task["n:t"]
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_namespace_command_with_bad_name
|
24
|
-
ex = assert_raise(ArgumentError) do
|
25
|
-
namespace 1 do end
|
26
|
-
end
|
27
|
-
assert_match(/string/i, ex.message)
|
28
|
-
assert_match(/symbol/i, ex.message)
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_namespace_command_with_a_string_like_object
|
32
|
-
name = Object.new
|
33
|
-
def name.to_str
|
34
|
-
"bob"
|
35
|
-
end
|
36
|
-
namespace name do
|
37
|
-
task "t"
|
38
|
-
end
|
39
|
-
assert_not_nil Rake::Task["bob:t"]
|
40
|
-
end
|
41
|
-
|
42
|
-
def test_dsl_not_toplevel_by_default
|
43
|
-
actual = TOPLEVEL_BINDING.instance_eval { defined?(task) }
|
44
|
-
assert_nil actual
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_dsl_toplevel_when_require_rake_dsl
|
48
|
-
assert_nothing_raised {
|
49
|
-
ruby '-I./lib', '-rrake/dsl', '-e', 'task(:x) { }', :verbose => false
|
50
|
-
}
|
51
|
-
end
|
52
|
-
end
|
@@ -1,81 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'test/unit'
|
4
|
-
require 'rake'
|
5
|
-
require 'test/rake_test_setup'
|
6
|
-
|
7
|
-
######################################################################
|
8
|
-
class TestAnEmptyInvocationChain < Test::Unit::TestCase
|
9
|
-
include TestMethods
|
10
|
-
|
11
|
-
def setup
|
12
|
-
@empty = Rake::InvocationChain::EMPTY
|
13
|
-
end
|
14
|
-
|
15
|
-
def test_should_be_able_to_add_members
|
16
|
-
assert_nothing_raised do
|
17
|
-
@empty.append("A")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_to_s
|
22
|
-
assert_equal "TOP", @empty.to_s
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
######################################################################
|
27
|
-
class TestAnInvocationChainWithOneMember < Test::Unit::TestCase
|
28
|
-
include TestMethods
|
29
|
-
|
30
|
-
def setup
|
31
|
-
@empty = Rake::InvocationChain::EMPTY
|
32
|
-
@first_member = "A"
|
33
|
-
@chain = @empty.append(@first_member)
|
34
|
-
end
|
35
|
-
|
36
|
-
def test_should_report_first_member_as_a_member
|
37
|
-
assert @chain.member?(@first_member)
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_should_fail_when_adding_original_member
|
41
|
-
ex = assert_exception RuntimeError do
|
42
|
-
@chain.append(@first_member)
|
43
|
-
end
|
44
|
-
assert_match(/circular +dependency/i, ex.message)
|
45
|
-
assert_match(/A.*=>.*A/, ex.message)
|
46
|
-
end
|
47
|
-
|
48
|
-
def test_to_s
|
49
|
-
assert_equal "TOP => A", @chain.to_s
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
######################################################################
|
55
|
-
class TestAnInvocationChainWithMultipleMember < Test::Unit::TestCase
|
56
|
-
include TestMethods
|
57
|
-
|
58
|
-
def setup
|
59
|
-
@first_member = "A"
|
60
|
-
@second_member = "B"
|
61
|
-
ch = Rake::InvocationChain::EMPTY.append(@first_member)
|
62
|
-
@chain = ch.append(@second_member)
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_should_report_first_member_as_a_member
|
66
|
-
assert @chain.member?(@first_member)
|
67
|
-
end
|
68
|
-
|
69
|
-
def test_should_report_second_member_as_a_member
|
70
|
-
assert @chain.member?(@second_member)
|
71
|
-
end
|
72
|
-
|
73
|
-
def test_should_fail_when_adding_original_member
|
74
|
-
ex = assert_exception RuntimeError do
|
75
|
-
@chain.append(@first_member)
|
76
|
-
end
|
77
|
-
assert_match(/A.*=>.*B.*=>.*A/, ex.message)
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
|
data/test/lib/testtask_test.rb
DELETED
@@ -1,49 +0,0 @@
|
|
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
|
data/test/rake_test_setup.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# Common setup for all test files.
|
2
|
-
|
3
|
-
begin
|
4
|
-
require 'rubygems'
|
5
|
-
gem 'flexmock'
|
6
|
-
rescue LoadError
|
7
|
-
# got no gems
|
8
|
-
end
|
9
|
-
|
10
|
-
require 'flexmock/test_unit'
|
11
|
-
require 'test/file_creation'
|
12
|
-
require 'test/capture_stdout'
|
13
|
-
require 'test/test_helper'
|
14
|
-
|
15
|
-
module TestMethods
|
16
|
-
# Shim method for compatibility
|
17
|
-
def assert_exception(ex, msg="", &block)
|
18
|
-
assert_raise(ex, msg, &block)
|
19
|
-
end
|
20
|
-
end
|
data/test/ruby_version_test.rb
DELETED
data/test/test_helper.rb
DELETED
@@ -1,19 +0,0 @@
|
|
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
|
-
|
13
|
-
def ignore_deprecations
|
14
|
-
Rake.application.options.ignore_deprecate = true
|
15
|
-
yield
|
16
|
-
ensure
|
17
|
-
Rake.application.options.ignore_deprecate = false
|
18
|
-
end
|
19
|
-
end
|