1
1
namespace :test do
2
-
2
+
3
3
desc 'run all sample tests'
4
4
task :samples do
5
5
ruby './sample/suite.rb'
6
6
end
7
-
7
+
8
8
desc 'run functional tests'
9
9
task :functional do
10
10
ruby './test/functional/suite.rb'
11
11
ruby './test/functional/for_redcloth.rb'
12
12
end
13
-
13
+
14
14
desc 'run unit tests'
15
15
task :units do
16
16
ruby './test/unit/suite.rb'
17
17
end
18
-
18
+
19
19
scanner_suite = 'test/scanners/suite.rb'
20
20
task scanner_suite do
21
21
unless File . exist? scanner_suite
22
- puts 'Scanner tests not found; downloading from Subversion ...'
23
- sh 'svn co http ://svn. rubychan.de /coderay-scanner-tests/trunk/ test/scanners/'
22
+ puts 'Scanner tests not found; downloading from GitHub ...'
23
+ sh 'git clone https ://github.com/ rubychan/coderay-scanner-tests.git test/scanners/'
24
24
puts 'Finished.'
25
25
end
26
26
end
27
-
27
+
28
28
desc 'run all scanner tests'
29
29
task :scanners => :update_scanner_suite do
30
30
ruby scanner_suite
31
31
end
32
-
33
- desc 'update scanner test suite from SVN '
32
+
33
+ desc 'update scanner test suite from GitHub '
34
34
task :update_scanner_suite => scanner_suite do
35
- sh "svn up #{ File . dirname ( scanner_suite ) } "
35
+ Dir . chdir ( File . dirname ( scanner_suite ) ) do
36
+ sh "git pull"
37
+ end
36
38
end
37
-
39
+
38
40
namespace :scanner do
39
41
Dir [ './test/scanners/*' ] . each do |scanner |
40
42
next unless File . directory? scanner
@@ -45,7 +47,7 @@ namespace :test do
45
47
end
46
48
end
47
49
end
48
-
50
+
49
51
desc 'clean test output files'
50
52
task :clean do
51
53
for file in Dir [ 'test/scanners/**/*.actual.*' ]
@@ -61,7 +63,7 @@ namespace :test do
61
63
rm file
62
64
end
63
65
end
64
-
66
+
65
67
desc 'test the CodeRay executable'
66
68
task :exe do
67
69
if RUBY_VERSION >= '1.8.7'
@@ -72,7 +74,7 @@ namespace :test do
72
74
puts "Skipping."
73
75
end
74
76
end
75
-
77
+
76
78
end
77
79
78
80
task :test => %w( test:functional test:units test:exe )
0 commit comments