Skip to content

Commit

Permalink
Have RunCodeRun test against Rails v2.3.5 with rails_xss enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Mar 2, 2010
1 parent 134431b commit e02e77a
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions Rakefile
Expand Up @@ -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
Expand Down

0 comments on commit e02e77a

Please sign in to comment.