# Patch for https://github.com/jimweirich/rake/issues/51

if Rake::VERSION == "0.9.2" && RUBY_VERSION == "1.9.3"
  %w[ units functionals integration ].each do |name|
    path = name.sub(/s$/, "")

    task("test:#{name}").clear_actions

    Rake::TestTask.new("test:#{name}") do |t|
      t.libs << "test"
      t.test_files = Dir["test/#{path}/**/*_test.rb"]
    end
  end
end

Patch rake test for Ruby 1.9.3 and Rake 0.9.2.
Patch rake test for Ruby 1.9.3 and Rake 0.9.2.

Ruby 1.9.3, especially with patches, is so much faster to start than 1.9.2, but
the changes in the test libraries mean that Rake-defined test tasks don't work
prior to Rake 0.9.2.2. Alas, we're obliged by Passenger to use the same version
of Rake in all apps, namely 0.9.2.

This patch redefines the test tasks to work iff the Ruby and Rake versions are
this known-bad combination. In all other cases, it does nothing.

See https://github.com/jimweirich/rake/issues/51
