Sha256: e90a8c227e2f44033695c9edacc390e9ba4793a105048a1879577f38a1b758bc

Contents?: true

Size: 389 Bytes

Versions: 14

Compression:

Stored size: 389 Bytes

Contents

require 'test/unit'
require 'facets/ansicode'

class TestANSICode < Test::Unit::TestCase

  include ANSICode

  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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
facets-2.8.4 test/more/test_ansicode.rb
facets-2.8.3 test/more/test_ansicode.rb
facets-2.8.2 test/more/test_ansicode.rb
facets-2.8.1 test/more/test_ansicode.rb
facets-2.8.0 test/more/test_ansicode.rb
facets-2.7.0 test/more/test_ansicode.rb
facets-2.6.0 test/more/test_ansicode.rb
facets-2.4.4 test/more/test_ansicode.rb
facets-2.4.2 test/more/test_ansicode.rb
facets-2.4.3 test/more/test_ansicode.rb
facets-2.5.1 test/more/test_ansicode.rb
facets-2.5.0 test/more/test_ansicode.rb
facets-2.4.5 test/more/test_ansicode.rb
facets-2.5.2 test/more/test_ansicode.rb