test/workbook/worksheet/tc_col.rb in axlsx-1.1.5 vs test/workbook/worksheet/tc_col.rb in axlsx-1.1.6

- old
+ new

@@ -4,10 +4,17 @@ def setup @col = Axlsx::Col.new 1, 1 end + def test_initialize + options = { :width => 12, :collapsed => true, :hidden => true, :outlineLevel => 1, :phonetic => true, :style => 1} + + col = Axlsx::Col.new 0, 0, options + options.each{ |key, value| assert_equal(col.send(key.to_sym), value) } + end + def test_min_max_required assert_raise(ArgumentError, 'min and max must be specified when creating a new column') { Axlsx::Col.new } assert_raise(ArgumentError, 'min and max must be specified when creating a new column') { Axlsx::Col.new nil, nil } assert_nothing_raised { Axlsx::Col.new 1, 1 } end @@ -51,9 +58,11 @@ assert_nothing_raised(ArgumentError, 'phonetic must be boolean(ish)') { @col.phonetic = true } end def test_style assert_equal(@col.style, nil) + @col.style = 1 + assert_equal(@col.style, 1) #TODO check that the style specified is actually in the styles xfs collection end end