diff options
author | murphy <murphy@rubychan.de> | 2008-08-28 06:32:34 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2008-08-28 06:32:34 +0000 |
commit | 28fac2774ecfe248013f02c43ca78b90d0b20b23 (patch) | |
tree | d2ca96ed5aa8d4f3bff58f629a3aea841f3babe1 /test | |
parent | 03ffb9431e140e09e5f1a7ae6c2d582c1895554e (diff) | |
download | coderay-28fac2774ecfe248013f02c43ca78b90d0b20b23.tar.gz |
Fixed coderay/for_redcloth escaping.
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/basic.rb | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/functional/basic.rb b/test/functional/basic.rb index 2880c77..9862f77 100755 --- a/test/functional/basic.rb +++ b/test/functional/basic.rb @@ -37,8 +37,29 @@ class BasicTest < Test::Unit::TestCase def test_for_redcloth require 'rubygems' require 'coderay/for_redcloth' - assert_equal '<p><span lang="ruby" class="CodeRay">puts <span style="background-color:#fff0f0"><span style="color:#710">"</span><span style="color:#D20">Hello, World!</span><span style="color:#710">"</span></span></span></p>', + assert_equal '<p><span lang="ruby" class="CodeRay">puts <span style="background-color:#fff0f0"><span style="color:#710">"</span><span style="color:#D20">Hello, World!</span><span style="color:#710">"</span></span></span></p>', RedCloth.new('@[ruby]puts "Hello, World!"@').to_html + assert_equal <<-BLOCKCODE.chomp, +<div lang="ruby" class="CodeRay"> + <div class="code"><pre>puts <span style="background-color:#fff0f0"><span style="color:#710">"</span><span style="color:#D20">Hello, World!</span><span style="color:#710">"</span></span></pre></div> +</div> +</pre> +BLOCKCODE + RedCloth.new('bc[ruby]. puts "Hello, World!"').to_html + end + + def test_for_redcloth_escapes + require 'rubygems' + require 'coderay/for_redcloth' + assert_equal '<p><span lang="ruby" class="CodeRay">></span></p>', + RedCloth.new('@[ruby]>@').to_html + assert_equal <<-BLOCKCODE.chomp, +<div lang="ruby" class="CodeRay"> + <div class="code"><pre>&</pre></div> +</div> +</pre> +BLOCKCODE + RedCloth.new('bc[ruby]. &').to_html end ENCODERS_LIST = %w( |