diff options
author | Kornelius Kalnbach <murphy@rubychan.de> | 2012-10-28 14:22:57 -0700 |
---|---|---|
committer | Kornelius Kalnbach <murphy@rubychan.de> | 2012-10-28 14:22:57 -0700 |
commit | cab119c814b3470a7dd3e8079df0d95f9151da42 (patch) | |
tree | 1fba5985c1dce7b54507469f5a0b158b1bc62683 | |
parent | 3effca8291ed4941f7b3a1c2088b50274f28aa6f (diff) | |
parent | 2e2eccb75838414747d50984ba4aa363914c806e (diff) | |
download | coderay-cab119c814b3470a7dd3e8079df0d95f9151da42.tar.gz |
Merge pull request #95 from rubychan/suite-git
use github for coderay-test-scanners
-rw-r--r-- | rake_tasks/test.rake | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/rake_tasks/test.rake b/rake_tasks/test.rake index f070ccc..a60699d 100644 --- a/rake_tasks/test.rake +++ b/rake_tasks/test.rake @@ -1,5 +1,4 @@ namespace :test do - desc 'run all sample tests' task :samples do ruby './sample/suite.rb' @@ -17,22 +16,33 @@ namespace :test do 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 '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' - task :update_scanner_suite => scanner_suite do - sh "svn up #{File.dirname(scanner_suite)}" + desc 'update scanner test suite from GitHub' + task :update_scanner_suite do + if File.exist? scanner_suite + Dir.chdir File.dirname(scanner_suite) do + if File.directory? '.git' + puts 'Updating scanner test suite...' + sh 'git pull' + elsif File.directory? '.svn' + raise <<-ERROR +Found the deprecated Subversion scanner test suite in ./#{File.dirname(scanner_suite)}. +Please rename or remove it and run again to use the GitHub repository: + + mv test/scanners test/scanners-old + ERROR + else + raise 'No scanner test suite found.' + end + end + else + puts 'Downloading scanner test suite...' + sh 'git clone https://github.com/rubychan/coderay-scanner-tests.git test/scanners/' + end end namespace :scanner do @@ -72,7 +82,6 @@ namespace :test do puts "Skipping." end end - end task :test => %w(test:functional test:units test:exe) |