writeexcel 1.0.5 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/test-suite.yml +26 -0
  3. data/README.rdoc +11 -2
  4. data/lib/writeexcel/biffwriter.rb +2 -1
  5. data/lib/writeexcel/cell_range.rb +1 -0
  6. data/lib/writeexcel/chart.rb +2 -3
  7. data/lib/writeexcel/charts/area.rb +1 -1
  8. data/lib/writeexcel/charts/pie.rb +1 -1
  9. data/lib/writeexcel/charts/scatter.rb +1 -1
  10. data/lib/writeexcel/charts/stock.rb +1 -1
  11. data/lib/writeexcel/col_info.rb +2 -2
  12. data/lib/writeexcel/comments.rb +2 -1
  13. data/lib/writeexcel/convert_date_time.rb +7 -7
  14. data/lib/writeexcel/excelformulaparser.rb +50 -50
  15. data/lib/writeexcel/format.rb +1 -1
  16. data/lib/writeexcel/formula.rb +1 -1
  17. data/lib/writeexcel/helper.rb +3 -3
  18. data/lib/writeexcel/properties.rb +1 -1
  19. data/lib/writeexcel/shared_string_table.rb +5 -5
  20. data/lib/writeexcel/storage_lite.rb +2 -9
  21. data/lib/writeexcel/version.rb +2 -4
  22. data/lib/writeexcel/workbook.rb +14 -25
  23. data/lib/writeexcel/worksheet.rb +73 -56
  24. data/lib/writeexcel/worksheets.rb +1 -2
  25. data/lib/writeexcel.rb +3 -5
  26. data/test/helper.rb +12 -4
  27. data/test/test_00_IEEE_double.rb +1 -1
  28. data/test/test_04_dimensions.rb +6 -6
  29. data/test/test_05_rows.rb +14 -17
  30. data/test/test_06_extsst.rb +8 -11
  31. data/test/test_11_date_time.rb +1 -1
  32. data/test/test_12_date_only.rb +1 -1
  33. data/test/test_13_date_seconds.rb +1 -1
  34. data/test/test_21_escher.rb +5 -5
  35. data/test/test_22_mso_drawing_group.rb +37 -40
  36. data/test/test_23_note.rb +5 -5
  37. data/test/test_24_txo.rb +5 -5
  38. data/test/test_25_position_object.rb +5 -5
  39. data/test/test_26_autofilter.rb +1 -1
  40. data/test/test_27_autofilter.rb +1 -1
  41. data/test/test_28_autofilter.rb +1 -1
  42. data/test/test_29_process_jpg.rb +1 -43
  43. data/test/test_30_validation_dval.rb +5 -5
  44. data/test/test_31_validation_dv_strings.rb +8 -8
  45. data/test/test_32_validation_dv_formula.rb +5 -5
  46. data/test/test_40_property_types.rb +1 -1
  47. data/test/test_41_properties.rb +1 -1
  48. data/test/test_42_set_properties.rb +30 -37
  49. data/test/test_50_name_stored.rb +1 -19
  50. data/test/test_51_name_print_area.rb +3 -13
  51. data/test/test_52_name_print_titles.rb +3 -21
  52. data/test/test_53_autofilter.rb +1 -5
  53. data/test/test_60_chart_generic.rb +3 -3
  54. data/test/test_61_chart_subclasses.rb +2 -1
  55. data/test/test_62_chart_formats.rb +9 -21
  56. data/test/test_63_chart_area_formats.rb +1 -1
  57. data/test/test_compatibility.rb +1 -1
  58. data/test/test_example_match.rb +835 -835
  59. data/test/test_format.rb +1 -114
  60. data/test/test_formula.rb +1 -1
  61. data/test/test_properties.rb +1 -2
  62. data/test/test_storage_lite.rb +2 -2
  63. data/test/test_workbook.rb +1 -66
  64. data/test/test_worksheet.rb +1 -18
  65. data/test/test_write_formula_does_not_change_formula_string.rb +1 -1
  66. data/writeexcel.gemspec +6 -3
  67. metadata +24 -21
  68. data/test/test_01_add_worksheet.rb +0 -43
  69. data/test/test_02_merge_formats.rb +0 -49
  70. data/test/test_biff.rb +0 -71
  71. data/test/test_big_workbook.rb +0 -17
  72. data/test/test_ole.rb +0 -102
