Sha256: 884d1bda7a2382b9ef75d9419fe4f82a3f461fae8a3295eccaf060d26b88853d

Contents?: true

Size: 777 Bytes

Versions: 7

Compression:

Stored size: 777 Bytes

Contents

require 'test/unit'
require 'axlsx.rb'

class TestColor < Test::Unit::TestCase

  def setup    
    @item = Axlsx::Color.new
  end

  def teardown
  end

  def test_initialiation
    assert_equal(@item.auto, nil)
    assert_equal(@item.rgb, nil)
    assert_equal(@item.tint, nil)
  end

  def test_auto
    assert_raise(ArgumentError) { @item.auto = -1 }
    assert_nothing_raised { @item.auto = true }
    assert_equal(@item.auto, true )
  end

  def test_rgb
    assert_raise(ArgumentError) { @item.rgb = -1 }
    assert_nothing_raised { @item.rgb = "FF00FF00" }
    assert_equal(@item.rgb, "FF00FF00" )
  end

  def test_tint
    assert_raise(ArgumentError) { @item.tint = -1 }
    assert_nothing_raised { @item.tint = -1.0 }
    assert_equal(@item.tint, -1.0 )
  end


end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
axlsx-1.0.7 test/stylesheet/tc_color.rb~
axlsx-1.0.6 test/stylesheet/tc_color.rb~
axlsx-1.0.5 test/stylesheet/tc_color.rb~
axlsx-1.0.4 test/stylesheet/tc_color.rb~
axlsx-1.0.3 test/stylesheet/tc_color.rb~
axlsx-1.0.1 test/stylesheet/tc_color.rb~
axlsx-1.0.0 test/stylesheet/tc_color.rb~