summaryrefslogtreecommitdiff
path: root/test/unit/suite.rb
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2010-06-29 06:32:30 +0000
committermurphy <murphy@rubychan.de>2010-06-29 06:32:30 +0000
commit93dfad17309f46d00d1043592efdb282d13963fe (patch)
tree60cbfc2fbc3497f95f5d02de1e9ec8c7b10515ff /test/unit/suite.rb
parent87764c224cc8c808688e83d7c1f93c8dbbbd9b4f (diff)
downloadcoderay-93dfad17309f46d00d1043592efdb282d13963fe.tar.gz
Added lots of unit tests.
Theses actually come from the library files; now they are included. Also, rake test and test:all don't test the scanners now; you have to start them using rake test:scanners.
Diffstat (limited to 'test/unit/suite.rb')
-rwxr-xr-xtest/unit/suite.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/suite.rb b/test/unit/suite.rb
new file mode 100755
index 0000000..845c5b2
--- /dev/null
+++ b/test/unit/suite.rb
@@ -0,0 +1,13 @@
+require 'test/unit'
+$:.unshift 'lib'
+
+MYDIR = File.dirname(__FILE__)
+suite = Dir[File.join(MYDIR, '*.rb')].
+ map { |tc| File.basename(tc).sub(/\.rb$/, '') } - %w'suite vhdl'
+
+puts "Running CodeRay unit tests: #{suite.join(', ')}"
+
+helpers = %w(file_type word_list tokens)
+for test_case in helpers + (suite - helpers)
+ load File.join(MYDIR, test_case + '.rb')
+end