@@ -13,7 +13,7 @@
13
13
  require 'helper'
14
14
  require 'stringio'
15
15
 
16
- class TC_29_process_jpg < Test::Unit::TestCase
16
+ class TC_29_process_jpg < Minitest::Test
17
17
 
18
18
  def setup
19
19
  @image = Writeexcel::Image.new(nil, nil, nil, nil)
@@ -21,7 +21,6 @@ class TC_29_process_jpg < Test::Unit::TestCase
21
21
  end
22
22
 
23
23
  def test_valid_jpg_image_1
24
- testname = '3w x 5h jpeg image.'
25
24
 
26
25
  data = %w(
27
26
  FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 60
@@ -50,8 +49,6 @@ class TC_29_process_jpg < Test::Unit::TestCase
50
49
  end
51
50
 
52
51
  def test_valid_jpg_image_2
53
- testname = '5w x 3h jpeg image.'
54
-
55
52
  data = %w(
56
53
  FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 60
57
54
  00 60 00 00 FF DB 00 43 00 06 04 05 06 05 04 06
@@ -79,50 +76,11 @@ class TC_29_process_jpg < Test::Unit::TestCase
79
76
  assert_equal(3, @image.height)
80
77
  end
81
78
 
82
- def test_valid_jpg_image_3_ffco_marker_missing
83
- testname = 'FFCO marker missing in image.'
84
-
85
- data = %w(
86
- FF D8 FF E0 00 10 4A 46 49 46 00 01 01 01 00 60
87
- 00 60 00 00 FF DB 00 43 00 06 04 05 06 05 04 06
88
- 06 05 06 07 07 06 08 0A 10 0A 0A 09 09 0A 14 0E
89
- 0F 0C 10 17 14 18 18 17 14 16 16 1A 1D 25 1F 1A
90
- 1B 23 1C 16 16 20 2C 20 23 26 27 29 2A 29 19 1F
91
- 2D 30 2D 28 30 25 28 29 28 FF DB 00 43 01 07 07
92
- 07 0A 08 0A 13 0A 0A 13 28 1A 16 1A 28 28 28 28
93
- 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28
94
- 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28
95
- 28 28 28 28 28 28 28 28 28 28 28 28 28 28 FF C1
96
- 00 11 08 00 03 00 05 03 01 22 00 02 11 01 03 11
97
- 01 FF C4 00 15 00 01 01 00 00 00 00 00 00 00 00
98
- 00 00 00 00 00 00 00 07 FF C4 00 14 10 01 00 00
99
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF C4
100
- 00 15 01 01 01 00 00 00 00 00 00 00 00 00 00 00
101
- 00 00 00 06 08 FF C4 00 14 11 01 00 00 00 00 00
102
- 00 00 00 00 00 00 00 00 00 00 00 FF DA 00 0C 03
103
- 01 00 02 11 03 11 00 3F 00 9D 00 1C A4 5F FF D9
104
- )
105
-
106
- assert_raise(RuntimeError, " \t" + testname) {
107
- @image.__send__("process_jpg", [data.join('')].pack('H*'))
108
- }
109
- end
110
-
111
- def test_invalid_jpeg_image
112
- testname = 'empty image'
113
- image = ''
114
-
115
- assert_raise(RuntimeError, " \t" + testname) {
116
- @image.__send__("process_jpg", image)
117
- }
118
- end
119
-
120
79
  ###############################################################################
121
80
  #
122
81
  # Test 5. Progressive DCT-based JPEG image.
123
82
  #
124
83
  def test_progressive_dct_based_jpeg_image
125
- testname = '35w x 35h progressive jpeg image.'
126
84
  data = %w(
127
85
  FF D8 FF E0 00 10 4A 46 49 46 00 01 02 01 00 96
128
86
  00 96 00 00 FF E1 04 E7 45 78 69 66 00 00 4D 4D
@@ -13,7 +13,7 @@
13
13
  require 'helper'
14
14
  require 'stringio'
15
15
 
16
- class TC_validation_dval < Test::Unit::TestCase
16
+ class TC_validation_dval < Minitest::Test
17
17
 
18
18
  def setup
19
19
  @workbook = WriteExcel.new(StringIO.new)
@@ -22,11 +22,11 @@ class TC_validation_dval < Test::Unit::TestCase
22
22
  end
23
23
 
24
24
  def teardown
25
- if @workbook.instance_variable_get(:@filehandle)
26
- @workbook.instance_variable_get(:@filehandle).close(true)
25
+ if @workbook.instance_variable_get("@filehandle")
26
+ @workbook.instance_variable_get("@filehandle").close(true)
27
27
  end
28
- if @worksheet.instance_variable_get(:@filehandle)
29
- @worksheet.instance_variable_get(:@filehandle).close(true)
28
+ if @worksheet.instance_variable_get("@filehandle")
29
+ @worksheet.instance_variable_get("@filehandle").close(true)
30
30
  end
31
31
  end
32
32
 
@@ -14,20 +14,20 @@
14
14
  require 'helper'
15
15
  require 'stringio'
16
16
 
17
- class TC_validation_dv_strings < Test::Unit::TestCase
17
+ class TC_validation_dv_strings < Minitest::Test
18
18
 
19
19
  def setup
20
- workbook = WriteExcel.new(StringIO.new)
21
- worksheet = workbook.add_worksheet
22
- @data_validation = Writeexcel::Worksheet::DataValidation.new(worksheet.__send__("parser"), {})
20
+ @workbook = WriteExcel.new(StringIO.new)
21
+ @worksheet = @workbook.add_worksheet
22
+ @data_validation = Writeexcel::Worksheet::DataValidation.new(@worksheet.__send__("parser"), {})
23
23
  end
24
24
 
25
25
  def teardown
26
- if @workbook.instance_variable_get(:@filehandle)
27
- @workbook.instance_variable_get(:@filehandle).close(true)
26
+ if @workbook.instance_variable_get("@filehandle")
27
+ @workbook.instance_variable_get("@filehandle").close(true)
28
28
  end
29
- if @worksheet.instance_variable_get(:@filehandle)
30
- @worksheet.instance_variable_get(:@filehandle).close(true)
29
+ if @worksheet.instance_variable_get("@filehandle")
30
+ @worksheet.instance_variable_get("@filehandle").close(true)
31
31
  end
32
32
  end
33
33
 
@@ -13,7 +13,7 @@
13
13
  require 'helper'
14
14
  require 'stringio'
15
15
 
16
- class TC_validation_dv_formula < Test::Unit::TestCase
16
+ class TC_validation_dv_formula < Minitest::Test
17
17
 
18
18
  def setup
19
19
  @workbook = WriteExcel.new(StringIO.new)
@@ -23,11 +23,11 @@ class TC_validation_dv_formula < Test::Unit::TestCase
23
23
  end
24
24
 
25
25
  def teardown
26
- if @workbook.instance_variable_get(:@filehandle)
27
- @workbook.instance_variable_get(:@filehandle).close(true)
26
+ if @workbook.instance_variable_get("@filehandle")
27
+ @workbook.instance_variable_get("@filehandle").close(true)
28
28
  end
29
- if @worksheet.instance_variable_get(:@filehandle)
30
- @worksheet.instance_variable_get(:@filehandle).close(true)
29
+ if @worksheet.instance_variable_get("@filehandle")
30
+ @worksheet.instance_variable_get("@filehandle").close(true)
31
31
  end
32
32
  end
33
33
 
@@ -12,7 +12,7 @@
12
12
  #########################################################################
13
13
  require 'helper'
14
14
 
15
- class TC_property_types < Test::Unit::TestCase
15
+ class TC_property_types < Minitest::Test
16
16
 
17
17
  def setup
18
18
  @smiley = '☺' # chr 0x263A; in perl
@@ -12,7 +12,7 @@
12
12
  #########################################################################
13
13
  require 'helper'
14
14
 
15
- class TC_properties < Test::Unit::TestCase
15
+ class TC_properties < Minitest::Test
16
16
 
17
17
  def setup
18
18
  @smiley = '☺' # chr 0x263A; in perl
@@ -19,30 +19,23 @@
19
19
  require 'helper'
20
20
  require 'stringio'
21
21
 
22
- class TC_set_properties < Test::Unit::TestCase
23
-
24
- def test_dummy
25
- assert(true)
26
- end
22
+ class TC_set_properties < Minitest::Test
27
23
 
28
24
  def setup
29
25
  @test_file = StringIO.new
30
26
  end
31
27
 
32
28
  def teardown
33
- if @workbook.instance_variable_get(:@filehandle)
34
- @workbook.instance_variable_get(:@filehandle).close(true)
35
- end
36
- if @worksheet.instance_variable_get(:@filehandle)
37
- @worksheet.instance_variable_get(:@filehandle).close(true)
29
+ if @workbook.instance_variable_get("@filehandle")
30
+ @workbook.instance_variable_get("@filehandle").close(true)
38
31
  end
39
32
  end
40
33
 
41
34
  def test_same_as_previous_plus_creation_date
42
35
  smiley = '☺' # chr 0x263A; in perl
43
36
 
44
- workbook = WriteExcel.new(@test_file)
45
- worksheet = workbook.add_worksheet
37
+ @workbook = WriteExcel.new(@test_file)
38
+ @workbook.add_worksheet
46
39
 
47
40
  =begin
48
41
  ###############################################################################
@@ -122,7 +115,7 @@ class TC_set_properties < Test::Unit::TestCase
122
115
  # Test 4. Codepage only.
123
116
  #
124
117
 
125
- workbook.set_properties(
118
+ @workbook.set_properties(
126
119
  :created => nil
127
120
  )
128
121
 
@@ -135,7 +128,7 @@ class TC_set_properties < Test::Unit::TestCase
135
128
  02 00 00 00 E4 04 00 00
136
129
  ).join(' ')
137
130
 
138
- result = unpack_record(workbook.summary)
131
+ result = unpack_record(@workbook.summary)
139
132
  assert_equal(target, result, caption)
140
133
 
141
134
  ###############################################################################
@@ -143,7 +136,7 @@ class TC_set_properties < Test::Unit::TestCase
143
136
  # Test 5. Same as previous + Title.
144
137
  #
145
138
 
146
- workbook.set_properties(
139
+ @workbook.set_properties(
147
140
  :title => 'Title',
148
141
  :created => nil
149
142
  )
@@ -158,7 +151,7 @@ class TC_set_properties < Test::Unit::TestCase
158
151
  1E 00 00 00 06 00 00 00 54 69 74 6C 65 00 00 00
159
152
  ).join(' ')
160
153
 
161
- result = unpack_record(workbook.summary)
154
+ result = unpack_record(@workbook.summary)
162
155
  assert_equal(target, result, caption)
163
156
 
164
157
  ###############################################################################
@@ -166,7 +159,7 @@ class TC_set_properties < Test::Unit::TestCase
166
159
  # Test 6. Same as previous + Subject.
167
160
  #
168
161
 
169
- workbook.set_properties(
162
+ @workbook.set_properties(
170
163
  :title => 'Title',
171
164
  :subject => 'Subject',
172
165
  :created => nil
@@ -184,7 +177,7 @@ class TC_set_properties < Test::Unit::TestCase
184
177
  53 75 62 6A 65 63 74 00
185
178
  ).join(' ')
186
179
 
187
- result = unpack_record(workbook.summary)
180
+ result = unpack_record(@workbook.summary)
188
181
  assert_equal(target, result, caption)
189
182
 
190
183
  ###############################################################################
@@ -192,7 +185,7 @@ class TC_set_properties < Test::Unit::TestCase
192
185
  # Test 7. Same as previous + Author.
193
186
  #
194
187
 
195
- workbook.set_properties(
188
+ @workbook.set_properties(
196
189
  :title => 'Title',
197
190
  :subject => 'Subject',
198
191
  :author => 'Author',
@@ -212,7 +205,7 @@ class TC_set_properties < Test::Unit::TestCase
212
205
  1E 00 00 00 07 00 00 00 41 75 74 68 6F 72 00 00
213
206
  ).join(' ')
214
207
 
215
- result = unpack_record(workbook.summary)
208
+ result = unpack_record(@workbook.summary)
216
209
  assert_equal(target, result, caption)
217
210
 
218
211
  ###############################################################################
@@ -220,7 +213,7 @@ class TC_set_properties < Test::Unit::TestCase
220
213
  # Test 8. Same as previous + Keywords.
221
214
  #
222
215
 
223
- workbook.set_properties(
216
+ @workbook.set_properties(
224
217
  :title => 'Title',
225
218
  :subject => 'Subject',
226
219
  :author => 'Author',
@@ -243,7 +236,7 @@ class TC_set_properties < Test::Unit::TestCase
243
236
  4B 65 79 77 6F 72 64 73 00 00 00 00
244
237
  ).join(' ')
245
238
 
246
- result = unpack_record(workbook.summary)
239
+ result = unpack_record(@workbook.summary)
247
240
  assert_equal(target, result, caption)
248
241
 
249
242
  ###############################################################################
@@ -251,7 +244,7 @@ class TC_set_properties < Test::Unit::TestCase
251
244
  # Test 9. Same as previous + Comments.
252
245
  #
253
246
 
254
- workbook.set_properties(
247
+ @workbook.set_properties(
255
248
  :title => 'Title',
256
249
  :subject => 'Subject',
257
250
  :author => 'Author',
@@ -277,7 +270,7 @@ class TC_set_properties < Test::Unit::TestCase
277
270
  65 6E 74 73 00 00 00 00
278
271
  ).join(' ')
279
272
 
280
- result = unpack_record(workbook.summary)
273
+ result = unpack_record(@workbook.summary)
281
274
  assert_equal(target, result, caption)
282
275
 
283
276
  ###############################################################################
@@ -285,7 +278,7 @@ class TC_set_properties < Test::Unit::TestCase
285
278
  # Test 10. Same as previous + Last author.
286
279
  #
287
280
 
288
- workbook.set_properties(
281
+ @workbook.set_properties(
289
282
  :title => 'Title',
290
283
  :subject => 'Subject',
291
284
  :author => 'Author',
@@ -314,7 +307,7 @@ class TC_set_properties < Test::Unit::TestCase
314
307
  00 00 00 00
315
308
  ).join(' ')
316
309
 
317
- result = unpack_record(workbook.summary)
310
+ result = unpack_record(@workbook.summary)
318
311
  assert_equal(target, result, caption)
319
312
 
320
313
  ###############################################################################
@@ -328,7 +321,7 @@ class TC_set_properties < Test::Unit::TestCase
328
321
  # different timezones.
329
322
 
330
323
  filetime = Time.gm(2008,8,19,23,20,13)
331
- workbook.set_properties(
324
+ @workbook.set_properties(
332
325
  :title => 'Title',
333
326
  :subject => 'Subject',
334
327
  :author => 'Author',
@@ -358,7 +351,7 @@ class TC_set_properties < Test::Unit::TestCase
358
351
  80 74 89 21 52 02 C9 01
359
352
  ).join(' ')
360
353
 
361
- result = unpack_record(workbook.summary)
354
+ result = unpack_record(@workbook.summary)
362
355
  assert_equal(target, result, caption)
363
356
 
364
357
  ###############################################################################
@@ -370,9 +363,9 @@ class TC_set_properties < Test::Unit::TestCase
370
363
  # $sec,$min,$hour,$mday,$mon,$year
371
364
  # We normalise the time using timegm() so that the tests don't fail due to
372
365
  # different timezones.
373
- workbook.localtime = Time.gm(2008,8,19,23,20,13)
366
+ @workbook.localtime = Time.gm(2008,8,19,23,20,13)
374
367
 
375
- workbook.set_properties(
368
+ @workbook.set_properties(
376
369
  :title => 'Title',
377
370
  :subject => 'Subject',
378
371
  :author => 'Author',
@@ -401,7 +394,7 @@ class TC_set_properties < Test::Unit::TestCase
401
394
  80 74 89 21 52 02 C9 01
402
395
  ).join(' ')
403
396
 
404
- result = unpack_record(workbook.summary)
397
+ result = unpack_record(@workbook.summary)
405
398
  assert_equal(target, result, caption)
406
399
 
407
400
  ###############################################################################
@@ -409,10 +402,10 @@ class TC_set_properties < Test::Unit::TestCase
409
402
  # Test 14. UTF-8 string used.
410
403
  #
411
404
 
412
- workbook.set_properties(
413
- :title => 'Title' + smiley,
414
- :created => nil
415
- )
405
+ @workbook.set_properties(
406
+ :title => 'Title' + smiley,
407
+ :created => nil
408
+ )
416
409
 
417
410
  caption = " \tset_properties(utf8)"
418
411
  target = %w(
@@ -425,10 +418,10 @@ class TC_set_properties < Test::Unit::TestCase
425
418
  00 00 00 00
426
419
  ).join(' ')
427
420
 
428
- result = unpack_record(workbook.summary)
421
+ result = unpack_record(@workbook.summary)
429
422
  assert_equal(target, result, caption)
430
423
 
431
- workbook.close
424
+ @workbook.close
432
425
 
433
426
  end
434
427
  end
@@ -13,7 +13,7 @@
13
13
  require 'helper'
14
14
  require 'stringio'
15
15
 
16
- class TC_Name_Stored < Test::Unit::TestCase
16
+ class TC_Name_Stored < Minitest::Test
17
17
  def setup
18
18
  @test_file = StringIO.new
19
19
  @workbook = WriteExcel.new(@test_file)
@@ -21,7 +21,6 @@ class TC_Name_Stored < Test::Unit::TestCase
21
21
  end
22
22
 
23
23
  def test_print_area_name_with_simple_range
24
- caption = " \tNAME for worksheet1.print_area('A1:B12')"
25
24
  name = [0x06].pack('C')
26
25
  encoding = 0
27
26
  sheet_index = 1
@@ -38,13 +37,10 @@ class TC_Name_Stored < Test::Unit::TestCase
38
37
  00 00 00 06 3B 00 00 00 00 0B 00 00 00 01 00
39
38
  ).join('')].pack('H*')
40
39
 
41
- # result = _unpack_name(result)
42
- # target = _unpack_name(target)
43
40
  assert_equal(unpack_record(target), unpack_record(result))
44
41
  end
45
42
 
46
43
  def test_print_area_name_with_simple_range_in_sheet_3
47
- caption = " \tNAME for worksheet3.print_area('G7:H8')"
48
44
  name = [0x06].pack('C')
49
45
  encoding = 0
50
46
  sheet_index = 3
@@ -62,13 +58,10 @@ class TC_Name_Stored < Test::Unit::TestCase
62
58
  00 00 00 06 3B 02 00 06 00 07 00 06 00 07 00
63
59
  ).join('')].pack('H*')
64
60
 
65
- # result = _unpack_name(result)
66
- # target = _unpack_name(target)
67
61
  assert_equal(unpack_record(target), unpack_record(result))
68
62
  end
69
63
 
70
64
  def test_for_repeat_rows_name
71
- caption = " \tNAME for worksheet1.repeat_rows(0, 9)"
72
65
  name = [0x07].pack('C')
73
66
  encoding = 0
74
67
  sheet_index = 1
@@ -86,13 +79,10 @@ class TC_Name_Stored < Test::Unit::TestCase
86
79
  00 00 00 07 3B 00 00 00 00 09 00 00 00 FF 00
87
80
  ).join('')].pack('H*')
88
81
 
89
- # result = _unpack_name(result)
90
- # target = _unpack_name(target)
91
82
  assert_equal(unpack_record(target), unpack_record(result))
92
83
  end
93
84
 
94
85
  def test_for_repeat_rows_name_on_sheet_3
95
- caption = " \tNAME for worksheet3.repeat_rows(6, 7)"
96
86
  name = [0x07].pack('C')
97
87
  encoding = 0
98
88
  sheet_index = 1
@@ -116,7 +106,6 @@ class TC_Name_Stored < Test::Unit::TestCase
116
106
  end
117
107
 
118
108
  def test_for_repeat_columns_name
119
- caption = " \tNAME for worksheet1.repeat_columns('A:J')"
120
109
  name = [0x07].pack('C')
121
110
  encoding = 0
122
111
  sheet_index = 1
@@ -134,13 +123,10 @@ class TC_Name_Stored < Test::Unit::TestCase
134
123
  00 00 00 07 3B 00 00 00 00 FF FF 00 00 09 00
135
124
  ).join('')].pack('H*')
136
125
 
137
- # result = _unpack_name(result)
138
- # target = _unpack_name(target)
139
126
  assert_equal(unpack_record(target), unpack_record(result))
140
127
  end
141
128
 
142
129
  def test_for_repeat_rows_and_repeat_columns_together_name
143
- caption = " \tNAME for repeat_rows(1, 2) repeat_columns(3, 4)"
144
130
  name = [0x07].pack('C')
145
131
  encoding = 0
146
132
  sheet_index = 1
@@ -165,7 +151,6 @@ class TC_Name_Stored < Test::Unit::TestCase
165
151
  end
166
152
 
167
153
  def test_for_print_area_name_with_simple_range
168
- caption = " \tNAME for worksheet1.autofilter('A1:C5')"
169
154
  name = [0x0D].pack('C')
170
155
  encoding = 0
171
156
  sheet_index = 1
@@ -183,13 +168,10 @@ class TC_Name_Stored < Test::Unit::TestCase
183
168
  00 00 00 0D 3B 00 00 00 00 04 00 00 00 02 00
184
169
  ).join('')].pack('H*')
