writeexcel 0.3.5 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitattributes +1 -0
- data/README.rdoc +12 -6
- data/VERSION +1 -1
- data/charts/chartex.rb +316 -315
- data/charts/demo1.rb +1 -0
- data/charts/demo2.rb +1 -0
- data/charts/demo3.rb +117 -116
- data/charts/demo4.rb +119 -118
- data/charts/demo5.rb +48 -47
- data/examples/a_simple.rb +1 -0
- data/examples/autofilter.rb +1 -0
- data/examples/bigfile.rb +30 -29
- data/examples/chart_area.rb +121 -120
- data/examples/chart_bar.rb +120 -119
- data/examples/chart_column.rb +120 -119
- data/examples/chart_line.rb +120 -119
- data/examples/chart_pie.rb +108 -107
- data/examples/chart_scatter.rb +121 -120
- data/examples/chart_stock.rb +148 -147
- data/examples/chess.rb +1 -0
- data/examples/colors.rb +1 -0
- data/examples/comments1.rb +1 -0
- data/examples/comments2.rb +3 -2
- data/examples/copyformat.rb +1 -0
- data/examples/data_validate.rb +1 -0
- data/examples/date_time.rb +1 -0
- data/examples/defined_name.rb +1 -0
- data/examples/demo.rb +1 -0
- data/examples/diag_border.rb +1 -0
- data/examples/formats.rb +1 -0
- data/examples/formula_result.rb +1 -0
- data/examples/header.rb +1 -0
- data/examples/hide_sheet.rb +1 -0
- data/examples/hyperlink.rb +1 -0
- data/examples/images.rb +1 -0
- data/examples/indent.rb +1 -0
- data/examples/merge1.rb +1 -0
- data/examples/merge2.rb +1 -0
- data/examples/merge3.rb +1 -0
- data/examples/merge4.rb +1 -0
- data/examples/merge5.rb +1 -0
- data/examples/merge6.rb +67 -66
- data/examples/outline.rb +1 -0
- data/examples/outline_collapsed.rb +1 -0
- data/examples/panes.rb +1 -0
- data/examples/properties.rb +1 -0
- data/examples/properties_jp.rb +1 -0
- data/examples/protection.rb +1 -0
- data/examples/regions.rb +1 -0
- data/examples/repeat.rb +1 -0
- data/examples/right_to_left.rb +1 -0
- data/examples/row_wrap.rb +1 -0
- data/examples/stats.rb +1 -0
- data/examples/stocks.rb +1 -0
- data/examples/tab_colors.rb +1 -0
- data/examples/write_arrays.rb +1 -0
- data/lib/writeexcel.rb +6 -1
- data/lib/writeexcel/biffwriter.rb +21 -20
- data/lib/writeexcel/chart.rb +25 -12
- data/lib/writeexcel/charts/area.rb +153 -152
- data/lib/writeexcel/charts/bar.rb +178 -177
- data/lib/writeexcel/charts/column.rb +157 -156
- data/lib/writeexcel/charts/external.rb +62 -61
- data/lib/writeexcel/charts/line.rb +153 -152
- data/lib/writeexcel/charts/pie.rb +170 -169
- data/lib/writeexcel/charts/scatter.rb +4 -3
- data/lib/writeexcel/charts/stock.rb +212 -211
- data/lib/writeexcel/compatibility.rb +320 -0
- data/lib/writeexcel/excelformulaparser.rb +587 -586
- data/lib/writeexcel/format.rb +12 -13
- data/lib/writeexcel/formula.rb +30 -28
- data/lib/writeexcel/helper.rb +23 -0
- data/lib/writeexcel/olewriter.rb +5 -16
- data/lib/writeexcel/properties.rb +43 -54
- data/lib/writeexcel/storage_lite.rb +981 -968
- data/lib/writeexcel/workbook.rb +94 -73
- data/lib/writeexcel/worksheet.rb +230 -210
- data/test/helper.rb +19 -0
- data/test/test_00_IEEE_double.rb +1 -0
- data/test/test_01_add_worksheet.rb +1 -0
- data/test/test_02_merge_formats.rb +3 -5
- data/test/test_04_dimensions.rb +3 -5
- data/test/test_05_rows.rb +6 -6
- data/test/test_06_extsst.rb +8 -8
- data/test/test_11_date_time.rb +3 -5
- data/test/test_12_date_only.rb +3 -5
- data/test/test_13_date_seconds.rb +4 -6
- data/test/test_21_escher.rb +3 -5
- data/test/test_22_mso_drawing_group.rb +20 -22
- data/test/test_23_note.rb +5 -7
- data/test/test_24_txo.rb +3 -5
- data/test/test_25_position_object.rb +84 -79
- data/test/test_26_autofilter.rb +3 -13
- data/test/test_27_autofilter.rb +3 -13
- data/test/test_28_autofilter.rb +3 -13
- data/test/test_29_process_jpg.rb +5 -0
- data/test/test_30_validation_dval.rb +3 -5
- data/test/test_31_validation_dv_strings.rb +3 -5
- data/test/test_32_validation_dv_formula.rb +3 -5
- data/test/test_40_property_types.rb +10 -9
- data/test/test_41_properties.rb +1 -0
- data/test/test_42_set_properties.rb +14 -15
- data/test/test_50_name_stored.rb +299 -302
- data/test/test_51_name_print_area.rb +357 -360
- data/test/test_52_name_print_titles.rb +454 -457
- data/test/test_53_autofilter.rb +203 -206
- data/test/test_60_chart_generic.rb +5 -0
- data/test/test_61_chart_subclasses.rb +95 -94
- data/test/test_62_chart_formats.rb +272 -267
- data/test/test_63_chart_area_formats.rb +649 -644
- data/test/test_biff.rb +12 -38
- data/test/test_compatibility.rb +627 -0
- data/test/test_example_match.rb +3 -18
- data/test/test_format.rb +46 -105
- data/test/test_formula.rb +1 -0
- data/test/test_ole.rb +3 -4
- data/test/test_storage_lite.rb +125 -146
- data/test/test_workbook.rb +2 -23
- data/test/test_worksheet.rb +4 -5
- data/utils/add_magic_comment.rb +80 -0
- data/writeexcel.gemspec +8 -2
- metadata +10 -4
data/test/test_23_note.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
##########################################################################
|
2
3
|
# test_23_note.rb
|
3
4
|
#
|
@@ -11,24 +12,21 @@
|
|
11
12
|
#
|
12
13
|
#########################################################################
|
13
14
|
require 'helper'
|
15
|
+
require 'stringio'
|
14
16
|
|
15
17
|
class TC_note < Test::Unit::TestCase
|
16
18
|
|
17
19
|
def setup
|
18
|
-
|
19
|
-
path = "temp#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
|
20
|
-
@test_file = File.join(Dir.tmpdir, path)
|
21
|
-
@workbook = WriteExcel.new(@test_file)
|
20
|
+
@workbook = WriteExcel.new(StringIO.new)
|
22
21
|
@worksheet = @workbook.add_worksheet
|
23
22
|
end
|
24
23
|
|
25
24
|
def teardown
|
26
25
|
@workbook.close
|
27
|
-
File.unlink(@test_file) if FileTest.exist?(@test_file)
|
28
26
|
end
|
29
27
|
|
30
28
|
def test_blank_author_name
|
31
|
-
data = @worksheet.comment_params(2,0,'Test')
|
29
|
+
data = @worksheet.comment_params(2, 0, 'Test')
|
32
30
|
row = data[0]
|
33
31
|
col = data[1]
|
34
32
|
author = data[4]
|
@@ -41,7 +39,7 @@ def test_blank_author_name
|
|
41
39
|
1C 00 0C 00 02 00 00 00 00 00 01 00 00 00 00 00
|
42
40
|
).join(' ')
|
43
41
|
result = unpack_record(
|
44
|
-
@worksheet.store_note(row,col,obj_id,author,encoding,visible))
|
42
|
+
@worksheet.store_note(row, col, obj_id, author, encoding, visible))
|
45
43
|
assert_equal(target, result, caption)
|
46
44
|
end
|
47
45
|
|
data/test/test_24_txo.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
##########################################################################
|
2
3
|
# test_24_txo.rb
|
3
4
|
#
|
@@ -11,20 +12,17 @@
|
|
11
12
|
#
|
12
13
|
#########################################################################
|
13
14
|
require 'helper'
|
15
|
+
require 'stringio'
|
14
16
|
|
15
17
|
class TC_txo < Test::Unit::TestCase
|
16
18
|
|
17
19
|
def setup
|
18
|
-
|
19
|
-
path = "temp#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
|
20
|
-
@test_file = File.join(Dir.tmpdir, path)
|
21
|
-
@workbook = WriteExcel.new(@test_file)
|
20
|
+
@workbook = WriteExcel.new(StringIO.new)
|
22
21
|
@worksheet = @workbook.add_worksheet
|
23
22
|
end
|
24
23
|
|
25
24
|
def teardown
|
26
25
|
@workbook.close
|
27
|
-
File.unlink(@test_file) if FileTest.exist?(@test_file)
|
28
26
|
end
|
29
27
|
|
30
28
|
def test_txo
|
@@ -1,79 +1,84 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
|
16
|
-
|
17
|
-
require '
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
@
|
24
|
-
@
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
[ [0, 0, 0, 0,
|
47
|
-
[ [0, 0, 0, 0,
|
48
|
-
[ [0, 0, 0, 0,
|
49
|
-
[ [0, 0, 0, 0,
|
50
|
-
[ [0, 0, 0, 0,
|
51
|
-
[ [0, 0, 0, 0,
|
52
|
-
[ [0, 0, 0, 0,
|
53
|
-
[ [0, 0, 0, 0,
|
54
|
-
[ [0, 0, 0, 0,
|
55
|
-
[ [0, 0, 0, 0,
|
56
|
-
[ [0, 0, 0, 0,
|
57
|
-
[ [0, 0, 0, 0,
|
58
|
-
[ [0, 0, 0, 0,
|
59
|
-
[ [0, 0, 0, 0,
|
60
|
-
[ [0, 0, 0, 0,
|
61
|
-
[ [0, 0, 0, 0,
|
62
|
-
[ [
|
63
|
-
[ [
|
64
|
-
[ [
|
65
|
-
[ [
|
66
|
-
[ [
|
67
|
-
|
68
|
-
|
69
|
-
[ [
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
###############################################################################
|
3
|
+
#
|
4
|
+
# A test for Spreadsheet::WriteExcel.
|
5
|
+
#
|
6
|
+
# Tests for the _position_object() Worksheet method used to calculate the
|
7
|
+
# vertices that define the position of a graphical object within a worksheet.
|
8
|
+
#
|
9
|
+
# See the the _position_object() comments for a full explanation.
|
10
|
+
#
|
11
|
+
# reverse('ゥ'), September 2005, John McNamara, jmcnamara@cpan.org
|
12
|
+
#
|
13
|
+
# original written in Perl by John McNamara
|
14
|
+
# converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp
|
15
|
+
#
|
16
|
+
#########################################################################
|
17
|
+
require 'helper'
|
18
|
+
require 'stringio'
|
19
|
+
|
20
|
+
class TC_position_object < Test::Unit::TestCase
|
21
|
+
|
22
|
+
def setup
|
23
|
+
@test_file = StringIO.new
|
24
|
+
@workbook = WriteExcel.new(@test_file)
|
25
|
+
@worksheet = @workbook.add_worksheet
|
26
|
+
end
|
27
|
+
|
28
|
+
def teardown
|
29
|
+
@workbook.close
|
30
|
+
end
|
31
|
+
|
32
|
+
###############################################################################
|
33
|
+
#
|
34
|
+
# Tests extracted from images imported into Excel.
|
35
|
+
#
|
36
|
+
#
|
37
|
+
# input = ($col_start, $row_start, $x1, $y1, $width, $height)
|
38
|
+
# (0, 1, 2, 3, 4, 5 )
|
39
|
+
#
|
40
|
+
# expected = ($col_start, $x1, $row_start, $y1, $col_end, $x2, $row_end, $y2)
|
41
|
+
# (0, 1, 2, 3, 4, 5, 6, 7 )
|
42
|
+
#
|
43
|
+
def test_extracted_from_images_imported_into_excel
|
44
|
+
tests = [
|
45
|
+
# Input # Expected results
|
46
|
+
[ [0, 0, 0, 0, 1, 1], [ 0, 0, 0, 0, 0, 16, 0, 15] ],
|
47
|
+
[ [0, 0, 0, 0, 2, 2], [ 0, 0, 0, 0, 0, 32, 0, 30] ],
|
48
|
+
[ [0, 0, 0, 0, 3, 3], [ 0, 0, 0, 0, 0, 48, 0, 45] ],
|
49
|
+
[ [0, 0, 0, 0, 4, 4], [ 0, 0, 0, 0, 0, 64, 0, 60] ],
|
50
|
+
[ [0, 0, 0, 0, 5, 5], [ 0, 0, 0, 0, 0, 80, 0, 75] ],
|
51
|
+
[ [0, 0, 0, 0, 6, 6], [ 0, 0, 0, 0, 0, 96, 0, 90] ],
|
52
|
+
[ [0, 0, 0, 0, 7, 7], [ 0, 0, 0, 0, 0, 112, 0, 105] ],
|
53
|
+
[ [0, 0, 0, 0, 8, 8], [ 0, 0, 0, 0, 0, 128, 0, 120] ],
|
54
|
+
[ [0, 0, 0, 0, 9, 9], [ 0, 0, 0, 0, 0, 144, 0, 136] ],
|
55
|
+
[ [0, 0, 0, 0, 10, 10], [ 0, 0, 0, 0, 0, 160, 0, 151] ],
|
56
|
+
[ [0, 0, 0, 0, 15, 15], [ 0, 0, 0, 0, 0, 240, 0, 226] ],
|
57
|
+
[ [0, 0, 0, 0, 16, 16], [ 0, 0, 0, 0, 0, 256, 0, 241] ],
|
58
|
+
[ [0, 0, 0, 0, 17, 17], [ 0, 0, 0, 0, 0, 272, 1, 0] ],
|
59
|
+
[ [0, 0, 0, 0, 18, 18], [ 0, 0, 0, 0, 0, 288, 1, 15] ],
|
60
|
+
[ [0, 0, 0, 0, 19, 19], [ 0, 0, 0, 0, 0, 304, 1, 30] ],
|
61
|
+
[ [0, 0, 0, 0, 62, 8], [ 0, 0, 0, 0, 0, 992, 0, 120] ],
|
62
|
+
[ [0, 0, 0, 0, 63, 8], [ 0, 0, 0, 0, 0, 1008, 0, 120] ],
|
63
|
+
[ [0, 0, 0, 0, 64, 8], [ 0, 0, 0, 0, 1, 0, 0, 120] ],
|
64
|
+
[ [0, 0, 0, 0, 65, 8], [ 0, 0, 0, 0, 1, 16, 0, 120] ],
|
65
|
+
[ [0, 0, 0, 0, 66, 8], [ 0, 0, 0, 0, 1, 32, 0, 120] ],
|
66
|
+
[ [0, 0, 0, 0, 200, 200], [ 0, 0, 0, 0, 3, 128, 11, 196] ],
|
67
|
+
[ [1, 4, 0, 0, 64, 16], [ 1, 0, 4, 0, 2, 0, 4, 241] ],
|
68
|
+
[ [1, 4, 1, 0, 64, 16], [ 1, 16, 4, 0, 2, 16, 4, 241] ],
|
69
|
+
[ [1, 4, 2, 0, 64, 16], [ 1, 32, 4, 0, 2, 32, 4, 241] ],
|
70
|
+
[ [1, 4, 2, 1, 64, 16], [ 1, 32, 4, 15, 2, 32, 5, 0] ],
|
71
|
+
[ [1, 4, 2, 2, 64, 16], [ 1, 32, 4, 30, 2, 32, 5, 15] ],
|
72
|
+
|
73
|
+
# Test for comment box standard sizes.
|
74
|
+
[ [2, 1, 15, 7, 128, 74], [ 2, 240, 1, 105, 4, 240, 5, 196] ]
|
75
|
+
]
|
76
|
+
|
77
|
+
tests.each do |testcase|
|
78
|
+
input = testcase[0]
|
79
|
+
expected = testcase[1]
|
80
|
+
results = @worksheet.position_object(*input)
|
81
|
+
assert_equal(expected, results)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
data/test/test_26_autofilter.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
##########################################################################
|
2
3
|
# test_26_autofilter.rb
|
3
4
|
#
|
@@ -10,6 +11,7 @@
|
|
10
11
|
#
|
11
12
|
#########################################################################
|
12
13
|
require 'helper'
|
14
|
+
require 'stringio'
|
13
15
|
|
14
16
|
class TC_26_autofilter < Test::Unit::TestCase
|
15
17
|
|
@@ -31,19 +33,8 @@ def test_26_autofilter
|
|
31
33
|
end
|
32
34
|
end
|
33
35
|
|
34
|
-
###############################################################################
|
35
|
-
#
|
36
|
-
# Unpack the binary data into a format suitable for printing in tests.
|
37
|
-
#
|
38
|
-
def unpack_record(data)
|
39
|
-
data.unpack('C*').map! {|c| sprintf("%02X", c) }.join(' ')
|
40
|
-
end
|
41
|
-
|
42
36
|
def setup
|
43
|
-
|
44
|
-
path = "temp#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
|
45
|
-
@test_file = File.join(Dir.tmpdir, path)
|
46
|
-
@workbook = WriteExcel.new(@test_file)
|
37
|
+
@workbook = WriteExcel.new(StringIO.new)
|
47
38
|
@worksheet = @workbook.add_worksheet
|
48
39
|
@tests = [
|
49
40
|
{
|
@@ -318,7 +309,6 @@ def setup
|
|
318
309
|
|
319
310
|
def teardown
|
320
311
|
@workbook.close
|
321
|
-
File.unlink(@test_file) if FileTest.exist?(@test_file)
|
322
312
|
end
|
323
313
|
|
324
314
|
end
|
data/test/test_27_autofilter.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
##########################################################################
|
2
3
|
# test_27_autofilter.rb
|
3
4
|
#
|
@@ -10,6 +11,7 @@
|
|
10
11
|
#
|
11
12
|
#########################################################################
|
12
13
|
require 'helper'
|
14
|
+
require 'stringio'
|
13
15
|
|
14
16
|
class TC_27_autofilter < Test::Unit::TestCase
|
15
17
|
|
@@ -25,19 +27,8 @@ def test_27_autofilter
|
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
28
|
-
###############################################################################
|
29
|
-
#
|
30
|
-
# Unpack the binary data into a format suitable for printing in tests.
|
31
|
-
#
|
32
|
-
def unpack_record(data)
|
33
|
-
data.unpack('C*').map! {|c| sprintf("%02X", c) }.join(' ')
|
34
|
-
end
|
35
|
-
|
36
30
|
def setup
|
37
|
-
|
38
|
-
path = "temp#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
|
39
|
-
@test_file = File.join(Dir.tmpdir, path)
|
40
|
-
@workbook = WriteExcel.new(@test_file)
|
31
|
+
@workbook = WriteExcel.new(StringIO.new)
|
41
32
|
@worksheet = @workbook.add_worksheet
|
42
33
|
@tests = [
|
43
34
|
[
|
@@ -135,7 +126,6 @@ def setup
|
|
135
126
|
|
136
127
|
def teardown
|
137
128
|
@workbook.close
|
138
|
-
File.unlink(@test_file) if FileTest.exist?(@test_file)
|
139
129
|
end
|
140
130
|
|
141
131
|
end
|
data/test/test_28_autofilter.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
##########################################################################
|
2
3
|
# test_28_autofilter.rb
|
3
4
|
#
|
@@ -10,6 +11,7 @@
|
|
10
11
|
#
|
11
12
|
#########################################################################
|
12
13
|
require 'helper'
|
14
|
+
require 'stringio'
|
13
15
|
|
14
16
|
class TC_28_autofilter < Test::Unit::TestCase
|
15
17
|
|
@@ -26,19 +28,8 @@ def test_28_autofilter
|
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
29
|
-
###############################################################################
|
30
|
-
#
|
31
|
-
# Unpack the binary data into a format suitable for printing in tests.
|
32
|
-
#
|
33
|
-
def unpack_record(data)
|
34
|
-
data.unpack('C*').map! {|c| sprintf("%02X", c) }.join(' ')
|
35
|
-
end
|
36
|
-
|
37
31
|
def setup
|
38
|
-
|
39
|
-
path = "temp#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
|
40
|
-
@test_file = File.join(Dir.tmpdir, path)
|
41
|
-
@workbook = WriteExcel.new(@test_file)
|
32
|
+
@workbook = WriteExcel.new(StringIO.new)
|
42
33
|
@worksheet = @workbook.add_worksheet
|
43
34
|
@tests = [
|
44
35
|
[
|
@@ -165,7 +156,6 @@ def setup
|
|
165
156
|
|
166
157
|
def teardown
|
167
158
|
@workbook.close
|
168
|
-
File.unlink(@test_file) if FileTest.exist?(@test_file)
|
169
159
|
end
|
170
160
|
|
171
161
|
end
|
data/test/test_29_process_jpg.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
##########################################################################
|
2
3
|
# test_29_process_jpg.rb
|
3
4
|
#
|
@@ -26,6 +27,10 @@ def setup
|
|
26
27
|
@type = 5 # Excel Blip type (MSOBLIPTYPE).
|
27
28
|
end
|
28
29
|
|
30
|
+
def teardown
|
31
|
+
@workbook.close
|
32
|
+
end
|
33
|
+
|
29
34
|
def test_valid_jpg_image_1
|
30
35
|
testname = '3w x 5h jpeg image.'
|
31
36
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
##########################################################################
|
2
3
|
# test_30_validation_dval.rb
|
3
4
|
#
|
@@ -10,20 +11,17 @@
|
|
10
11
|
#
|
11
12
|
#########################################################################
|
12
13
|
require 'helper'
|
14
|
+
require 'stringio'
|
13
15
|
|
14
16
|
class TC_validation_dval < Test::Unit::TestCase
|
15
17
|
|
16
18
|
def setup
|
17
|
-
|
18
|
-
path = "temp#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
|
19
|
-
@test_file = File.join(Dir.tmpdir, path)
|
20
|
-
@workbook = WriteExcel.new(@test_file)
|
19
|
+
@workbook = WriteExcel.new(StringIO.new)
|
21
20
|
@worksheet = @workbook.add_worksheet
|
22
21
|
end
|
23
22
|
|
24
23
|
def teardown
|
25
24
|
@workbook.close
|
26
|
-
File.unlink(@test_file) if FileTest.exist?(@test_file)
|
27
25
|
end
|
28
26
|
|
29
27
|
def test_1
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
##########################################################################
|
2
3
|
# test_31_validation_dv_strings.rb
|
3
4
|
#
|
@@ -11,20 +12,17 @@
|
|
11
12
|
#
|
12
13
|
#########################################################################
|
13
14
|
require 'helper'
|
15
|
+
require 'stringio'
|
14
16
|
|
15
17
|
class TC_validation_dv_strings < Test::Unit::TestCase
|
16
18
|
|
17
19
|
def setup
|
18
|
-
|
19
|
-
path = "temp#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
|
20
|
-
@test_file = File.join(Dir.tmpdir, path)
|
21
|
-
@workbook = WriteExcel.new(@test_file)
|
20
|
+
@workbook = WriteExcel.new(StringIO.new)
|
22
21
|
@worksheet = @workbook.add_worksheet
|
23
22
|
end
|
24
23
|
|
25
24
|
def teardown
|
26
25
|
@workbook.close
|
27
|
-
File.unlink(@test_file) if FileTest.exist?(@test_file)
|
28
26
|
end
|
29
27
|
|
30
28
|
def test_empty_string
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
##########################################################################
|
2
3
|
# test_32_validation_dv_formula.rb
|
3
4
|
#
|
@@ -10,21 +11,18 @@
|
|
10
11
|
#
|
11
12
|
#########################################################################
|
12
13
|
require 'helper'
|
14
|
+
require 'stringio'
|
13
15
|
|
14
16
|
class TC_validation_dv_formula < Test::Unit::TestCase
|
15
17
|
|
16
18
|
def setup
|
17
|
-
|
18
|
-
path = "temp#{t}-#{$$}-#{rand(0x100000000).to_s(36)}"
|
19
|
-
@test_file = File.join(Dir.tmpdir, path)
|
20
|
-
@workbook = WriteExcel.new(@test_file)
|
19
|
+
@workbook = WriteExcel.new(StringIO.new)
|
21
20
|
@worksheet = @workbook.add_worksheet
|
22
21
|
@worksheet2 = @workbook.add_worksheet
|
23
22
|
end
|
24
23
|
|
25
24
|
def teardown
|
26
25
|
@workbook.close
|
27
|
-
File.unlink(@test_file) if FileTest.exist?(@test_file)
|
28
26
|
end
|
29
27
|
|
30
28
|
def test_integer_values
|