diff --git a/test/fluxbb_test.rb b/test/fluxbb_test.rb index 2be1cce..59db167 100644 --- a/test/fluxbb_test.rb +++ b/test/fluxbb_test.rb @@ -11,9 +11,22 @@ def fluxbb_tags :tag_param_tokens => [{:token => :alt_text, :prefix => ' alt="', :postfix => '"'}], :tag_param_description => 'The img bbcode takes alt text as a parameter' ), + :h => { + :html_open => "\n### ", :html_close => "\n", + :newlines => :to_br, + :description => 'Make a heading', + :example => '[h]My Heading[/h].'} } end + def test_heading + assert_equal "\n### My Heading\n", "[h]My Heading[/h]".bbcode_to_md(false, fluxbb_tags) + end + + def test_heading_on_two_lines + assert_equal "\n### My Heading
on two lines\n", "[h]My Heading\non two lines[/h]".bbcode_to_md(false, fluxbb_tags) + end + def test_image_with_alt_text assert_equal 'FluxBB allows alt text', '[img=FluxBB allows alt text]http://www.ruby-lang.org/images/header-ruby-logo.png[/img]'.bbcode_to_md(false, fluxbb_tags)