Merge remote branch 'origin/master'

This commit is contained in:
Nathan Weizenbaum 2010-03-06 14:45:45 -08:00
commit fbf4e6be59
1 changed files with 18 additions and 11 deletions

View File

@ -348,29 +348,36 @@ rescue LoadError; end
# ----- Testing Multiple Rails Versions ----- # ----- Testing Multiple Rails Versions -----
rails_versions = [ rails_versions = [
"v2.3.4", "v2.3.5",
"v2.2.2", "v2.2.3",
"v2.1.2", "v2.1.2",
] ]
rails_versions << "v2.0.5" if RUBY_VERSION =~ /^1\.8/ rails_versions << "v2.0.5" if RUBY_VERSION =~ /^1\.8/
def test_rails_version(version)
Dir.chdir "test/rails" do
`git checkout #{version}`
end
puts "Testing Rails #{version}"
Rake::Task['test'].reenable
Rake::Task['test'].execute
end
namespace :test do namespace :test do
desc "Test all supported versions of rails. This takes a while." desc "Test all supported versions of rails. This takes a while."
task :rails_compatibility do task :rails_compatibility do
`rm -rf test/rails` `rm -rf test/rails`
puts "Checking out rails. Please wait." puts "Checking out rails. Please wait."
`git clone git://github.com/rails/rails.git test/rails` rescue nil system("git clone git://github.com/rails/rails.git test/rails") rescue nil
begin begin
rails_versions.each do |version| rails_versions.each {|version| test_rails_version version}
Dir.chdir "test/rails" do
`git checkout #{version}` puts "Checking out rails_xss. Please wait."
end system("git clone git://github.com/NZKoz/rails_xss.git test/plugins/rails_xss")
puts "Testing Rails #{version}" test_rails_version(rails_versions.find {|s| s =~ /^v2\.3/})
Rake::Task['test'].reenable
Rake::Task['test'].execute
end
ensure ensure
`rm -rf test/rails` `rm -rf test/rails`
`rm -rf test/plugins`
end end
end end
end end