185
170
 
186
- # result = _unpack_name(result)
187
- # target = _unpack_name(target)
188
171
  assert_equal(unpack_record(target), unpack_record(result))
189
172
  end
190
173
 
191
174
  def test_for_define_name_global_name
192
- caption = " \tNAME for worksheet1.define_name('Foo', ...)"
193
175
  name = 'Foo'
194
176
  encoding = 0
195
177
  sheet_index = 0
@@ -13,7 +13,7 @@
13
13
  require 'helper'
14
14
  require 'stringio'
15
15
 
16
- class TC_Name_Print_Area < Test::Unit::TestCase
16
+ class TC_Name_Print_Area < Minitest::Test
17
17
  def setup
18
18
  @test_file = StringIO.new
19
19
  @workbook = WriteExcel.new(@test_file)
@@ -34,7 +34,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
34
34
  17 00 08 00 01 00 00 00 00 00 00 00
35
35
  ).join('')].pack('H*')
36
36
 
37
- caption = " \tExternsheet"
38
37
  result = _unpack_externsheet(@workbook.data)
39
38
  target = _unpack_externsheet(target)
40
39
  assert_equal(target, result)
@@ -48,7 +47,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
48
47
  00 00 00 06 3B 00 00 00 00 0B 00 00 00 01 00
