Sha256: b8bfb52bf542ce98ec307e5ad42ce4f3adf87b08fae81651803345690a72979e

Contents?: true

Size: 764 Bytes

Versions: 19

Compression:

Stored size: 764 Bytes

Contents

require 'tc_helper.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, "FF000000")
    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

19 entries across 19 versions & 1 rubygems

Version Path
axlsx-1.3.6 test/stylesheet/tc_color.rb
axlsx-1.3.5 test/stylesheet/tc_color.rb
axlsx-1.3.4 test/stylesheet/tc_color.rb
axlsx-1.3.3 test/stylesheet/tc_color.rb
axlsx-1.3.2 test/stylesheet/tc_color.rb
axlsx-1.3.1 test/stylesheet/tc_color.rb
axlsx-1.2.3 test/stylesheet/tc_color.rb
axlsx-1.2.2 test/stylesheet/tc_color.rb
axlsx-1.2.1 test/stylesheet/tc_color.rb
axlsx-1.2.0 test/stylesheet/tc_color.rb
axlsx-1.1.8 test/stylesheet/tc_color.rb
axlsx-1.1.7 test/stylesheet/tc_color.rb
axlsx-1.1.6 test/stylesheet/tc_color.rb
axlsx-1.1.5 test/stylesheet/tc_color.rb
axlsx-1.1.4 test/stylesheet/tc_color.rb
axlsx-1.1.3 test/stylesheet/tc_color.rb
axlsx-1.1.2 test/stylesheet/tc_color.rb
axlsx-1.1.1 test/stylesheet/tc_color.rb
axlsx-1.1.0 test/stylesheet/tc_color.rb