Add colorize_without_wrapper

This commit is contained in:
Joshua Peek
2011-05-20 14:11:15 -05:00
parent bebae09fde
commit a94e06ac4d
6 changed files with 49 additions and 1 deletions

View File

@@ -179,4 +179,11 @@ class TestBlob < Test::Unit::TestCase
</div>
HTML
end
def test_colorize_without_wrapper
assert_equal <<-HTML, blob("foo.rb").colorize_without_wrapper
<span class="k">module</span> <span class="nn">Foo</span>
<span class="k">end</span>
HTML
end
end

View File

@@ -111,4 +111,16 @@ class TestLanguage < Test::Unit::TestCase
</div>
HTML
end
def test_colorize_without_wrapper
assert_equal <<-HTML, Language['Text'].colorize_without_wrapper("Hello")
Hello
HTML
assert_equal <<-HTML, Language['Ruby'].colorize_without_wrapper("def foo\n 'foo'\nend\n")
<span class="k">def</span> <span class="nf">foo</span>
<span class="s1">&#39;foo&#39;</span>
<span class="k">end</span>
HTML
end
end

View File

@@ -50,4 +50,16 @@ class TestLexer < Test::Unit::TestCase
</div>
HTML
end
def test_colorize_without_wrapper
assert_equal <<-HTML, Lexer['Text only'].colorize_without_wrapper("Hello")
Hello
HTML
assert_equal <<-HTML, Lexer['Ruby'].colorize_without_wrapper("def foo\n 'foo'\nend\n")
<span class="k">def</span> <span class="nf">foo</span>
<span class="s1">&#39;foo&#39;</span>
<span class="k">end</span>
HTML
end
end