49
48
  ).join('')].pack('H*')
50
49
 
51
- caption = " \t+ Name ( Sheet1!#{area} )";
52
50
  result = _unpack_name(@workbook.data)
53
51
  target = _unpack_name(target)
54
52
  assert_equal(target, result)
@@ -102,7 +100,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
102
100
  17 00 08 00 01 00 00 00 00 00 00 00
103
101
  ).join('')].pack('H*')
104
102
 
105
- caption = " \tExternsheet"
106
103
  result = _unpack_externsheet(@workbook.data)
107
104
  target = _unpack_externsheet(target)
108
105
  assert_equal(target, result)
@@ -116,7 +113,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
116
113
  00 00 00 06 3B 00 00 00 00 FF FF 00 00 00 00
117
114
  ).join('')].pack('H*')
118
115
 
119
- caption = " \t+ Name ( Sheet1!#{area} )";
120
116
  result = _unpack_name(@workbook.data)
121
117
  target = _unpack_name(target)
122
118
  assert_equal(target, result)
@@ -136,7 +132,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
136
132
  17 00 08 00 01 00 00 00 00 00 00 00
137
133
  ).join('')].pack('H*')
138
134
 
139
- caption = " \tExternsheet"
140
135
  result = _unpack_externsheet(@workbook.data)
