diff options
author | murphy <murphy@rubychan.de> | 2009-04-20 21:14:35 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2009-04-20 21:14:35 +0000 |
commit | d9d447e4d8c09943dc7832cdc921be7f2039471e (patch) | |
tree | f55b3838e28f678dba431738144f0e63baaf2804 /test/functional | |
parent | 04e1ddf7e29af75c9b90da3153c77de6166d0ec7 (diff) | |
download | coderay-d9d447e4d8c09943dc7832cdc921be7f2039471e.tar.gz |
Fixed some test suite problems.
* coderay_suite: UTF-8 output is compared as binary.
* functional tests: cleaned up.
* test/unit: prevent Ruby 1.9 warning about circular require.
Diffstat (limited to 'test/functional')
-rwxr-xr-x | test/functional/basic.rb | 31 | ||||
-rwxr-xr-x | test/functional/suite.rb | 2 |
2 files changed, 15 insertions, 18 deletions
diff --git a/test/functional/basic.rb b/test/functional/basic.rb index d2bc9f1..394d525 100755 --- a/test/functional/basic.rb +++ b/test/functional/basic.rb @@ -2,9 +2,10 @@ require "test/unit" require "coderay" class BasicTest < Test::Unit::TestCase + def test_version assert_nothing_raised do - CodeRay::VERSION + assert_match(/\A\d\.\d\.\d\z/, CodeRay::VERSION) end end @@ -38,7 +39,7 @@ class BasicTest < Test::Unit::TestCase require 'rubygems' gem 'RedCloth', '>= 4.0.3' rescue nil require 'redcloth' - + def test_for_redcloth require 'rubygems' require 'coderay/for_redcloth' @@ -51,7 +52,7 @@ class BasicTest < Test::Unit::TestCase BLOCKCODE RedCloth.new('bc[ruby]. puts "Hello, World!"').to_html end - + def test_for_redcloth_no_lang require 'rubygems' require 'coderay/for_redcloth' @@ -62,7 +63,7 @@ class BasicTest < Test::Unit::TestCase BLOCKCODE RedCloth.new('bc. puts "Hello, World!"').to_html end - + def test_for_redcloth_style require 'rubygems' require 'coderay/for_redcloth' @@ -71,7 +72,7 @@ class BasicTest < Test::Unit::TestCase BLOCKCODE RedCloth.new('bc{color: red}. puts "Hello, World!"').to_html end - + def test_for_redcloth_escapes require 'rubygems' require 'coderay/for_redcloth' @@ -88,18 +89,14 @@ class BasicTest < Test::Unit::TestCase $stderr.puts 'RedCloth not found.' end - ENCODERS_LIST = %w( - count debug div html null page span statistic text tokens xml yaml - ) - def _test_list_of_encoders - assert_equal(ENCODERS_LIST, CodeRay::Encoders.list.sort) + def test_list_of_encoders + assert_kind_of(Array, CodeRay::Encoders.list) + assert CodeRay::Encoders.list.include?('count') end - - SCANNERS_LIST = %w( - c debug delphi html nitro_xhtml plaintext rhtml ruby xml - ) - def _test_list_of_scanners - assert_equal(SCANNERS_LIST, CodeRay::Scanners.list.sort) + + def test_list_of_scanners + assert_kind_of(Array, CodeRay::Scanners.list) + assert CodeRay::Scanners.list.include?('plaintext') end - + end diff --git a/test/functional/suite.rb b/test/functional/suite.rb index e187677..6c6d625 100755 --- a/test/functional/suite.rb +++ b/test/functional/suite.rb @@ -6,4 +6,4 @@ LIBDIR = Pathname.new(MYDIR).join('..', '..', 'lib').cleanpath.to_s $LOAD_PATH.unshift MYDIR, LIBDIR require 'basic' -require 'word_list'
\ No newline at end of file +require 'word_list' |