axlsx 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +13 -0
- data/lib/axlsx.rb +38 -0
- data/lib/axlsx/content_type/content_type.rb +23 -0
- data/lib/axlsx/content_type/default.rb +32 -0
- data/lib/axlsx/content_type/override.rb +30 -0
- data/lib/axlsx/doc_props/app.rb +148 -0
- data/lib/axlsx/doc_props/core.rb +34 -0
- data/lib/axlsx/drawing/axis.rb +78 -0
- data/lib/axlsx/drawing/bar_3D_chart.rb +138 -0
- data/lib/axlsx/drawing/bar_series.rb +91 -0
- data/lib/axlsx/drawing/cat_axis.rb +58 -0
- data/lib/axlsx/drawing/chart.rb +120 -0
- data/lib/axlsx/drawing/drawing.rb +121 -0
- data/lib/axlsx/drawing/graphic_frame.rb +55 -0
- data/lib/axlsx/drawing/marker.rb +57 -0
- data/lib/axlsx/drawing/pie_3D_chart.rb +59 -0
- data/lib/axlsx/drawing/pie_series.rb +88 -0
- data/lib/axlsx/drawing/scaling.rb +53 -0
- data/lib/axlsx/drawing/series.rb +70 -0
- data/lib/axlsx/drawing/title.rb +69 -0
- data/lib/axlsx/drawing/two_cell_anchor.rb +88 -0
- data/lib/axlsx/drawing/val_axis.rb +34 -0
- data/lib/axlsx/drawing/view_3D.rb +72 -0
- data/lib/axlsx/package.rb +181 -0
- data/lib/axlsx/rels/relationship.rb +43 -0
- data/lib/axlsx/rels/relationships.rb +25 -0
- data/lib/axlsx/stylesheet/border.rb +52 -0
- data/lib/axlsx/stylesheet/border_pr.rb +65 -0
- data/lib/axlsx/stylesheet/cell_alignment.rb +96 -0
- data/lib/axlsx/stylesheet/cell_protection.rb +33 -0
- data/lib/axlsx/stylesheet/cell_style.rb +60 -0
- data/lib/axlsx/stylesheet/color.rb +57 -0
- data/lib/axlsx/stylesheet/fill.rb +31 -0
- data/lib/axlsx/stylesheet/font.rb +128 -0
- data/lib/axlsx/stylesheet/gradient_fill.rb +70 -0
- data/lib/axlsx/stylesheet/gradient_stop.rb +31 -0
- data/lib/axlsx/stylesheet/num_fmt.rb +61 -0
- data/lib/axlsx/stylesheet/pattern_fill.rb +64 -0
- data/lib/axlsx/stylesheet/styles.rb +296 -0
- data/lib/axlsx/stylesheet/table_style.rb +44 -0
- data/lib/axlsx/stylesheet/table_style_element.rb +66 -0
- data/lib/axlsx/stylesheet/table_styles.rb +39 -0
- data/lib/axlsx/stylesheet/xf.rb +117 -0
- data/lib/axlsx/util/constants.rb +189 -0
- data/lib/axlsx/util/simple_typed_list.rb +150 -0
- data/lib/axlsx/util/validators.rb +132 -0
- data/lib/axlsx/workbook/workbook.rb +130 -0
- data/lib/axlsx/workbook/worksheet/cell.rb +184 -0
- data/lib/axlsx/workbook/worksheet/row.rb +92 -0
- data/lib/axlsx/workbook/worksheet/worksheet.rb +194 -0
- data/lib/schema/dc.xsd +118 -0
- data/lib/schema/dcmitype.xsd +50 -0
- data/lib/schema/dcterms.xsd +331 -0
- data/lib/schema/dml-chart.xsd +1499 -0
- data/lib/schema/dml-chartDrawing.xsd +146 -0
- data/lib/schema/dml-compatibility.xsd +14 -0
- data/lib/schema/dml-diagram.xsd +1091 -0
- data/lib/schema/dml-lockedCanvas.xsd +11 -0
- data/lib/schema/dml-main.xsd +3048 -0
- data/lib/schema/dml-picture.xsd +23 -0
- data/lib/schema/dml-spreadsheetDrawing.xsd +185 -0
- data/lib/schema/dml-wordprocessingDrawing.xsd +185 -0
- data/lib/schema/opc-contentTypes.xsd +42 -0
- data/lib/schema/opc-coreProperties.xsd +50 -0
- data/lib/schema/opc-digSig.xsd +49 -0
- data/lib/schema/opc-relationships.xsd +33 -0
- data/lib/schema/pml.xsd +1676 -0
- data/lib/schema/shared-additionalCharacteristics.xsd +28 -0
- data/lib/schema/shared-bibliography.xsd +144 -0
- data/lib/schema/shared-commonSimpleTypes.xsd +166 -0
- data/lib/schema/shared-customXmlDataProperties.xsd +25 -0
- data/lib/schema/shared-customXmlSchemaProperties.xsd +18 -0
- data/lib/schema/shared-documentPropertiesCustom.xsd +59 -0
- data/lib/schema/shared-documentPropertiesExtended.xsd +56 -0
- data/lib/schema/shared-documentPropertiesVariantTypes.xsd +195 -0
- data/lib/schema/shared-math.xsd +582 -0
- data/lib/schema/shared-relationshipReference.xsd +25 -0
- data/lib/schema/sml.xsd +4430 -0
- data/lib/schema/vml-main.xsd +569 -0
- data/lib/schema/vml-officeDrawing.xsd +509 -0
- data/lib/schema/vml-presentationDrawing.xsd +12 -0
- data/lib/schema/vml-spreadsheetDrawing.xsd +108 -0
- data/lib/schema/vml-wordprocessingDrawing.xsd +96 -0
- data/lib/schema/wml.xsd +3644 -0
- data/lib/schema/xml.xsd +117 -0
- data/test/content_type/tc_content_type.rb +81 -0
- data/test/content_type/tc_content_type.rb~ +81 -0
- data/test/content_type/tc_default.rb +40 -0
- data/test/content_type/tc_default.rb~ +40 -0
- data/test/content_type/tc_override.rb +40 -0
- data/test/content_type/tc_override.rb~ +40 -0
- data/test/doc_props/tc_app.rb +19 -0
- data/test/doc_props/tc_app.rb~ +19 -0
- data/test/doc_props/tc_core.rb +34 -0
- data/test/drawing/tc_axis.rb +39 -0
- data/test/drawing/tc_axis.rb~ +0 -0
- data/test/drawing/tc_bar_3D_chart.rb +66 -0
- data/test/drawing/tc_bar_3D_chart.rb~ +4 -0
- data/test/drawing/tc_bar_series.rb +34 -0
- data/test/drawing/tc_bar_series.rb~ +31 -0
- data/test/drawing/tc_cat_axis.rb +32 -0
- data/test/drawing/tc_cat_axis.rb~ +39 -0
- data/test/drawing/tc_chart.rb +59 -0
- data/test/drawing/tc_chart.rb~ +58 -0
- data/test/drawing/tc_drawing.rb +71 -0
- data/test/drawing/tc_graphic_frame.rb +26 -0
- data/test/drawing/tc_graphic_frame.rb~ +21 -0
- data/test/drawing/tc_marker.rb +45 -0
- data/test/drawing/tc_marker.rb~ +26 -0
- data/test/drawing/tc_pie_3D_chart.rb +33 -0
- data/test/drawing/tc_pie_3D_chart.rb~ +58 -0
- data/test/drawing/tc_pie_series.rb +35 -0
- data/test/drawing/tc_pie_series.rb~ +26 -0
- data/test/drawing/tc_scaling.rb +37 -0
- data/test/drawing/tc_scaling.rb~ +45 -0
- data/test/drawing/tc_series.rb +24 -0
- data/test/drawing/tc_series.rb~ +31 -0
- data/test/drawing/tc_title.rb +34 -0
- data/test/drawing/tc_title.rb~ +37 -0
- data/test/drawing/tc_two_cell_anchor.rb +37 -0
- data/test/drawing/tc_two_cell_anchor.rb~ +35 -0
- data/test/drawing/tc_val_axis.rb +20 -0
- data/test/drawing/tc_val_axis.rb~ +32 -0
- data/test/drawing/tc_view_3D.rb +46 -0
- data/test/drawing/tc_view_3D.rb~ +37 -0
- data/test/rels/tc_relationship.rb +16 -0
- data/test/rels/tc_relationship.rb~ +39 -0
- data/test/rels/tc_relationships.rb +32 -0
- data/test/rels/tc_relationships.rb~ +37 -0
- data/test/stylesheet/tc_border.rb +38 -0
- data/test/stylesheet/tc_border.rb~ +31 -0
- data/test/stylesheet/tc_border_pr.rb +33 -0
- data/test/stylesheet/tc_border_pr.rb~ +31 -0
- data/test/stylesheet/tc_cell_alignment.rb +77 -0
- data/test/stylesheet/tc_cell_alignment.rb~ +38 -0
- data/test/stylesheet/tc_cell_protection.rb +30 -0
- data/test/stylesheet/tc_cell_protection.rb~ +77 -0
- data/test/stylesheet/tc_cell_style.rb +58 -0
- data/test/stylesheet/tc_cell_style.rb~ +30 -0
- data/test/stylesheet/tc_color.rb +38 -0
- data/test/stylesheet/tc_color.rb~ +38 -0
- data/test/stylesheet/tc_fill.rb +19 -0
- data/test/stylesheet/tc_fill.rb~ +19 -0
- data/test/stylesheet/tc_font.rb +114 -0
- data/test/stylesheet/tc_font.rb~ +19 -0
- data/test/stylesheet/tc_gradient_fill.rb +65 -0
- data/test/stylesheet/tc_gradient_fill.rb~ +114 -0
- data/test/stylesheet/tc_gradient_stop.rb +32 -0
- data/test/stylesheet/tc_gradient_stop.rb~ +65 -0
- data/test/stylesheet/tc_num_fmt.rb +31 -0
- data/test/stylesheet/tc_num_fmt.rb~ +32 -0
- data/test/stylesheet/tc_pattern_fill.rb +38 -0
- data/test/stylesheet/tc_pattern_fill.rb~ +31 -0
- data/test/stylesheet/tc_styles.rb +64 -0
- data/test/stylesheet/tc_table_style.rb +37 -0
- data/test/stylesheet/tc_table_style.rb~ +38 -0
- data/test/stylesheet/tc_table_style_element.rb +37 -0
- data/test/stylesheet/tc_table_style_element.rb~ +37 -0
- data/test/stylesheet/tc_table_styles.rb +30 -0
- data/test/stylesheet/tc_table_styles.rb~ +37 -0
- data/test/stylesheet/tc_xf.rb +121 -0
- data/test/stylesheet/tc_xf.rb~ +30 -0
- data/test/tc_app.rb~ +19 -0
- data/test/tc_border_pr.rb~ +21 -0
- data/test/tc_package.rb +70 -0
- data/test/tc_package.rb~ +64 -0
- data/test/tc_pie_3D_chart.rb~ +66 -0
- data/test/tc_relationships.rb~ +37 -0
- data/test/tc_series.rb~ +31 -0
- data/test/tc_styles.rb~ +64 -0
- data/test/tc_validators.rb~ +77 -0
- data/test/tc_worksheet.rb~ +85 -0
- data/test/util/tc_simple_typed_list.rb +66 -0
- data/test/util/tc_validators.rb +76 -0
- data/test/workbook/tc_workbook.rb +53 -0
- data/test/workbook/worksheet/tc_cell.rb +78 -0
- data/test/workbook/worksheet/tc_row.rb +30 -0
- data/test/workbook/worksheet/tc_worksheet.rb +85 -0
- metadata +378 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestBorderPr < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@bpr = Axlsx::BorderPr.new
|
7
|
+
end
|
8
|
+
def teardown
|
9
|
+
end
|
10
|
+
def test_initialiation
|
11
|
+
assert_equal(@bpr.color, nil)
|
12
|
+
assert_equal(@bpr.style, nil)
|
13
|
+
assert_equal(@bpr.name, nil)
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_color
|
17
|
+
assert_raise(ArgumentError) { @bpr.color = :red }
|
18
|
+
assert_nothing_raised { @bpr.color = Axlsx::Color.new :rgb=>"FF000000" }
|
19
|
+
assert(@bpr.color.is_a?(Axlsx::Color))
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_style
|
23
|
+
assert_raise(ArgumentError) { @bpr.style = :red }
|
24
|
+
assert_nothing_raised { @bpr.style = :thin }
|
25
|
+
assert_equal(@bpr.style, :thin)
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_name
|
29
|
+
assert_raise(ArgumentError) { @bpr.name = :red }
|
30
|
+
assert_nothing_raised { @bpr.name = :top }
|
31
|
+
assert_equal(@bpr.name, :top)
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestBorderPr < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@bpr = Axlsx::BorderPr.new
|
7
|
+
end
|
8
|
+
def teardown
|
9
|
+
end
|
10
|
+
def test_initialiation
|
11
|
+
assert_equal(@bpr.color, nil)
|
12
|
+
assert_equal(@bpr.style, nil)
|
13
|
+
assert_equal(@bpr.name, nil)
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_color
|
17
|
+
assert_raise(ArgumentError) { @bpr.color = :red }
|
18
|
+
assert_nothing_raised { @bpr.color = Axlsx::Color.new :rgb=>"FF000000" }
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_style
|
22
|
+
assert_raise(ArgumentError) { @bpr.style = :red }
|
23
|
+
assert_nothing_raised { @bpr.style = :thin }
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_name
|
27
|
+
assert_raise(ArgumentError) { @bpr.name = :red }
|
28
|
+
assert_nothing_raised { @bpr.name = :top }
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestCellAlignment < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@item = Axlsx::CellAlignment.new
|
7
|
+
end
|
8
|
+
def teardown
|
9
|
+
end
|
10
|
+
def test_initialiation
|
11
|
+
assert_equal(@item.horizontal, nil)
|
12
|
+
assert_equal(@item.vertical, nil)
|
13
|
+
assert_equal(@item.textRotation, nil)
|
14
|
+
assert_equal(@item.wrapText, nil)
|
15
|
+
assert_equal(@item.indent, nil)
|
16
|
+
assert_equal(@item.relativeIndent, nil)
|
17
|
+
assert_equal(@item.justifyLastLine, nil)
|
18
|
+
assert_equal(@item.shrinkToFit, nil)
|
19
|
+
assert_equal(@item.readingOrder, nil)
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_horizontal
|
24
|
+
assert_raise(ArgumentError) { @item.horizontal = :red }
|
25
|
+
assert_nothing_raised { @item.horizontal = :left }
|
26
|
+
assert_equal(@item.horizontal, :left )
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_vertical
|
30
|
+
assert_raise(ArgumentError) { @item.vertical = :red }
|
31
|
+
assert_nothing_raised { @item.vertical = :top }
|
32
|
+
assert_equal(@item.vertical, :top )
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_textRotation
|
36
|
+
assert_raise(ArgumentError) { @item.textRotation = -1 }
|
37
|
+
assert_nothing_raised { @item.textRotation = 5 }
|
38
|
+
assert_equal(@item.textRotation, 5 )
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_wrapText
|
42
|
+
assert_raise(ArgumentError) { @item.wrapText = -1 }
|
43
|
+
assert_nothing_raised { @item.wrapText = false }
|
44
|
+
assert_equal(@item.wrapText, false )
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_indent
|
48
|
+
assert_raise(ArgumentError) { @item.indent = -1 }
|
49
|
+
assert_nothing_raised { @item.indent = 5 }
|
50
|
+
assert_equal(@item.indent, 5 )
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_relativeIndent
|
54
|
+
assert_raise(ArgumentError) { @item.relativeIndent = :symbol }
|
55
|
+
assert_nothing_raised { @item.relativeIndent = 5 }
|
56
|
+
assert_equal(@item.relativeIndent, 5 )
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_justifyLastLine
|
60
|
+
assert_raise(ArgumentError) { @item.justifyLastLine = -1 }
|
61
|
+
assert_nothing_raised { @item.justifyLastLine = true }
|
62
|
+
assert_equal(@item.justifyLastLine, true )
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_shrinkToFit
|
66
|
+
assert_raise(ArgumentError) { @item.shrinkToFit = -1 }
|
67
|
+
assert_nothing_raised { @item.shrinkToFit = true }
|
68
|
+
assert_equal(@item.shrinkToFit, true )
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_readingOrder
|
72
|
+
assert_raise(ArgumentError) { @item.readingOrder = -1 }
|
73
|
+
assert_nothing_raised { @item.readingOrder = 2 }
|
74
|
+
assert_equal(@item.readingOrder, 2 )
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestCellAlignment < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@b = Axlsx::CellAlignment.new
|
7
|
+
end
|
8
|
+
def teardown
|
9
|
+
end
|
10
|
+
def test_initialiation
|
11
|
+
assert_equal(@b.diagonalUp, nil)
|
12
|
+
assert_equal(@b.diagonalDown, nil)
|
13
|
+
assert_equal(@b.outline, nil)
|
14
|
+
assert(@b.prs.is_a?(Axlsx::SimpleTypedList))
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_diagonalUp
|
18
|
+
assert_raise(ArgumentError) { @b.diagonalUp = :red }
|
19
|
+
assert_nothing_raised { @b.diagonalUp = true }
|
20
|
+
assert_equal(@b.diagonalUp, true )
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_diagonalDown
|
24
|
+
assert_raise(ArgumentError) { @b.diagonalDown = :red }
|
25
|
+
assert_nothing_raised { @b.diagonalDown = true }
|
26
|
+
assert_equal(@b.diagonalDown, true )
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_outline
|
30
|
+
assert_raise(ArgumentError) { @b.outline = :red }
|
31
|
+
assert_nothing_raised { @b.outline = true }
|
32
|
+
assert_equal(@b.outline, true )
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_prs
|
36
|
+
assert_nothing_raised { @b.prs << Axlsx::BorderPr.new(:name=>:top, :style=>:thin, :color => Axlsx::Color.new(:rgb=>"FF0000FF")) }
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestCellProtection < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::CellProtection.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_initialiation
|
14
|
+
assert_equal(@item.hidden, nil)
|
15
|
+
assert_equal(@item.locked, nil)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_hidden
|
19
|
+
assert_raise(ArgumentError) { @item.hidden = -1 }
|
20
|
+
assert_nothing_raised { @item.hidden = false }
|
21
|
+
assert_equal(@item.hidden, false )
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_locked
|
25
|
+
assert_raise(ArgumentError) { @item.locked = -1 }
|
26
|
+
assert_nothing_raised { @item.locked = false }
|
27
|
+
assert_equal(@item.locked, false )
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestProtection < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@item = Axlsx::CellProtection.new
|
7
|
+
end
|
8
|
+
def teardown
|
9
|
+
end
|
10
|
+
def test_initialiation
|
11
|
+
assert_equal(@item.horizontal, nil)
|
12
|
+
assert_equal(@item.vertical, nil)
|
13
|
+
assert_equal(@item.textRotation, nil)
|
14
|
+
assert_equal(@item.wrapText, nil)
|
15
|
+
assert_equal(@item.indent, nil)
|
16
|
+
assert_equal(@item.relativeIndent, nil)
|
17
|
+
assert_equal(@item.justifyLastLine, nil)
|
18
|
+
assert_equal(@item.shrinkToFit, nil)
|
19
|
+
assert_equal(@item.readingOrder, nil)
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_horizontal
|
24
|
+
assert_raise(ArgumentError) { @item.horizontal = :red }
|
25
|
+
assert_nothing_raised { @item.horizontal = :left }
|
26
|
+
assert_equal(@item.horizontal, :left )
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_vertical
|
30
|
+
assert_raise(ArgumentError) { @item.vertical = :red }
|
31
|
+
assert_nothing_raised { @item.vertical = :top }
|
32
|
+
assert_equal(@item.vertical, :top )
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_textRotation
|
36
|
+
assert_raise(ArgumentError) { @item.textRotation = -1 }
|
37
|
+
assert_nothing_raised { @item.textRotation = 5 }
|
38
|
+
assert_equal(@item.textRotation, 5 )
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_wrapText
|
42
|
+
assert_raise(ArgumentError) { @item.wrapText = -1 }
|
43
|
+
assert_nothing_raised { @item.wrapText = false }
|
44
|
+
assert_equal(@item.wrapText, false )
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_indent
|
48
|
+
assert_raise(ArgumentError) { @item.indent = -1 }
|
49
|
+
assert_nothing_raised { @item.indent = 5 }
|
50
|
+
assert_equal(@item.indent, 5 )
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_relativeIndent
|
54
|
+
assert_raise(ArgumentError) { @item.relativeIndent = :symbol }
|
55
|
+
assert_nothing_raised { @item.relativeIndent = 5 }
|
56
|
+
assert_equal(@item.relativeIndent, 5 )
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_justifyLastLine
|
60
|
+
assert_raise(ArgumentError) { @item.justifyLastLine = -1 }
|
61
|
+
assert_nothing_raised { @item.justifyLastLine = true }
|
62
|
+
assert_equal(@item.justifyLastLine, true )
|
63
|
+
end
|
64
|
+
|
65
|
+
def test_shrinkToFit
|
66
|
+
assert_raise(ArgumentError) { @item.shrinkToFit = -1 }
|
67
|
+
assert_nothing_raised { @item.shrinkToFit = true }
|
68
|
+
assert_equal(@item.shrinkToFit, true )
|
69
|
+
end
|
70
|
+
|
71
|
+
def test_readingOrder
|
72
|
+
assert_raise(ArgumentError) { @item.readingOrder = -1 }
|
73
|
+
assert_nothing_raised { @item.readingOrder = 2 }
|
74
|
+
assert_equal(@item.readingOrder, 2 )
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestCellStyle < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::CellStyle.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_initialiation
|
14
|
+
assert_equal(@item.name, nil)
|
15
|
+
assert_equal(@item.xfId, nil)
|
16
|
+
assert_equal(@item.builtinId, nil)
|
17
|
+
assert_equal(@item.iLevel, nil)
|
18
|
+
assert_equal(@item.hidden, nil)
|
19
|
+
assert_equal(@item.customBuiltin, nil)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_name
|
23
|
+
assert_raise(ArgumentError) { @item.name = -1 }
|
24
|
+
assert_nothing_raised { @item.name = "stylin" }
|
25
|
+
assert_equal(@item.name, "stylin" )
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_xfId
|
29
|
+
assert_raise(ArgumentError) { @item.xfId = -1 }
|
30
|
+
assert_nothing_raised { @item.xfId = 5 }
|
31
|
+
assert_equal(@item.xfId, 5 )
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_builtinId
|
35
|
+
assert_raise(ArgumentError) { @item.builtinId = -1 }
|
36
|
+
assert_nothing_raised { @item.builtinId = 5 }
|
37
|
+
assert_equal(@item.builtinId, 5 )
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_iLevel
|
41
|
+
assert_raise(ArgumentError) { @item.iLevel = -1 }
|
42
|
+
assert_nothing_raised { @item.iLevel = 5 }
|
43
|
+
assert_equal(@item.iLevel, 5 )
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_hidden
|
47
|
+
assert_raise(ArgumentError) { @item.hidden = -1 }
|
48
|
+
assert_nothing_raised { @item.hidden = true }
|
49
|
+
assert_equal(@item.hidden, true )
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_customBuiltin
|
53
|
+
assert_raise(ArgumentError) { @item.customBuiltin = -1 }
|
54
|
+
assert_nothing_raised { @item.customBuiltin = true }
|
55
|
+
assert_equal(@item.customBuiltin, true )
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestCellStyle < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::CellStyle.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_initialiation
|
14
|
+
assert_equal(@item.hidden, nil)
|
15
|
+
assert_equal(@item.locked, nil)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_hidden
|
19
|
+
assert_raise(ArgumentError) { @item.hidden = -1 }
|
20
|
+
assert_nothing_raised { @item.hidden = false }
|
21
|
+
assert_equal(@item.hidden, false )
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_locked
|
25
|
+
assert_raise(ArgumentError) { @item.locked = -1 }
|
26
|
+
assert_nothing_raised { @item.locked = false }
|
27
|
+
assert_equal(@item.locked, false )
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestColor < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::Color.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_initialiation
|
14
|
+
assert_equal(@item.auto, nil)
|
15
|
+
assert_equal(@item.rgb, "FF000000")
|
16
|
+
assert_equal(@item.tint, nil)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_auto
|
20
|
+
assert_raise(ArgumentError) { @item.auto = -1 }
|
21
|
+
assert_nothing_raised { @item.auto = true }
|
22
|
+
assert_equal(@item.auto, true )
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_rgb
|
26
|
+
assert_raise(ArgumentError) { @item.rgb = -1 }
|
27
|
+
assert_nothing_raised { @item.rgb = "FF00FF00" }
|
28
|
+
assert_equal(@item.rgb, "FF00FF00" )
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_tint
|
32
|
+
assert_raise(ArgumentError) { @item.tint = -1 }
|
33
|
+
assert_nothing_raised { @item.tint = -1.0 }
|
34
|
+
assert_equal(@item.tint, -1.0 )
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestColor < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::Color.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_initialiation
|
14
|
+
assert_equal(@item.auto, nil)
|
15
|
+
assert_equal(@item.rgb, nil)
|
16
|
+
assert_equal(@item.tint, nil)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_auto
|
20
|
+
assert_raise(ArgumentError) { @item.auto = -1 }
|
21
|
+
assert_nothing_raised { @item.auto = true }
|
22
|
+
assert_equal(@item.auto, true )
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_rgb
|
26
|
+
assert_raise(ArgumentError) { @item.rgb = -1 }
|
27
|
+
assert_nothing_raised { @item.rgb = "FF00FF00" }
|
28
|
+
assert_equal(@item.rgb, "FF00FF00" )
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_tint
|
32
|
+
assert_raise(ArgumentError) { @item.tint = -1 }
|
33
|
+
assert_nothing_raised { @item.tint = -1.0 }
|
34
|
+
assert_equal(@item.tint, -1.0 )
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
end
|