From e02e77aa91fcde649075e61b7f5e0d8a766481f6 Mon Sep 17 00:00:00 2001 From: Nathan Weizenbaum Date: Tue, 2 Mar 2010 15:50:42 -0800 Subject: [PATCH] Have RunCodeRun test against Rails v2.3.5 with rails_xss enabled. --- Rakefile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Rakefile b/Rakefile index e7aa4344..93c78cc7 100644 --- a/Rakefile +++ b/Rakefile @@ -333,23 +333,30 @@ rails_versions = [ ] 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 desc "Test all supported versions of rails. This takes a while." task :rails_compatibility do `rm -rf test/rails` 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 - rails_versions.each do |version| - Dir.chdir "test/rails" do - `git checkout #{version}` - end - puts "Testing Rails #{version}" - Rake::Task['test'].reenable - Rake::Task['test'].execute - end + rails_versions.each {|version| test_rails_version version} + + puts "Checking out rails_xss. Please wait." + system("git clone git://github.com/NZKoz/rails_xss.git test/plugins/rails_xss") + test_rails_version(rails_versions.find {|s| s =~ /^v2\.3/}) ensure `rm -rf test/rails` + `rm -rf test/plugins` end end end