# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/mega/ansicolor.rb # # Extracted Fri Oct 28 14:20:18 EDT 2005 # Unit Tools Reap Test Extractor # require 'mega/ansicolor.rb' require 'test/unit' class TC_ANSIColor < Test::Unit::TestCase include ANSIColor def test_methods str = red + "Hello" + blue + "World" out = "\e[31mHello\e[34mWorld" assert_equal( out, str ) end def test_blocks str = red { "Hello" } + blue { "World" } out = "\e[31mHello\e[0m\e[34mWorld\e[0m" assert_equal( out, str ) end end