task :create_dir do\r
FileUtils.mkdir_p Rails.root + '/tmp/test'\r
end\r
- \r
+\r
supported_scms = [:subversion, :cvs, :bazaar, :mercurial, :git, :darcs, :filesystem]\r
- \r
+\r
desc "Creates a test subversion repository"\r
task :subversion => :create_dir do\r
repo_path = "tmp/test/subversion_repository"\r
system "svnadmin create #{repo_path}"\r
system "gunzip < test/fixtures/repositories/subversion_repository.dump.gz | svnadmin load #{repo_path}"\r
end\r
- \r
+\r
desc "Creates a test mercurial repository"\r
task :mercurial => :create_dir do\r
repo_path = "tmp/test/mercurial_repository"\r
system "hg init #{repo_path}"\r
system "hg -R #{repo_path} pull #{bundle_path}"\r
end\r
- \r
+\r
(supported_scms - [:subversion, :mercurial]).each do |scm|\r
desc "Creates a test #{scm} repository"\r
task scm => :create_dir do\r
system "tar -xvz -C tmp/test -f test/fixtures/repositories/#{scm}_repository.tar.gz"\r
end\r
end\r
- \r
+\r
desc "Creates all test repositories"\r
task :all => supported_scms\r
end\r
- \r
+\r
desc "Updates installed test repositories"\r
task :update do\r
require 'fileutils'\r
scm = $1\r
next unless fixture = Dir.glob("test/fixtures/repositories/#{scm}_repository.*").first\r
next if File.stat(dir).ctime > File.stat(fixture).mtime\r
- \r
+\r
FileUtils.rm_rf dir\r
Rake::Task["test:scm:setup:#{scm}"].execute\r
end\r
end\r
- \r
+\r
Rake::TestTask.new(:units => "db:test:prepare") do |t|\r
t.libs << "test"\r
t.verbose = true\r
t.test_files = FileList['test/unit/repository*_test.rb'] + FileList['test/unit/lib/redmine/scm/**/*_test.rb']\r
end\r
Rake::Task['test:scm:units'].comment = "Run the scm unit tests"\r
- \r
+\r
Rake::TestTask.new(:functionals => "db:test:prepare") do |t|\r
t.libs << "test"\r
t.verbose = true\r