<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>rakelib/publish.rake</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -2,6 +2,7 @@ TAGS
 html
 pkg
 coverage
+*.bak
 temp_*
 x
 *.patch</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ require 'rubygems/user_interaction'
 require 'rubygems/builder'
 
 begin
-  Gem.manage_gems
+  Gem.manage_gems if Gem::RubyGemsVersion &lt; '1.2.0'
 rescue NoMethodError =&gt; ex
   # Using rubygems prior to 0.6.1
 end</diff>
      <filename>lib/rake/gempackagetask.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,3 +8,35 @@ rescue LoadError
 end
 
 require 'flexmock/test_unit'
+
+if RUBY_VERSION &gt;= &quot;1.9.0&quot;
+  class Test::Unit::TestCase
+#    def passed?
+#      true
+#    end
+  end
+end
+
+module TestMethods
+  if RUBY_VERSION &gt;= &quot;1.9.0&quot;
+    def assert_no_match(expected_pattern, actual, msg=nil)
+      refute_match(expected_pattern, actual, msg)
+    end
+    def assert_not_equal(expected, actual, msg=nil)
+      refute_equal(expected, actual, msg)
+    end
+    def assert_nothing_raised
+      yield
+    end
+    def assert_not_nil(actual, msg=nil)
+      refute_nil(actual, msg)
+    end
+    def assert_exception(ex, msg=nil, &amp;block)
+      assert_raises(ex, msg, &amp;block)
+    end
+  elsif RUBY_VERSION &gt;= &quot;1.8.0&quot;
+    def assert_exception(ex, msg=nil, &amp;block)
+      assert_raise(ex, msg, &amp;block)
+    end
+  end
+end</diff>
      <filename>test/rake_test_setup.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,7 @@ require 'test/unit'
 require 'fileutils'
 require 'session'
 require 'test/in_environment'
+require 'test/rake_test_setup'
 
 # Version 2.1.9 of session has a bug where the @debug instance
 # variable is not initialized, causing warning messages.  This snippet
@@ -24,6 +25,7 @@ end
 
 class FunctionalTest &lt; Test::Unit::TestCase
   include InEnvironment
+  include TestMethods
 
   RUBY_COMMAND = 'ruby'
 </diff>
      <filename>test/session_functional.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,7 @@ TESTING_REQUIRE = [ ]
 class TestApplication &lt; Test::Unit::TestCase
   include CaptureStdout
   include InEnvironment
+  include TestMethods
 
   def setup
     @app = Rake::Application.new
@@ -148,7 +149,7 @@ class TestApplication &lt; Test::Unit::TestCase
         handle_options
         options.silent = true
       end
-      ex = assert_raise(RuntimeError) do 
+      ex = assert_exception(RuntimeError) do 
         @app.instance_eval do raw_load_rakefile end 
       end
       assert_match(/no rakefile found/i, ex.message)
@@ -279,7 +280,7 @@ class TestApplication &lt; Test::Unit::TestCase
     @app.intern(Rake::Task, &quot;default&quot;).enhance { fail }
     ARGV.clear
     ARGV &lt;&lt; '-f' &lt;&lt; '-s' &lt;&lt;  '--rakelib=&quot;&quot;'
-    assert_raise(SystemExit) {
+    assert_exception(SystemExit) {
       err = capture_stderr { @app.run }
       assert_match(/see full trace/, err)
     }
@@ -291,7 +292,7 @@ class TestApplication &lt; Test::Unit::TestCase
     @app.intern(Rake::Task, &quot;default&quot;).enhance { fail }
     ARGV.clear
     ARGV &lt;&lt; '-f' &lt;&lt; '-s' &lt;&lt; '-t'
-    assert_raise(SystemExit) {
+    assert_exception(SystemExit) {
       err = capture_stderr { capture_stdout { @app.run } }
       assert_no_match(/see full trace/, err)
     }
@@ -303,7 +304,7 @@ class TestApplication &lt; Test::Unit::TestCase
     @app.intern(Rake::Task, &quot;default&quot;).enhance { fail }
     ARGV.clear
     ARGV &lt;&lt; '-f' &lt;&lt; '-s' &lt;&lt; '--xyzzy'
-    assert_raise(SystemExit) {
+    assert_exception(SystemExit) {
       err = capture_stderr { capture_stdout { @app.run } }
     }
   ensure
@@ -315,6 +316,7 @@ end
 ######################################################################
 class TestApplicationOptions &lt; Test::Unit::TestCase
   include CaptureStdout
+  include TestMethods
 
   def setup
     clear_argv
@@ -447,7 +449,7 @@ class TestApplicationOptions &lt; Test::Unit::TestCase
   end
 
   def test_missing_require
-    ex = assert_raises(LoadError) do
+    ex = assert_exception(LoadError) do
       flags(['--require', 'test/missing']) do |opts|
       end
     end
@@ -546,7 +548,7 @@ class TestApplicationOptions &lt; Test::Unit::TestCase
 
   def test_bad_option
     capture_stderr do
-      ex = assert_raise(OptionParser::InvalidOption) do
+      ex = assert_exception(OptionParser::InvalidOption) do
         flags('--bad-option') 
       end
       if ex.message =~ /^While/ # Ruby 1.9 error message</diff>
      <filename>test/test_application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,10 +4,13 @@ require 'test/unit'
 require 'fileutils'
 require 'rake'
 require 'test/filecreation'
+require 'test/rake_test_setup'
 
 ######################################################################
 class TestDefinitions &lt; Test::Unit::TestCase
   include Rake
+  include TestMethods
+  
   EXISTINGFILE = &quot;testdata/existing&quot;
 
   def setup
@@ -58,7 +61,7 @@ class TestDefinitions &lt; Test::Unit::TestCase
 
   def test_missing_dependencies
     task :x =&gt; [&quot;testdata/missing&quot;]
-    assert_raises(RuntimeError) { Task[:x].invoke }
+    assert_exception(RuntimeError) { Task[:x].invoke }
   end
 
   def test_implicit_file_dependencies</diff>
      <filename>test/test_definitions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,11 +4,13 @@ require 'test/unit'
 require 'fileutils'
 require 'rake'
 require 'test/filecreation'
+require 'test/rake_test_setup'
 
 ######################################################################
 class TestFileTask &lt; Test::Unit::TestCase
   include Rake
   include FileCreation
+  include TestMethods
 
   def setup
     Task.clear</diff>
      <filename>test/test_file_task.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,10 +4,12 @@ require 'test/unit'
 require 'rake'
 
 require 'test/capture_stdout'
+require 'test/rake_test_setup'
 
 class TestFileList &lt; Test::Unit::TestCase
   FileList = Rake::FileList
   include CaptureStdout
+  include TestMethods
 
   def setup
     create_test_data
@@ -442,7 +444,7 @@ class TestFileList &lt; Test::Unit::TestCase
     a = FileList['a', 'b', 'c']
     a.freeze
     c = a.clone
-    assert_raise(TypeError, RuntimeError) do
+    assert_exception(TypeError, RuntimeError) do
       c &lt;&lt; 'more'
     end
   end</diff>
      <filename>test/test_filelist.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,9 +5,11 @@ require 'test/unit'
 require 'test/filecreation'
 require 'fileutils'
 require 'stringio'
+require 'test/rake_test_setup'
 
 class TestFileUtils &lt; Test::Unit::TestCase
   include FileCreation
+  include TestMethods
 
   def setup
     File.chmod(0750,&quot;test/shellcommand.rb&quot;)
@@ -81,7 +83,7 @@ class TestFileUtils &lt; Test::Unit::TestCase
   def test_safe_ln_fails_on_script_error
     FileUtils::LN_SUPPORTED[0] = true
     c = BadLink.new(ScriptError)
-    assert_raise(ScriptError) do c.safe_ln &quot;a&quot;, &quot;b&quot; end
+    assert_exception(ScriptError) do c.safe_ln &quot;a&quot;, &quot;b&quot; end
   end
 
   def test_verbose
@@ -114,8 +116,8 @@ class TestFileUtils &lt; Test::Unit::TestCase
 
   def test_fileutils_methods_dont_leak
     obj = Object.new
-    assert_raise(NoMethodError) { obj.copy } # from FileUtils
-    assert_raise(NoMethodError) { obj.ruby } # from RubyFileUtils
+    assert_exception(NoMethodError) { obj.copy } # from FileUtils
+    assert_exception(NoMethodError) { obj.ruby } # from RubyFileUtils
   end
 
   def test_sh
@@ -123,21 +125,35 @@ class TestFileUtils &lt; Test::Unit::TestCase
     assert true, &quot;should not fail&quot;
   end
 
+  # If the :sh method is invoked directly from a test unit instance
+  # (under mini/test), the mini/test version of fail is invoked rather
+  # than the kernel version of fail. So we run :sh from within a
+  # non-test class to avoid the problem.
+  class Sh
+    include FileUtils
+    def run(*args)
+      sh(*args)
+    end
+    def self.run(*args)
+      new.run(*args)
+    end
+  end
+
   def test_sh_multiple_arguments
     ENV['RAKE_TEST_SH'] = 'someval'
     expanded = windows? ? '%RAKE_TEST_SH%' : '$RAKE_TEST_SH'
     # This one gets expanded by the shell
     verbose(false) { sh %{ruby test/check_expansion.rb #{expanded} someval} }
     assert true, &quot;should not fail&quot;
-    assert_raises(RuntimeError) {
+    assert_exception(RuntimeError) {
       # This one does not get expanded
-      verbose(false) { sh 'ruby', 'test/check_expansion.rb', expanded, 'someval' }
+      verbose(false) { Sh.run 'ruby', 'test/check_expansion.rb', expanded, 'someval' }
     }
   end
 
   def test_sh_failure
-    assert_raises(RuntimeError) { 
-      verbose(false) { sh %{ruby test/shellcommand.rb 1} }
+    assert_exception(RuntimeError) { 
+      verbose(false) { Sh.run %{ruby test/shellcommand.rb 1} }
     }
   end
 
@@ -164,7 +180,7 @@ class TestFileUtils &lt; Test::Unit::TestCase
   end
 
   def test_sh_bad_option
-    ex = assert_raise(ArgumentError) {
+    ex = assert_exception(ArgumentError) {
       verbose(false) { sh %{test/shellcommand.rb}, :bad_option=&gt;true }
     }
     assert_match(/bad_option/, ex.message)</diff>
      <filename>test/test_fileutils.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,9 +2,11 @@
 
 require 'test/unit'
 require 'rake'
+require 'test/rake_test_setup'
 
 ######################################################################
 class TestAnEmptyInvocationChain &lt; Test::Unit::TestCase
+  include TestMethods
 
   def setup
     @empty = Rake::InvocationChain::EMPTY
@@ -23,6 +25,8 @@ end
 
 ######################################################################
 class TestAnInvocationChainWithOneMember &lt; Test::Unit::TestCase
+  include TestMethods
+
   def setup
     @empty = Rake::InvocationChain::EMPTY
     @first_member = &quot;A&quot;
@@ -34,7 +38,7 @@ class TestAnInvocationChainWithOneMember &lt; Test::Unit::TestCase
   end
 
   def test_should_fail_when_adding_original_member
-    ex = assert_raise RuntimeError do
+    ex = assert_exception RuntimeError do
       @chain.append(@first_member)
     end
     assert_match(/circular +dependency/i, ex.message)
@@ -49,6 +53,8 @@ end
 
 ######################################################################
 class TestAnInvocationChainWithMultipleMember &lt; Test::Unit::TestCase
+  include TestMethods
+
   def setup
     @first_member = &quot;A&quot;
     @second_member = &quot;B&quot;
@@ -65,7 +71,7 @@ class TestAnInvocationChainWithMultipleMember &lt; Test::Unit::TestCase
   end
 
   def test_should_fail_when_adding_original_member
-    ex = assert_raise RuntimeError do
+    ex = assert_exception RuntimeError do
       @chain.append(@first_member)
     end
     assert_match(/A.*=&gt;.*B.*=&gt;.*A/, ex.message)</diff>
      <filename>test/test_invocation_chain.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,8 +9,10 @@ end
 require 'test/unit'
 require 'flexmock/test_unit'
 require 'rake'
+require 'test/rake_test_setup'
 
 class TestNameSpace &lt; Test::Unit::TestCase
+  include TestMethods
 
   def test_namespace_creation
     mgr = flexmock(&quot;TaskManager&quot;)</diff>
      <filename>test/test_namespace.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,9 +2,11 @@
 
 require 'test/unit'
 require 'rake/packagetask'
+require 'test/rake_test_setup'
 
 class TestPackageTask &lt; Test::Unit::TestCase
   include Rake
+  include TestMethods
 
   def test_create
     pkg = Rake::PackageTask.new(&quot;pkgr&quot;, &quot;1.2.3&quot;) { |p|
@@ -40,7 +42,7 @@ class TestPackageTask &lt; Test::Unit::TestCase
   end
 
   def test_missing_version
-    assert_raises(RuntimeError) {
+    assert_exception(RuntimeError) {
       pkg = Rake::PackageTask.new(&quot;pkgr&quot;) { |p| }
     }
   end</diff>
      <filename>test/test_package_task.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,7 @@ require 'rake'
 
 # ====================================================================
 class TestPathMap &lt; Test::Unit::TestCase
+  include TestMethods
 
   def test_returns_self_with_no_args
     assert_equal &quot;abc.rb&quot;, &quot;abc.rb&quot;.pathmap
@@ -86,7 +87,7 @@ class TestPathMap &lt; Test::Unit::TestCase
   end
 
   def test_undefined_percent_causes_error
-    ex = assert_raise(ArgumentError) {
+    ex = assert_exception(ArgumentError) {
       &quot;dir/abc.rb&quot;.pathmap(&quot;%z&quot;)
     }
   end
@@ -130,7 +131,7 @@ class TestPathMap &lt; Test::Unit::TestCase
   end
 
   def test_pattern_with_invalid_operator
-    ex = assert_raise(ArgumentError) do
+    ex = assert_exception(ArgumentError) do
       &quot;abc.xyz&quot;.pathmap(&quot;%{src,bin}z&quot;)
     end
     assert_match(/unknown.*pathmap.*spec.*z/i, ex.message)</diff>
      <filename>test/test_pathmap.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,9 +2,11 @@
 
 require 'test/unit'
 require 'rake'
+require 'test/rake_test_setup'
 
 # ====================================================================
 class TestRequire &lt; Test::Unit::TestCase
+  include TestMethods
 
   def test_can_load_rake_library
     app = Rake::Application.new
@@ -22,7 +24,7 @@ class TestRequire &lt; Test::Unit::TestCase
 
   def test_throws_error_if_library_not_found
     app = Rake::Application.new
-    ex = assert_raise(LoadError) {
+    ex = assert_exception(LoadError) {
       assert app.instance_eval {
         rake_require(&quot;testx&quot;, ['test/data/rakelib'], [])
       }</diff>
      <filename>test/test_require.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,11 +4,13 @@ require 'test/unit'
 require 'fileutils'
 require 'rake'
 require 'test/filecreation'
+require 'test/rake_test_setup'
 
 ######################################################################
 class TestRules &lt; Test::Unit::TestCase
   include Rake
   include FileCreation
+  include TestMethods
 
   SRCFILE  = &quot;testdata/abc.c&quot;
   SRCFILE2 =  &quot;testdata/xyz.c&quot;
@@ -190,8 +192,8 @@ class TestRules &lt; Test::Unit::TestCase
     rule '.o' =&gt; ['.c'] do |t|
       @runs &lt;&lt; t.name
     end
-    assert_raises(RuntimeError) { Task['testdata/x.obj'].invoke }
-    assert_raises(RuntimeError) { Task['testdata/x.xyo'].invoke }
+    assert_exception(RuntimeError) { Task['testdata/x.obj'].invoke }
+    assert_exception(RuntimeError) { Task['testdata/x.xyo'].invoke }
   end
 
   def test_rule_rebuilds_obj_when_source_is_newer
@@ -332,7 +334,7 @@ class TestRules &lt; Test::Unit::TestCase
       rule &quot;.#{letter}&quot; =&gt; &quot;.#{prev}&quot; do |t| puts &quot;#{t.name}&quot; end
       prev = letter
     end
-    ex = assert_raises(Rake::RuleRecursionOverflowError) {
+    ex = assert_exception(Rake::RuleRecursionOverflowError) {
       Task[&quot;testdata/a.z&quot;].invoke
     }
     assert_match(/a\.z =&gt; testdata\/a.y/, ex.message)
@@ -340,7 +342,7 @@ class TestRules &lt; Test::Unit::TestCase
 
   def test_rules_with_bad_dependents_will_fail
     rule &quot;a&quot; =&gt; [ 1 ] do |t| puts t.name end
-    assert_raise(RuntimeError) do Task['a'].invoke end
+    assert_exception(RuntimeError) do Task['a'].invoke end
   end
 
 end</diff>
      <filename>test/test_rules.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,12 +2,15 @@
 
 require 'test/unit'
 require 'rake'
+require 'test/rake_test_setup'
 
 class TaskManager
   include Rake::TaskManager
 end
 
 class TestTaskManager &lt; Test::Unit::TestCase
+  include TestMethods
+
   def setup
     @tm = TaskManager.new
   end
@@ -68,7 +71,7 @@ class TestTaskManager &lt; Test::Unit::TestCase
   end
 
   def test_name_lookup_with_nonexistent_task
-    assert_raise(RuntimeError) {
+    assert_exception(RuntimeError) {
       t = @tm[&quot;DOES NOT EXIST&quot;]
     }
   end</diff>
      <filename>test/test_task_manager.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,11 +5,13 @@ require 'fileutils'
 require 'rake'
 require 'test/filecreation'
 require 'test/capture_stdout'
+require 'test/rake_test_setup'
 
 ######################################################################
 class TestTask &lt; Test::Unit::TestCase
   include CaptureStdout
   include Rake
+  include TestMethods
 
   def setup
     Task.clear
@@ -48,7 +50,7 @@ class TestTask &lt; Test::Unit::TestCase
     t2 = task(:t2 =&gt; [:t1]) { |t| runlist &lt;&lt; t.name }
     assert_equal [&quot;t2&quot;], t1.prerequisites
     assert_equal [&quot;t1&quot;], t2.prerequisites
-    ex = assert_raise RuntimeError do
+    ex = assert_exception RuntimeError do
       t1.invoke
     end
     assert_match(/circular dependency/i, ex.message)
@@ -121,7 +123,7 @@ class TestTask &lt; Test::Unit::TestCase
   def test_find
     task :tfind
     assert_equal &quot;tfind&quot;, Task[:tfind].name
-    ex = assert_raises(RuntimeError) { Task[:leaves] }
+    ex = assert_exception(RuntimeError) { Task[:leaves] }
     assert_equal &quot;Don't know how to build task 'leaves'&quot;, ex.message
   end
 
@@ -218,6 +220,7 @@ end
 class TestTaskWithArguments &lt; Test::Unit::TestCase
   include CaptureStdout
   include Rake
+  include TestMethods
 
   def setup
     Task.clear
@@ -255,7 +258,7 @@ class TestTaskWithArguments &lt; Test::Unit::TestCase
   end
 
   def test_illegal_keys_in_task_name_hash
-    assert_raise RuntimeError do
+    assert_exception RuntimeError do
       t = task(:t, :x, :y =&gt; 1, :needs =&gt; [:pre])
     end
   end</diff>
      <filename>test/test_tasks.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,6 +5,8 @@ require 'rake/testtask'
 
 class TestTestTask &lt; Test::Unit::TestCase
   include Rake
+  include TestMethods
+  
   def setup
     Task.clear
     ENV.delete('TEST')</diff>
      <filename>test/test_test_task.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,12 +7,14 @@ rescue LoadError
 end
 
 require 'test/unit'
+require 'flexmock/test_unit'
 require 'test/capture_stdout'
+require 'test/rake_test_setup'
 require 'rake'
-require 'flexmock/test_unit'
 
 class TestTopLevelFunctions &lt; Test::Unit::TestCase
   include CaptureStdout
+  include TestMethods
 
   def setup
     super
@@ -79,6 +81,6 @@ class TestTopLevelFunctions &lt; Test::Unit::TestCase
   end
 
   def test_missing_other_constant
-    assert_raise(NameError) do Object.const_missing(:Xyz) end
+    assert_exception(NameError) do Object.const_missing(:Xyz) end
   end
 end</diff>
      <filename>test/test_top_level_functions.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,7 @@ require 'rake'
 
 class TestWin32 &lt; Test::Unit::TestCase
   include InEnvironment
+  include TestMethods
 
   Win32 = Rake::Win32
   
@@ -48,7 +49,7 @@ class TestWin32 &lt; Test::Unit::TestCase
       &quot;HOMEPATH&quot; =&gt; nil,
       &quot;USERPROFILE&quot; =&gt; nil
       ) do
-      assert_raise(Rake::Win32::Win32HomeError) do
+      assert_exception(Rake::Win32::Win32HomeError) do
         Win32.win32_system_dir
       end
     end</diff>
      <filename>test/test_win32.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>publish.rf</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>3c458e28d41df2991a437cdb43d06630b2a30a68</id>
    </parent>
  </parents>
  <author>
    <name>Jim Weirich</name>
    <email>jim.weirich@gmail.com</email>
  </author>
  <url>http://github.com/pragdavespc/rake/commit/e6353df3e74af1725d2a8b3df5ab50031ee62b78</url>
  <id>e6353df3e74af1725d2a8b3df5ab50031ee62b78</id>
  <committed-date>2008-09-25T21:36:12-07:00</committed-date>
  <authored-date>2008-09-25T21:36:12-07:00</authored-date>
  <message>updated tests to run with the latest version of mini-unit</message>
  <tree>6a853305be1aa9f35c1041e839d726991315d9fb</tree>
  <committer>
    <name>Jim Weirich</name>
    <email>jim.weirich@gmail.com</email>
  </committer>
</commit>
