rake 10.1.0.beta.3 → 10.1.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.

@@ -30,6 +30,7 @@ class TestBacktraceSuppression < Rake::TestCase
30
30
  end
31
31
 
32
32
  class TestRakeBacktrace < Rake::TestCase
33
+ include RubyRunner
33
34
 
34
35
  def setup
35
36
  super
@@ -38,15 +39,9 @@ class TestRakeBacktrace < Rake::TestCase
38
39
  Dir.pwd =~ Rake::Backtrace::SUPPRESS_PATTERN
39
40
  end
40
41
 
41
- # TODO: factor out similar code in test_rake_functional.rb
42
- def rake(*args)
43
- Open3.popen3(RUBY, "-I", @rake_lib, @rake_exec, *args) { |_, _, err, _|
44
- err.read
45
- }
46
- end
47
-
48
- def invoke(task_name)
49
- rake task_name.to_s
42
+ def invoke(*args)
43
+ rake(*args)
44
+ @err
50
45
  end
51
46
 
52
47
  def test_single_collapse
@@ -56,7 +51,7 @@ class TestRakeBacktrace < Rake::TestCase
56
51
  end
57
52
  }
58
53
 
59
- lines = invoke(:foo).split("\n")
54
+ lines = invoke("foo").split("\n")
60
55
 
61
56
  assert_equal "rake aborted!", lines[0]
62
57
  assert_equal "foooo!", lines[1]
@@ -74,7 +69,7 @@ class TestRakeBacktrace < Rake::TestCase
74
69
  end
75
70
  }
76
71
 
77
- lines = invoke(:foo).split("\n")
72
+ lines = invoke("foo").split("\n")
78
73
 
79
74
  assert_equal "rake aborted!", lines[0]
80
75
  assert_equal "barrr!", lines[1]
@@ -90,12 +85,12 @@ class TestRakeBacktrace < Rake::TestCase
90
85
  end
91
86
  }
92
87
 
93
- lines = rake("baz").split("\n")
88
+ lines = invoke("baz").split("\n")
94
89
  assert_equal "rake aborted!", lines[0]
95
90
  assert_equal "bazzz!", lines[1]
96
91
  assert_something_matches %r!Rakefile!i, lines
97
92
 
98
- lines = rake("--suppress-backtrace", ".ak.file", "baz").split("\n")
93
+ lines = invoke("--suppress-backtrace", ".ak.file", "baz").split("\n")
99
94
  assert_equal "rake aborted!", lines[0]
100
95
  assert_equal "bazzz!", lines[1]
101
96
  refute_match %r!Rakefile!i, lines[2]
@@ -2,13 +2,45 @@ require File.expand_path('../helper', __FILE__)
2
2
  require 'rake/clean'
3
3
 
4
4
  class TestRakeClean < Rake::TestCase
5
- include Rake
6
5
  def test_clean
7
6
  load 'rake/clean.rb', true
8
7
 
9
- assert Task['clean'], "Should define clean"
10
- assert Task['clobber'], "Should define clobber"
11
- assert Task['clobber'].prerequisites.include?("clean"),
8
+ assert Rake::Task['clean'], "Should define clean"
9
+ assert Rake::Task['clobber'], "Should define clobber"
10
+ assert Rake::Task['clobber'].prerequisites.include?("clean"),
12
11
  "Clobber should require clean"
13
12
  end
13
+
14
+ def test_cleanup
15
+ file_name = create_undeletable_file
16
+
17
+ out, _ = capture_io do
18
+ Rake::Cleaner.cleanup(file_name, verbose: false)
19
+ end
20
+ assert_match(/failed to remove/i, out)
21
+
22
+ ensure
23
+ remove_undeletable_file
24
+ end
25
+
26
+ private
27
+
28
+ def create_undeletable_file
29
+ dir_name = File.join(@tempdir, "deletedir")
30
+ file_name = File.join(dir_name, "deleteme")
31
+ FileUtils.mkdir(dir_name)
32
+ FileUtils.touch(file_name)
33
+ FileUtils.chmod(0, file_name)
34
+ FileUtils.chmod(0, dir_name)
35
+ file_name
36
+ end
37
+
38
+ def remove_undeletable_file
39
+ dir_name = File.join(@tempdir, "deletedir")
40
+ file_name = File.join(dir_name, "deleteme")
41
+ FileUtils.chmod(0777, dir_name)
42
+ FileUtils.chmod(0777, file_name)
43
+ Rake::Cleaner.cleanup(file_name, verbose: false)
44
+ Rake::Cleaner.cleanup(dir_name, verbose: false)
45
+ end
14
46
  end
