summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormurphy <murphy@rubychan.de>2009-02-18 19:39:26 +0000
committermurphy <murphy@rubychan.de>2009-02-18 19:39:26 +0000
commitdf8bccf987e636d442e43f8c704d750f6519bd3f (patch)
tree392bef3e25fc876b94bb5cc552033f3d9e24d5d3 /test
parent89c23fd2685f0a99993877ad7a0a576d56e75c62 (diff)
downloadcoderay-df8bccf987e636d442e43f8c704d750f6519bd3f.tar.gz
Fixed a bug in for_redcloth.rb (closes #87).
* No more closing PRE tags in RedCloth output. * Added j, j19, and test:functional:all tasks.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/basic.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/test/functional/basic.rb b/test/functional/basic.rb
index d629bd5..d2bc9f1 100755
--- a/test/functional/basic.rb
+++ b/test/functional/basic.rb
@@ -48,11 +48,30 @@ class BasicTest < Test::Unit::TestCase
<div lang="ruby" class="CodeRay">
<div class="code"><pre>puts <span style="background-color:#fff0f0;color:#D20"><span style="color:#710">&quot;</span><span style="">Hello, World!</span><span style="color:#710">&quot;</span></span></pre></div>
</div>
-</pre>
BLOCKCODE
RedCloth.new('bc[ruby]. puts "Hello, World!"').to_html
end
+ def test_for_redcloth_no_lang
+ require 'rubygems'
+ require 'coderay/for_redcloth'
+ assert_equal "<p><code>puts \"Hello, World!\"</code></p>",
+ RedCloth.new('@puts "Hello, World!"@').to_html
+ assert_equal <<-BLOCKCODE.chomp,
+<pre><code>puts \"Hello, World!\"</code></pre>
+ BLOCKCODE
+ RedCloth.new('bc. puts "Hello, World!"').to_html
+ end
+
+ def test_for_redcloth_style
+ require 'rubygems'
+ require 'coderay/for_redcloth'
+ assert_equal <<-BLOCKCODE.chomp,
+<pre style=\"color: red;\"><code style=\"color: red;\">puts \"Hello, World!\"</code></pre>
+ BLOCKCODE
+ RedCloth.new('bc{color: red}. puts "Hello, World!"').to_html
+ end
+
def test_for_redcloth_escapes
require 'rubygems'
require 'coderay/for_redcloth'
@@ -62,7 +81,6 @@ class BasicTest < Test::Unit::TestCase
<div lang="ruby" class="CodeRay">
<div class="code"><pre>&amp;</pre></div>
</div>
-</pre>
BLOCKCODE
RedCloth.new('bc[ruby]. &').to_html
end