diff options
-rw-r--r-- | rake_tasks/test.rake | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/rake_tasks/test.rake b/rake_tasks/test.rake index f070ccc..bf01c63 100644 --- a/rake_tasks/test.rake +++ b/rake_tasks/test.rake @@ -1,40 +1,42 @@ namespace :test do - + desc 'run all sample tests' task :samples do ruby './sample/suite.rb' end - + desc 'run functional tests' task :functional do ruby './test/functional/suite.rb' ruby './test/functional/for_redcloth.rb' end - + desc 'run unit tests' task :units do ruby './test/unit/suite.rb' end - + scanner_suite = 'test/scanners/suite.rb' task scanner_suite do unless File.exist? scanner_suite - puts 'Scanner tests not found; downloading from Subversion...' - sh 'svn co http://svn.rubychan.de/coderay-scanner-tests/trunk/ test/scanners/' + puts 'Scanner tests not found; downloading from GitHub...' + sh 'git clone https://github.com/rubychan/coderay-scanner-tests.git test/scanners/' puts 'Finished.' end end - + desc 'run all scanner tests' task :scanners => :update_scanner_suite do ruby scanner_suite end - - desc 'update scanner test suite from SVN' + + desc 'update scanner test suite from GitHub' task :update_scanner_suite => scanner_suite do - sh "svn up #{File.dirname(scanner_suite)}" + Dir.chdir(File.dirname(scanner_suite)) do + sh "git pull" + end end - + namespace :scanner do Dir['./test/scanners/*'].each do |scanner| next unless File.directory? scanner @@ -45,7 +47,7 @@ namespace :test do end end end - + desc 'clean test output files' task :clean do for file in Dir['test/scanners/**/*.actual.*'] @@ -61,7 +63,7 @@ namespace :test do rm file end end - + desc 'test the CodeRay executable' task :exe do if RUBY_VERSION >= '1.8.7' @@ -72,7 +74,7 @@ namespace :test do puts "Skipping." end end - + end task :test => %w(test:functional test:units test:exe) |