@@ -3,13 +3,11 @@ require 'fileutils'
3
3
  require 'open3'
4
4
 
5
5
  class TestRakeFunctional < Rake::TestCase
6
+ include RubyRunner
6
7
 
7
8
  def setup
8
9
  super
9
10
 
10
- @ruby_options = ["-I#{@rake_lib}", "-I."]
11
- @verbose = ENV['VERBOSE']
12
-
13
11
  if @verbose
14
12
  puts
15
13
  puts
@@ -465,34 +463,4 @@ class TestRakeFunctional < Rake::TestCase
465
463
  RUBY_VERSION < "1.9" || defined?(JRUBY_VERSION)
466
464
  end
467
465
 
468
- # Run a shell Ruby command with command line options (using the
469
- # default test options). Output is captured in @out and @err
470
- def ruby(*option_list)
471
- run_ruby(@ruby_options + option_list)
472
- end
473
-
474
- # Run a command line rake with the give rake options. Default
475
- # command line ruby options are included. Output is captured in
476
- # @out and @err
477
- def rake(*rake_options)
478
- run_ruby @ruby_options + [@rake_exec] + rake_options
479
- end
480
-
481
- # Low level ruby command runner ...
482
- def run_ruby(option_list)
483
- puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose
484
-
485
- inn, out, err, wait = Open3.popen3(RUBY, *option_list)
486
- inn.close
487
-
488
- @exit = wait ? wait.value : $?
489
- @out = out.read
490
- @err = err.read
491
-
492
- puts "OUTPUT: [#{@out}]" if @verbose
493
- puts "ERROR: [#{@err}]" if @verbose
494
- puts "EXIT: [#{@exit.inspect}]" if @verbose
495
- puts "PWD: [#{Dir.pwd}]" if @verbose
496
- end
497
-
498
466
  end
@@ -2,15 +2,11 @@ require File.expand_path('../helper', __FILE__)
2
2
  require 'open3'
3
3
 
4
4
  class TestRakeReduceCompat < Rake::TestCase
5
- # TODO: factor out similar code in test_rake_functional.rb
6
- def rake(*args)
7
- Open3.popen3(RUBY, "-I", @rake_lib, @rake_exec, *args) { |_, out, _, _|
8
- out.read
9
- }
10
- end
5
+ include RubyRunner
11
6
 
12
7
  def invoke_normal(task_name)
13
8
  rake task_name.to_s
9
+ @out
14
10
  end
15
11
 
16
12
  def test_no_deprecated_dsl
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.1.0.beta.3
4
+ version: 10.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-30 00:00:00.000000000 Z
11
+ date: 2013-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -69,6 +69,7 @@ extra_rdoc_files:
69
69
  - doc/release_notes/rake-10.0.1.rdoc
70
70
  - doc/release_notes/rake-10.0.2.rdoc
71
71
  - doc/release_notes/rake-10.0.3.rdoc
72
+ - doc/release_notes/rake-10.1.0.rdoc
72
73
  files:
73
74
  - .gemtest
74
75
  - install.rb
@@ -135,6 +136,8 @@ files:
135
136
  - lib/rake/win32.rb
136
137
  - test/file_creation.rb
137
138
  - test/helper.rb
139
+ - test/support/rakefile_definitions.rb
140
+ - test/support/ruby_runner.rb
138
141
  - test/test_private_reader.rb
139
142
  - test/test_rake.rb
140
143
  - test/test_rake_application.rb
@@ -222,6 +225,7 @@ files:
222
225
  - doc/release_notes/rake-10.0.1.rdoc
223
226
  - doc/release_notes/rake-10.0.2.rdoc
224
227
  - doc/release_notes/rake-10.0.3.rdoc
228
+ - doc/release_notes/rake-10.1.0.rdoc
225
229
  homepage: http://rake.rubyforge.org
226
230
  licenses:
227
231
  - MIT