diff options
Diffstat (limited to 'test/functional/basic.rb')
-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( |