class TestUnitColorScheme

Public Instance Methods

test_new_with_colors() click to toggle source
# File test-unit-3.3.4/test/test-color-scheme.rb, line 15
def test_new_with_colors
  scheme = Test::Unit::ColorScheme.new(:success => color("blue"),
                                       "failure" => color("green",
                                                          :underline => true))
  assert_equal({
                 "success" => color("blue"),
                 "failure" => color("green", :underline => true),
               },
               scheme.to_hash)
end
test_new_with_spec() click to toggle source
# File test-unit-3.3.4/test/test-color-scheme.rb, line 26
def test_new_with_spec
  scheme = Test::Unit::ColorScheme.new(:success => {
                                         :name => "blue",
                                         :bold => true
                                       },
                                       "failure" => {:name => "green"})
  assert_equal({
                 "success" => color("blue", :bold => true),
                 "failure" => color("green"),
               },
               scheme.to_hash)
end
test_register() click to toggle source
# File test-unit-3.3.4/test/test-color-scheme.rb, line 2
def test_register
  inverted_scheme_spec = {
    "success" => {:name => "red"},
    "failure" => {:name => "green"},
  }
  Test::Unit::ColorScheme["inverted"] = inverted_scheme_spec
  assert_equal({
                 "success" => color("red"),
                 "failure" => color("green"),
               },
               Test::Unit::ColorScheme["inverted"].to_hash)
end

Private Instance Methods

color(name, options={}) click to toggle source
# File test-unit-3.3.4/test/test-color-scheme.rb, line 40
def color(name, options={})
  Test::Unit::Color.new(name, options)
end