Merge remote branch 'origin/master'
This commit is contained in:
commit
fbf4e6be59
29
Rakefile
29
Rakefile
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue