2011-03-20 20:23:11 +00:00
|
|
|
require File.expand_path('../helper', __FILE__)
|
|
|
|
|
|
|
|
class RoccoDocblockAnnotationsTest < Test::Unit::TestCase
|
2011-04-19 17:54:42 +00:00
|
|
|
def test_basics
|
2011-03-20 20:23:11 +00:00
|
|
|
r = Rocco.new( 'test', '', { :language => "c", :docblocks => true } ) { "" } # Generate throwaway instance so I can test `parse`
|
|
|
|
assert_equal(
|
|
|
|
[
|
|
|
|
"Comment\n\n> **param** mixed foo \n> **return** void "
|
|
|
|
],
|
|
|
|
r.docblock( ["Comment\n\n@param mixed foo\n@return void"] )
|
|
|
|
)
|
|
|
|
end
|
2011-04-19 17:54:42 +00:00
|
|
|
def test_highlighted_in_blocks
|
|
|
|
r = Rocco.new( 'test', '', { :language => "c", :docblocks => true } ) { "" } # Generate throwaway instance so I can test `parse`
|
|
|
|
highlighted = r.highlight( r.split( r.parse( "/**\n * Comment\n * @param type name\n */\ndef codeblock\nend\n" ) ) )
|
|
|
|
|
|
|
|
assert_equal(
|
|
|
|
"<p>Comment</p>\n\n<blockquote><p><strong>param</strong> type name</p></blockquote>\n",
|
|
|
|
highlighted[0][0]
|
|
|
|
)
|
|
|
|
end
|
2011-03-20 20:23:11 +00:00
|
|
|
end
|