summaryrefslogtreecommitdiff
path: root/test/lib
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2011-08-19 03:09:35 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2011-08-19 03:09:35 +0200
commit75bc5455af8c3c3381066aac3d5fff42264cac6f (patch)
tree589d2c912ddd94c517eb794bcdf3257f8348f3c0 /test/lib
parentfdd17b6a09efb275238a3baef275465d31452f2a (diff)
downloadcoderay-75bc5455af8c3c3381066aac3d5fff42264cac6f.tar.gz
Major rewrite of encoders to support IO output; fixed some minor scanner bugs; cleanups; dropped NitroXHTML scanner; improved tests
Diffstat (limited to 'test/lib')
-rw-r--r--test/lib/README1
-rw-r--r--test/lib/assert_warning.rb15
2 files changed, 15 insertions, 1 deletions
diff --git a/test/lib/README b/test/lib/README
index 7d7a0a0..7c41648 100644
--- a/test/lib/README
+++ b/test/lib/README
@@ -1,3 +1,2 @@
Contents:
- test/unit: We need the old Test::Unit for the scanner test suite to work with Ruby 1.9.
-- term/ansicolor: Used for colorful output of the scanner tests. \ No newline at end of file
diff --git a/test/lib/assert_warning.rb b/test/lib/assert_warning.rb
new file mode 100644
index 0000000..828b464
--- /dev/null
+++ b/test/lib/assert_warning.rb
@@ -0,0 +1,15 @@
+class Test::Unit::TestCase
+
+ def assert_warning expected_warning
+ require 'stringio'
+ oldstderr = $stderr
+ $stderr = StringIO.new
+ yield
+ $stderr.rewind
+ given_warning = $stderr.read.chomp
+ assert_equal expected_warning, given_warning
+ ensure
+ $stderr = oldstderr
+ end
+
+end