Sha256: 6f16cd98336e9e3e4d44d665f09fe7517742c701ce140ce1e0b214c00c206479

Contents?: true

Size: 642 Bytes

Versions: 7

Compression:

Stored size: 642 Bytes

Contents

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

class TestNumFmt < Test::Unit::TestCase

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

  def teardown
  end


  def test_initialiation
    assert_equal(@item.color.rgb, "FFFF0000")
    assert_equal(@item.position, 1.0)
  end

  def test_position
    assert_raise(ArgumentError) { @item.position = -1.1 }
    assert_nothing_raised { @item.position = 0.0 }
    assert_equal(@item.position, 0.0)
  end

  def test_color
    assert_raise(ArgumentError) { @item.color = nil }
    color = Axlsx::Color.new(:rgb=>"FF0000FF")
    @item.color = color
    assert_equal(@item.color.rgb, "FF0000FF")
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

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