141
136
  target = _unpack_externsheet(target)
142
137
  assert_equal(target, result)
@@ -150,7 +145,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
150
145
  00 00 00 06 3B 00 00 00 00 FF FF 00 00 07 00
151
146
  ).join('')].pack('H*')
152
147
 
153
- caption = " \t+ Name ( Sheet1!#{area} )";
154
148
  result = _unpack_name(@workbook.data)
155
149
  target = _unpack_name(target)
156
150
  assert_equal(target, result)
@@ -174,7 +168,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
174
168
  01 00 00 00 02 00 02 00
175
169
  ).join('')].pack('H*')
176
170
 
177
- caption = " \tExternsheet"
178
171
  result = _unpack_externsheet(@workbook.data)
179
172
  target = _unpack_externsheet(target)
180
173
  assert_equal(target, result)
@@ -194,7 +187,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
194
187
  00 00 00 06 3B 02 00 06 00 07 00 06 00 07 00
195
188
  ).join('')].pack('H*')
196
189
 
197
- caption = " \t+ Name ( Sheet1!A1:B2, Sheet2!D4:E5, Sheet3!G7:H8 )";
198
190
  result = _unpack_name(@workbook.data)
199
191
  target = _unpack_name(target)
200
192
  assert_equal(target, result)
@@ -202,9 +194,9 @@ class TC_Name_Print_Area < Test::Unit::TestCase
202
194
 
