axlsx 1.0.13 → 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +161 -134
- data/examples/example.rb +133 -153
- data/lib/axlsx.rb +3 -1
- data/lib/axlsx/#cfb.xlsx# +0 -0
- data/lib/axlsx/drawing/axis.rb +13 -10
- data/lib/axlsx/drawing/bar_3D_chart.rb +19 -11
- data/lib/axlsx/drawing/bar_series.rb +1 -1
- data/lib/axlsx/drawing/cat_axis.rb +5 -5
- data/lib/axlsx/drawing/cat_axis_data.rb +7 -7
- data/lib/axlsx/drawing/chart.rb +29 -15
- data/lib/axlsx/drawing/drawing.rb +1 -1
- data/lib/axlsx/drawing/graphic_frame.rb +10 -10
- data/lib/axlsx/drawing/line_3D_chart.rb +15 -7
- data/lib/axlsx/drawing/marker.rb +1 -1
- data/lib/axlsx/drawing/one_cell_anchor.rb +4 -4
- data/lib/axlsx/drawing/pic.rb +14 -14
- data/lib/axlsx/drawing/pie_3D_chart.rb +2 -2
- data/lib/axlsx/drawing/pie_series.rb +1 -1
- data/lib/axlsx/drawing/scaling.rb +5 -5
- data/lib/axlsx/drawing/ser_axis.rb +3 -3
- data/lib/axlsx/drawing/series.rb +3 -3
- data/lib/axlsx/drawing/series_title.rb +7 -7
- data/lib/axlsx/drawing/title.rb +13 -9
- data/lib/axlsx/drawing/two_cell_anchor.rb +4 -4
- data/lib/axlsx/drawing/val_axis.rb +2 -2
- data/lib/axlsx/drawing/val_axis_data.rb +7 -9
- data/lib/axlsx/drawing/view_3D.rb +7 -7
- data/lib/axlsx/package.rb +8 -0
- data/lib/axlsx/util/constants.rb +0 -4
- data/lib/axlsx/util/ms_off_crypto.rb +88 -0
- data/lib/axlsx/util/ms_off_crypto.rb~ +3 -0
- data/lib/axlsx/util/ms_offcrypto.rb~ +0 -0
- data/lib/axlsx/version.rb +1 -1
- data/lib/axlsx/workbook/workbook.rb +1 -0
- data/lib/axlsx/workbook/worksheet/cell.rb +21 -8
- data/lib/axlsx/workbook/worksheet/worksheet.rb +74 -18
- data/test/content_type/tc_content_type.rb +81 -0
- data/test/content_type/tc_default.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_core.rb +34 -0
- data/test/drawing/tc_axis.rb +40 -0
- data/test/drawing/tc_bar_3D_chart.rb +66 -0
- data/test/drawing/tc_bar_series.rb +34 -0
- data/test/drawing/tc_cat_axis.rb +32 -0
- data/test/drawing/tc_cat_axis_data.rb +18 -0
- data/test/drawing/tc_chart.rb +73 -0
- data/test/drawing/tc_drawing.rb +80 -0
- data/test/drawing/tc_graphic_frame.rb +26 -0
- data/test/drawing/tc_line_3d_chart.rb +48 -0
- data/test/drawing/tc_line_series.rb +27 -0
- data/test/drawing/tc_line_series.tc~ +34 -0
- data/test/drawing/tc_marker.rb +45 -0
- data/test/drawing/tc_one_cell_anchor.rb +67 -0
- data/test/drawing/tc_pic.rb +71 -0
- data/test/drawing/tc_picture_locking.rb +73 -0
- data/test/drawing/tc_picture_locking.rb~ +77 -0
- data/test/drawing/tc_pie_3D_chart.rb +33 -0
- data/test/drawing/tc_pie_series.rb +35 -0
- data/test/drawing/tc_scaling.rb +37 -0
- data/test/drawing/tc_ser_axis.rb +31 -0
- data/test/drawing/tc_series.rb +24 -0
- data/test/drawing/tc_series_title.rb +34 -0
- data/test/drawing/tc_title.rb +34 -0
- data/test/drawing/tc_two_cell_anchor.rb +38 -0
- data/test/drawing/tc_val_axis.rb +25 -0
- data/test/drawing/tc_val_axis_data.rb +18 -0
- data/test/drawing/tc_view_3D.rb +55 -0
- data/test/rels/tc_relationship.rb +16 -0
- data/test/rels/tc_relationships.rb +27 -0
- data/test/stylesheet/tc_border.rb +38 -0
- data/test/stylesheet/tc_border_pr.rb +33 -0
- data/test/stylesheet/tc_cell_alignment.rb +77 -0
- data/test/stylesheet/tc_cell_protection.rb +30 -0
- data/test/stylesheet/tc_cell_style.rb +58 -0
- data/test/stylesheet/tc_color.rb +38 -0
- data/test/stylesheet/tc_fill.rb +19 -0
- data/test/stylesheet/tc_font.rb +114 -0
- data/test/stylesheet/tc_gradient_fill.rb +65 -0
- data/test/stylesheet/tc_gradient_stop.rb +32 -0
- data/test/stylesheet/tc_num_fmt.rb +31 -0
- data/test/stylesheet/tc_pattern_fill.rb +38 -0
- data/test/stylesheet/tc_styles.rb +52 -0
- data/test/stylesheet/tc_table_style.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_xf.rb +121 -0
- data/test/tc_package.rb +78 -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 +60 -0
- data/test/workbook/worksheet/tc_cell.rb +194 -0
- data/test/workbook/worksheet/tc_row.rb +36 -0
- data/test/workbook/worksheet/tc_worksheet.rb +159 -0
- metadata +191 -31
- data/lib/axlsx/workbook/#workbook.rb# +0 -165
@@ -0,0 +1,65 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestGradientFill < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::GradientFill.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
def test_initialiation
|
15
|
+
assert_equal(@item.type, :linear)
|
16
|
+
assert_equal(@item.degree, nil)
|
17
|
+
assert_equal(@item.left, nil)
|
18
|
+
assert_equal(@item.right, nil)
|
19
|
+
assert_equal(@item.top, nil)
|
20
|
+
assert_equal(@item.bottom, nil)
|
21
|
+
assert(@item.stop.is_a?(Axlsx::SimpleTypedList))
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_type
|
25
|
+
assert_raise(ArgumentError) { @item.type = 7 }
|
26
|
+
assert_nothing_raised { @item.type = :path }
|
27
|
+
assert_equal(@item.type, :path)
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_degree
|
31
|
+
assert_raise(ArgumentError) { @item.degree = -7 }
|
32
|
+
assert_nothing_raised { @item.degree = 5.0 }
|
33
|
+
assert_equal(@item.degree, 5.0)
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_left
|
37
|
+
assert_raise(ArgumentError) { @item.left = -1.1 }
|
38
|
+
assert_nothing_raised { @item.left = 1.0 }
|
39
|
+
assert_equal(@item.left, 1.0)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_right
|
43
|
+
assert_raise(ArgumentError) { @item.right = -1.1 }
|
44
|
+
assert_nothing_raised { @item.right = 0.5 }
|
45
|
+
assert_equal(@item.right, 0.5)
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_top
|
49
|
+
assert_raise(ArgumentError) { @item.top = -1.1 }
|
50
|
+
assert_nothing_raised { @item.top = 1.0 }
|
51
|
+
assert_equal(@item.top, 1.0)
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_bottom
|
55
|
+
assert_raise(ArgumentError) { @item.bottom = -1.1 }
|
56
|
+
assert_nothing_raised { @item.bottom = 0.0 }
|
57
|
+
assert_equal(@item.bottom, 0.0)
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_stop
|
61
|
+
@item.stop << Axlsx::GradientStop.new(Axlsx::Color.new(:rgb=>"00000000"), 0.5)
|
62
|
+
assert(@item.stop.size == 1)
|
63
|
+
assert(@item.stop.last.is_a?(Axlsx::GradientStop))
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestGradientStop < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::GradientStop.new(Axlsx::Color.new(:rgb=>"FFFF0000"), 1.0)
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
def test_initialiation
|
15
|
+
assert_equal(@item.color.rgb, "FFFF0000")
|
16
|
+
assert_equal(@item.position, 1.0)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_position
|
20
|
+
assert_raise(ArgumentError) { @item.position = -1.1 }
|
21
|
+
assert_nothing_raised { @item.position = 0.0 }
|
22
|
+
assert_equal(@item.position, 0.0)
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_color
|
26
|
+
assert_raise(ArgumentError) { @item.color = nil }
|
27
|
+
color = Axlsx::Color.new(:rgb=>"FF0000FF")
|
28
|
+
@item.color = color
|
29
|
+
assert_equal(@item.color.rgb, "FF0000FF")
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestNumFmt < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::NumFmt.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
def test_initialiation
|
15
|
+
assert_equal(@item.numFmtId, 0)
|
16
|
+
assert_equal(@item.formatCode, "")
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_numFmtId
|
20
|
+
assert_raise(ArgumentError) { @item.numFmtId = -1.1 }
|
21
|
+
assert_nothing_raised { @item.numFmtId = 2 }
|
22
|
+
assert_equal(@item.numFmtId, 2)
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_fomatCode
|
26
|
+
assert_raise(ArgumentError) { @item.formatCode = -1.1 }
|
27
|
+
assert_nothing_raised { @item.formatCode = "0" }
|
28
|
+
assert_equal(@item.formatCode, "0")
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestPatternFill < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::PatternFill.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
def test_initialiation
|
15
|
+
assert_equal(@item.patternType, :none)
|
16
|
+
assert_equal(@item.bgColor, nil)
|
17
|
+
assert_equal(@item.fgColor, nil)
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_bgColor
|
21
|
+
assert_raise(ArgumentError) { @item.bgColor = -1.1 }
|
22
|
+
assert_nothing_raised { @item.bgColor = Axlsx::Color.new }
|
23
|
+
assert_equal(@item.bgColor.rgb, "FF000000")
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_fgColor
|
27
|
+
assert_raise(ArgumentError) { @item.fgColor = -1.1 }
|
28
|
+
assert_nothing_raised { @item.fgColor = Axlsx::Color.new }
|
29
|
+
assert_equal(@item.fgColor.rgb, "FF000000")
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_pattern_type
|
33
|
+
assert_raise(ArgumentError) { @item.patternType = -1.1 }
|
34
|
+
assert_nothing_raised { @item.patternType = :lightUp }
|
35
|
+
assert_equal(@item.patternType, :lightUp)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestStyles < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@styles = Axlsx::Styles.new
|
7
|
+
end
|
8
|
+
def teardown
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_valid_document
|
12
|
+
schema = Nokogiri::XML::Schema(File.open(Axlsx::SML_XSD))
|
13
|
+
doc = Nokogiri::XML(@styles.to_xml)
|
14
|
+
errors = []
|
15
|
+
schema.validate(doc).each do |error|
|
16
|
+
errors.push error
|
17
|
+
puts error.message
|
18
|
+
end
|
19
|
+
assert(errors.size == 0)
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
def test_add_style
|
24
|
+
fill_count = @styles.fills.size
|
25
|
+
font_count = @styles.fonts.size
|
26
|
+
xf_count = @styles.cellXfs.size
|
27
|
+
|
28
|
+
@styles.add_style :bg_color=>"FF000000", :fg_color=>"FFFFFFFF", :sz=>13, :num_fmt=>Axlsx::NUM_FMT_PERCENT, :alignment=>{:horizontal=>:left}, :border=>Axlsx::STYLE_THIN_BORDER, :hidden=>true, :locked=>true
|
29
|
+
assert_equal(@styles.fills.size, fill_count+1)
|
30
|
+
assert_equal(@styles.fonts.size, font_count+1)
|
31
|
+
assert_equal(@styles.cellXfs.size, xf_count+1)
|
32
|
+
xf = @styles.cellXfs.last
|
33
|
+
assert_equal(xf.fillId, (@styles.fills.size-1), "points to the last created fill")
|
34
|
+
assert_equal(@styles.fills.last.fill_type.fgColor.rgb, "FF000000", "fill created with color")
|
35
|
+
|
36
|
+
assert_equal(xf.fontId, (@styles.fonts.size-1), "points to the last created font")
|
37
|
+
assert_equal(@styles.fonts.last.sz, 13, "font sz applied")
|
38
|
+
assert_equal(@styles.fonts.last.color.rgb, "FFFFFFFF", "font color applied")
|
39
|
+
|
40
|
+
assert_equal(xf.borderId, Axlsx::STYLE_THIN_BORDER, "border id is set")
|
41
|
+
assert_equal(xf.numFmtId, Axlsx::NUM_FMT_PERCENT, "number format id is set")
|
42
|
+
|
43
|
+
assert(xf.alignment.is_a?(Axlsx::CellAlignment), "alignment was created")
|
44
|
+
assert_equal(xf.alignment.horizontal, :left, "horizontal alignment applied")
|
45
|
+
assert_equal(xf.applyProtection, 1, "protection applied")
|
46
|
+
assert_equal(xf.protection.hidden, true, "hidden protection set")
|
47
|
+
assert_equal(xf.protection.locked, true, "cell locking set")
|
48
|
+
assert_raise(ArgumentError, "should reject invalid borderId") { @styles.add_style :border => 2 }
|
49
|
+
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestTableStyle < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::TableStyle.new "fisher"
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_initialiation
|
14
|
+
assert_equal(@item.name, "fisher")
|
15
|
+
assert_equal(@item.pivot, nil)
|
16
|
+
assert_equal(@item.table, nil)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_name
|
20
|
+
assert_raise(ArgumentError) { @item.name = -1.1 }
|
21
|
+
assert_nothing_raised { @item.name = "lovely table style" }
|
22
|
+
assert_equal(@item.name, "lovely table style")
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_pivot
|
26
|
+
assert_raise(ArgumentError) { @item.pivot = -1.1 }
|
27
|
+
assert_nothing_raised { @item.pivot = true }
|
28
|
+
assert_equal(@item.pivot, true)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_table
|
32
|
+
assert_raise(ArgumentError) { @item.table = -1.1 }
|
33
|
+
assert_nothing_raised { @item.table = true }
|
34
|
+
assert_equal(@item.table, true)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestTableStyleElement < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::TableStyleElement.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_initialiation
|
14
|
+
assert_equal(@item.type, nil)
|
15
|
+
assert_equal(@item.size, nil)
|
16
|
+
assert_equal(@item.dxfId, nil)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_type
|
20
|
+
assert_raise(ArgumentError) { @item.type = -1.1 }
|
21
|
+
assert_nothing_raised { @item.type = :blankRow }
|
22
|
+
assert_equal(@item.type, :blankRow)
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_size
|
26
|
+
assert_raise(ArgumentError) { @item.size = -1.1 }
|
27
|
+
assert_nothing_raised { @item.size = 2 }
|
28
|
+
assert_equal(@item.size, 2)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_dxfId
|
32
|
+
assert_raise(ArgumentError) { @item.dxfId = -1.1 }
|
33
|
+
assert_nothing_raised { @item.dxfId = 7 }
|
34
|
+
assert_equal(@item.dxfId, 7)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestTableStyles < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::TableStyles.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_initialiation
|
14
|
+
assert_equal(@item.defaultTableStyle, "TableStyleMedium9")
|
15
|
+
assert_equal(@item.defaultPivotStyle, "PivotStyleLight16")
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_defaultTableStyle
|
19
|
+
assert_raise(ArgumentError) { @item.defaultTableStyle = -1.1 }
|
20
|
+
assert_nothing_raised { @item.defaultTableStyle = "anyones guess" }
|
21
|
+
assert_equal(@item.defaultTableStyle, "anyones guess")
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_defaultPivotStyle
|
25
|
+
assert_raise(ArgumentError) { @item.defaultPivotStyle = -1.1 }
|
26
|
+
assert_nothing_raised { @item.defaultPivotStyle = "anyones guess" }
|
27
|
+
assert_equal(@item.defaultPivotStyle, "anyones guess")
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'axlsx.rb'
|
3
|
+
|
4
|
+
class TestXf < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@item = Axlsx::Xf.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_initialiation
|
14
|
+
assert_equal(@item.alignment, nil)
|
15
|
+
assert_equal(@item.protection, nil)
|
16
|
+
assert_equal(@item.numFmtId, nil)
|
17
|
+
assert_equal(@item.fontId, nil)
|
18
|
+
assert_equal(@item.fillId, nil)
|
19
|
+
assert_equal(@item.borderId, nil)
|
20
|
+
assert_equal(@item.xfId, nil)
|
21
|
+
assert_equal(@item.quotePrefix, nil)
|
22
|
+
assert_equal(@item.pivotButton, nil)
|
23
|
+
assert_equal(@item.applyNumberFormat, nil)
|
24
|
+
assert_equal(@item.applyFont, nil)
|
25
|
+
assert_equal(@item.applyFill, nil)
|
26
|
+
assert_equal(@item.applyBorder, nil)
|
27
|
+
assert_equal(@item.applyAlignment, nil)
|
28
|
+
assert_equal(@item.applyProtection, nil)
|
29
|
+
end
|
30
|
+
|
31
|
+
def test_alignment
|
32
|
+
assert_raise(ArgumentError) { @item.alignment = -1.1 }
|
33
|
+
assert_nothing_raised { @item.alignment = Axlsx::CellAlignment.new }
|
34
|
+
assert(@item.alignment.is_a?(Axlsx::CellAlignment))
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_protection
|
38
|
+
assert_raise(ArgumentError) { @item.protection = -1.1 }
|
39
|
+
assert_nothing_raised { @item.protection = Axlsx::CellProtection.new }
|
40
|
+
assert(@item.protection.is_a?(Axlsx::CellProtection))
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_numFmtId
|
44
|
+
assert_raise(ArgumentError) { @item.numFmtId = -1.1 }
|
45
|
+
assert_nothing_raised { @item.numFmtId = 0 }
|
46
|
+
assert_equal(@item.numFmtId, 0)
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_fillId
|
50
|
+
assert_raise(ArgumentError) { @item.fillId = -1.1 }
|
51
|
+
assert_nothing_raised { @item.fillId = 0 }
|
52
|
+
assert_equal(@item.fillId, 0)
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_fontId
|
56
|
+
assert_raise(ArgumentError) { @item.fontId = -1.1 }
|
57
|
+
assert_nothing_raised { @item.fontId = 0 }
|
58
|
+
assert_equal(@item.fontId, 0)
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_borderId
|
62
|
+
assert_raise(ArgumentError) { @item.borderId = -1.1 }
|
63
|
+
assert_nothing_raised { @item.borderId = 0 }
|
64
|
+
assert_equal(@item.borderId, 0)
|
65
|
+
end
|
66
|
+
|
67
|
+
def test_xfId
|
68
|
+
assert_raise(ArgumentError) { @item.xfId = -1.1 }
|
69
|
+
assert_nothing_raised { @item.xfId = 0 }
|
70
|
+
assert_equal(@item.xfId, 0)
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_quotePrefix
|
74
|
+
assert_raise(ArgumentError) { @item.quotePrefix = -1.1 }
|
75
|
+
assert_nothing_raised { @item.quotePrefix = false }
|
76
|
+
assert_equal(@item.quotePrefix, false)
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_pivotButton
|
80
|
+
assert_raise(ArgumentError) { @item.pivotButton = -1.1 }
|
81
|
+
assert_nothing_raised { @item.pivotButton = false }
|
82
|
+
assert_equal(@item.pivotButton, false)
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_applyNumberFormat
|
86
|
+
assert_raise(ArgumentError) { @item.applyNumberFormat = -1.1 }
|
87
|
+
assert_nothing_raised { @item.applyNumberFormat = false }
|
88
|
+
assert_equal(@item.applyNumberFormat, false)
|
89
|
+
end
|
90
|
+
|
91
|
+
def test_applyFont
|
92
|
+
assert_raise(ArgumentError) { @item.applyFont = -1.1 }
|
93
|
+
assert_nothing_raised { @item.applyFont = false }
|
94
|
+
assert_equal(@item.applyFont, false)
|
95
|
+
end
|
96
|
+
|
97
|
+
def test_applyFill
|
98
|
+
assert_raise(ArgumentError) { @item.applyFill = -1.1 }
|
99
|
+
assert_nothing_raised { @item.applyFill = false }
|
100
|
+
assert_equal(@item.applyFill, false)
|
101
|
+
end
|
102
|
+
|
103
|
+
def test_applyBorder
|
104
|
+
assert_raise(ArgumentError) { @item.applyBorder = -1.1 }
|
105
|
+
assert_nothing_raised { @item.applyBorder = false }
|
106
|
+
assert_equal(@item.applyBorder, false)
|
107
|
+
end
|
108
|
+
|
109
|
+
def test_applyAlignment
|
110
|
+
assert_raise(ArgumentError) { @item.applyAlignment = -1.1 }
|
111
|
+
assert_nothing_raised { @item.applyAlignment = false }
|
112
|
+
assert_equal(@item.applyAlignment, false)
|
113
|
+
end
|
114
|
+
|
115
|
+
def test_applyProtection
|
116
|
+
assert_raise(ArgumentError) { @item.applyProtection = -1.1 }
|
117
|
+
assert_nothing_raised { @item.applyProtection = false }
|
118
|
+
assert_equal(@item.applyProtection, false)
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|