/vendor/gems/facets-2.4.5/test/more/test_bbcode.rb
Ruby | 21 lines | 14 code | 6 blank | 1 comment | 0 complexity | e1bca968d1286d30180e549653604005 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
- # Test for facets/bbcode.rb
- require 'facets/bbcode.rb'
- require 'test/unit'
- class TC_BBCode < Test::Unit::TestCase
- def test_to_ansi
- str = "this is [COLOR=red]red[/COLOR], this is [B]bold[/B]"
- out = "this is \e[0;31mred\e[0m, this is \e[1mbold\e[0m\n"
- assert_equal( out, BBCode.bbcode_to_ansi(str) )
- end
- def test_to_html
- str = "this is [COLOR=red]red[/COLOR], this is [B]bold[/B]"
- out = "this is <font color=\"red\">red</font>, this is <strong>bold</strong><br />\n"
- assert_equal( out, BBCode.bbcode_to_html(str) )
- end
- end