203
195
  def test_ranges_on_multiple_sheets_with_sheets_spaced_out
204
196
  worksheet1 = @workbook.add_worksheet
205
- worksheet2 = @workbook.add_worksheet
197
+ @workbook.add_worksheet
206
198
  worksheet3 = @workbook.add_worksheet
207
- worksheet4 = @workbook.add_worksheet
199
+ @workbook.add_worksheet
208
200
  worksheet5 = @workbook.add_worksheet
209
201
 
210
202
  worksheet1.print_area('A1:B2')
@@ -220,7 +212,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
220
212
  02 00 00 00 04 00 04 00
221
213
  ).join('')].pack('H*')
222
214
 
223
- caption = " \tExternsheet"
224
215
  result = _unpack_externsheet(@workbook.data)
225
216
  target = _unpack_externsheet(target)
226
217
  assert_equal(target, result)
@@ -240,7 +231,6 @@ class TC_Name_Print_Area < Test::Unit::TestCase
240
231
  00 00 00 06 3B 02 00 06 00 07 00 06 00 07 00
241
232
  ).join('')].pack('H*')
242
233
 
243
- caption = " \t+ Name ( Sheet1!A1:B2, Sheet3!D4:E5, Sheet5!G7:H8 )";
244
234
  result = _unpack_name(@workbook.data)
245
235
  target = _unpack_name(target)
246
236
  assert_equal(target, result)