Sha256: fc4e693ee1e1590967b77af0290aa0c313a8d5e676d1338c60c94b1da6829dab

Contents?: true

Size: 592 Bytes

Versions: 475

Compression:

Stored size: 592 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
require 'rbbt/util/colorize'
require 'test/unit'

class TestColorize < Test::Unit::TestCase
  def test_color_array
    a = (1..16).to_a

    assert_equal 16, Colorize.distinct(a).length
    assert_equal 16, Colorize.distinct(a).compact.uniq.length
  end

  def test_from_name
    assert Colorize.from_name('wheat') =~ /^#/
    assert Colorize.from_name('green') =~ /^#/
  end

  def test_color_continuous
    a = (1..16).to_a
    assert_equal Colorize.continuous(a).length, Colorize.continuous(a).uniq.length 
  end
end

Version data entries

475 entries across 475 versions & 1 rubygems

Version Path
rbbt-util-5.33.17 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.16 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.15 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.14 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.13 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.12 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.11 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.9 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.8 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.7 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.6 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.5 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.4 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.3 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.2 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.1 test/rbbt/util/test_colorize.rb
rbbt-util-5.33.0 test/rbbt/util/test_colorize.rb
rbbt-util-5.32.30 test/rbbt/util/test_colorize.rb
rbbt-util-5.32.28 test/rbbt/util/test_colorize.rb
rbbt-util-5.32.27 test/rbbt/util/test_colorize.rb