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.43.0 test/rbbt/util/test_colorize.rb
rbbt-util-5.42.0 test/rbbt/util/test_colorize.rb
rbbt-util-5.41.1 test/rbbt/util/test_colorize.rb
rbbt-util-5.41.0 test/rbbt/util/test_colorize.rb
rbbt-util-5.40.5 test/rbbt/util/test_colorize.rb
rbbt-util-5.40.4 test/rbbt/util/test_colorize.rb
rbbt-util-5.40.3 test/rbbt/util/test_colorize.rb
rbbt-util-5.40.0 test/rbbt/util/test_colorize.rb
rbbt-util-5.39.0 test/rbbt/util/test_colorize.rb
rbbt-util-5.38.1 test/rbbt/util/test_colorize.rb
rbbt-util-5.38.0 test/rbbt/util/test_colorize.rb
rbbt-util-5.37.16 test/rbbt/util/test_colorize.rb
rbbt-util-5.37.15 test/rbbt/util/test_colorize.rb
rbbt-util-5.37.14 test/rbbt/util/test_colorize.rb
rbbt-util-5.37.13 test/rbbt/util/test_colorize.rb
rbbt-util-5.37.12 test/rbbt/util/test_colorize.rb
rbbt-util-5.37.11 test/rbbt/util/test_colorize.rb
rbbt-util-5.37.10 test/rbbt/util/test_colorize.rb
rbbt-util-5.37.9 test/rbbt/util/test_colorize.rb
rbbt-util-5.37.8 test/rbbt/util/test_colorize.rb