Sha256: 43aa719ea95055383364958ad4da8a999e4cce256bc46b16a9160d1b8892670b

Contents?: true

Size: 530 Bytes

Versions: 1

Compression:

Stored size: 530 Bytes

Contents

require 'test/unit'

require 'mega/bbcode'


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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mega-0.3.1 test/tc_bbcode.rb