write_xlsx 0.85.5 → 0.85.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (602) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -0
  3. data/Changes +3 -0
  4. data/lib/write_xlsx/compatibility.rb +1 -1
  5. data/lib/write_xlsx/package/xml_writer_simple.rb +1 -1
  6. data/lib/write_xlsx/version.rb +1 -1
  7. data/lib/write_xlsx/worksheet.rb +3 -2
  8. data/test/helper.rb +20 -0
  9. data/test/regression/disabled_test_vml04.rb +2 -2
  10. data/test/regression/test_array_formula01.rb +6 -6
  11. data/test/regression/test_array_formula02.rb +6 -6
  12. data/test/regression/test_autofilter00.rb +3 -3
  13. data/test/regression/test_autofilter01.rb +3 -3
  14. data/test/regression/test_autofilter02.rb +3 -3
  15. data/test/regression/test_autofilter03.rb +3 -3
  16. data/test/regression/test_autofilter04.rb +3 -3
  17. data/test/regression/test_autofilter05.rb +3 -3
  18. data/test/regression/test_autofilter06.rb +3 -3
  19. data/test/regression/test_autofilter07.rb +3 -3
  20. data/test/regression/test_button01.rb +3 -3
  21. data/test/regression/test_button02.rb +3 -3
  22. data/test/regression/test_button03.rb +3 -3
  23. data/test/regression/test_button04.rb +3 -3
  24. data/test/regression/test_button05.rb +3 -3
  25. data/test/regression/test_button06.rb +3 -3
  26. data/test/regression/test_button07.rb +3 -3
  27. data/test/regression/test_button08.rb +3 -3
  28. data/test/regression/test_button13.rb +2 -6
  29. data/test/regression/test_button14.rb +3 -3
  30. data/test/regression/test_chart_area01.rb +3 -3
  31. data/test/regression/test_chart_area02.rb +3 -3
  32. data/test/regression/test_chart_area03.rb +3 -3
  33. data/test/regression/test_chart_area04.rb +3 -3
  34. data/test/regression/test_chart_axis01.rb +6 -7
  35. data/test/regression/test_chart_axis02.rb +6 -7
  36. data/test/regression/test_chart_axis03.rb +9 -10
  37. data/test/regression/test_chart_axis04.rb +8 -9
  38. data/test/regression/test_chart_axis05.rb +8 -9
  39. data/test/regression/test_chart_axis06.rb +8 -9
  40. data/test/regression/test_chart_axis07.rb +8 -9
  41. data/test/regression/test_chart_axis08.rb +8 -9
  42. data/test/regression/test_chart_axis09.rb +8 -9
  43. data/test/regression/test_chart_axis10.rb +8 -9
  44. data/test/regression/test_chart_axis11.rb +8 -9
  45. data/test/regression/test_chart_axis12.rb +8 -9
  46. data/test/regression/test_chart_axis13.rb +8 -9
  47. data/test/regression/test_chart_axis14.rb +9 -10
  48. data/test/regression/test_chart_axis15.rb +9 -10
  49. data/test/regression/test_chart_axis16.rb +9 -10
  50. data/test/regression/test_chart_axis17.rb +6 -7
  51. data/test/regression/test_chart_axis18.rb +6 -7
  52. data/test/regression/test_chart_axis19.rb +6 -7
  53. data/test/regression/test_chart_axis20.rb +6 -7
  54. data/test/regression/test_chart_axis21.rb +6 -7
  55. data/test/regression/test_chart_axis22.rb +6 -7
  56. data/test/regression/test_chart_axis23.rb +6 -7
  57. data/test/regression/test_chart_axis24.rb +6 -7
  58. data/test/regression/test_chart_axis25.rb +6 -7
  59. data/test/regression/test_chart_axis26.rb +6 -7
  60. data/test/regression/test_chart_axis27.rb +6 -7
  61. data/test/regression/test_chart_axis28.rb +6 -7
  62. data/test/regression/test_chart_axis29.rb +6 -7
  63. data/test/regression/test_chart_axis30.rb +3 -7
  64. data/test/regression/test_chart_axis31.rb +3 -7
  65. data/test/regression/test_chart_axis32.rb +3 -7
  66. data/test/regression/test_chart_axis33.rb +6 -7
  67. data/test/regression/test_chart_axis34.rb +6 -7
  68. data/test/regression/test_chart_axis35.rb +6 -7
  69. data/test/regression/test_chart_axis36.rb +6 -7
  70. data/test/regression/test_chart_axis37.rb +6 -7
  71. data/test/regression/test_chart_axis38.rb +5 -10
  72. data/test/regression/test_chart_axis39.rb +6 -7
  73. data/test/regression/test_chart_bar01.rb +3 -3
  74. data/test/regression/test_chart_bar02.rb +11 -12
  75. data/test/regression/test_chart_bar03.rb +12 -13
  76. data/test/regression/test_chart_bar04.rb +12 -13
  77. data/test/regression/test_chart_bar05.rb +3 -7
  78. data/test/regression/test_chart_bar06.rb +9 -10
  79. data/test/regression/test_chart_bar07.rb +13 -14
  80. data/test/regression/test_chart_bar08.rb +3 -7
  81. data/test/regression/test_chart_bar09.rb +6 -7
  82. data/test/regression/test_chart_bar10.rb +6 -7
  83. data/test/regression/test_chart_bar11.rb +23 -25
  84. data/test/regression/test_chart_bar12.rb +3 -8
  85. data/test/regression/test_chart_bar13.rb +3 -8
  86. data/test/regression/test_chart_bar14.rb +10 -12
  87. data/test/regression/test_chart_bar15.rb +9 -11
  88. data/test/regression/test_chart_bar16.rb +8 -10
  89. data/test/regression/test_chart_bar17.rb +8 -10
  90. data/test/regression/test_chart_bar18.rb +17 -19
  91. data/test/regression/test_chart_bar19.rb +8 -10
  92. data/test/regression/test_chart_bar20.rb +8 -10
  93. data/test/regression/test_chart_bar21.rb +3 -7
  94. data/test/regression/test_chart_bar22.rb +8 -10
  95. data/test/regression/test_chart_bar23.rb +8 -10
  96. data/test/regression/test_chart_bar24.rb +9 -10
  97. data/test/regression/test_chart_blank01.rb +3 -3
  98. data/test/regression/test_chart_blank02.rb +3 -3
  99. data/test/regression/test_chart_blank03.rb +3 -3
  100. data/test/regression/test_chart_blank04.rb +3 -3
  101. data/test/regression/test_chart_blank05.rb +6 -8
  102. data/test/regression/test_chart_blank06.rb +3 -3
  103. data/test/regression/test_chart_chartarea01.rb +3 -3
  104. data/test/regression/test_chart_chartarea02.rb +3 -3
  105. data/test/regression/test_chart_chartarea03.rb +3 -3
  106. data/test/regression/test_chart_chartarea04.rb +6 -8
  107. data/test/regression/test_chart_chartarea05.rb +3 -3
  108. data/test/regression/test_chart_clustered01.rb +3 -3
  109. data/test/regression/test_chart_column01.rb +3 -7
  110. data/test/regression/test_chart_column02.rb +8 -9
  111. data/test/regression/test_chart_column03.rb +8 -9
  112. data/test/regression/test_chart_column04.rb +9 -10
  113. data/test/regression/test_chart_column05.rb +3 -3
  114. data/test/regression/test_chart_column06.rb +8 -9
  115. data/test/regression/test_chart_column07.rb +3 -7
  116. data/test/regression/test_chart_column08.rb +3 -7
  117. data/test/regression/test_chart_column09.rb +3 -7
  118. data/test/regression/test_chart_column10.rb +3 -7
  119. data/test/regression/test_chart_column11.rb +3 -7
  120. data/test/regression/test_chart_column12.rb +2 -10
  121. data/test/regression/test_chart_combined01.rb +3 -3
  122. data/test/regression/test_chart_combined02.rb +3 -3
  123. data/test/regression/test_chart_combined03.rb +3 -3
  124. data/test/regression/test_chart_combined04.rb +3 -3
  125. data/test/regression/test_chart_combined05.rb +3 -3
  126. data/test/regression/test_chart_combined06.rb +3 -3
  127. data/test/regression/test_chart_combined07.rb +3 -3
  128. data/test/regression/test_chart_combined08.rb +3 -3
  129. data/test/regression/test_chart_crossing01.rb +8 -9
  130. data/test/regression/test_chart_crossing02.rb +8 -9
  131. data/test/regression/test_chart_crossing03.rb +8 -9
  132. data/test/regression/test_chart_crossing04.rb +8 -9
  133. data/test/regression/test_chart_data_labels01.rb +3 -3
  134. data/test/regression/test_chart_data_labels02.rb +3 -3
  135. data/test/regression/test_chart_data_labels03.rb +3 -3
  136. data/test/regression/test_chart_data_labels04.rb +3 -3
  137. data/test/regression/test_chart_data_labels05.rb +3 -3
  138. data/test/regression/test_chart_data_labels06.rb +3 -3
  139. data/test/regression/test_chart_data_labels07.rb +3 -3
  140. data/test/regression/test_chart_data_labels08.rb +3 -3
  141. data/test/regression/test_chart_data_labels09.rb +3 -3
  142. data/test/regression/test_chart_data_labels10.rb +3 -3
  143. data/test/regression/test_chart_data_labels11.rb +3 -3
  144. data/test/regression/test_chart_data_labels12.rb +3 -3
  145. data/test/regression/test_chart_data_labels13.rb +3 -3
  146. data/test/regression/test_chart_data_labels14.rb +3 -3
  147. data/test/regression/test_chart_data_labels15.rb +3 -3
  148. data/test/regression/test_chart_data_labels16.rb +3 -3
  149. data/test/regression/test_chart_data_labels17.rb +3 -3
  150. data/test/regression/test_chart_data_labels18.rb +3 -3
  151. data/test/regression/test_chart_data_labels19.rb +3 -3
  152. data/test/regression/test_chart_data_labels20.rb +3 -3
  153. data/test/regression/test_chart_data_labels21.rb +3 -3
  154. data/test/regression/test_chart_data_labels22.rb +3 -3
  155. data/test/regression/test_chart_data_labels23.rb +3 -3
  156. data/test/regression/test_chart_data_labels24.rb +3 -3
  157. data/test/regression/test_chart_date01.rb +2 -6
  158. data/test/regression/test_chart_date02.rb +3 -3
  159. data/test/regression/test_chart_date03.rb +3 -3
  160. data/test/regression/test_chart_date04.rb +3 -3
  161. data/test/regression/test_chart_date05.rb +3 -3
  162. data/test/regression/test_chart_display_units01.rb +3 -3
  163. data/test/regression/test_chart_display_units02.rb +3 -3
  164. data/test/regression/test_chart_display_units03.rb +3 -3
  165. data/test/regression/test_chart_display_units04.rb +3 -3
  166. data/test/regression/test_chart_display_units05.rb +3 -3
  167. data/test/regression/test_chart_display_units06.rb +3 -3
  168. data/test/regression/test_chart_display_units07.rb +3 -3
  169. data/test/regression/test_chart_display_units08.rb +3 -3
  170. data/test/regression/test_chart_display_units09.rb +3 -3
  171. data/test/regression/test_chart_display_units10.rb +3 -3
  172. data/test/regression/test_chart_display_units11.rb +3 -3
  173. data/test/regression/test_chart_display_units12.rb +3 -3
  174. data/test/regression/test_chart_doughnut01.rb +3 -7
  175. data/test/regression/test_chart_doughnut02.rb +3 -7
  176. data/test/regression/test_chart_doughnut03.rb +3 -7
  177. data/test/regression/test_chart_doughnut04.rb +3 -7
  178. data/test/regression/test_chart_doughnut05.rb +3 -7
  179. data/test/regression/test_chart_doughnut06.rb +3 -7
  180. data/test/regression/test_chart_drop_lines01.rb +3 -3
  181. data/test/regression/test_chart_drop_lines02.rb +3 -3
  182. data/test/regression/test_chart_drop_lines03.rb +3 -3
  183. data/test/regression/test_chart_drop_lines04.rb +3 -3
  184. data/test/regression/test_chart_errorbars01.rb +3 -4
  185. data/test/regression/test_chart_errorbars02.rb +3 -4
  186. data/test/regression/test_chart_errorbars03.rb +3 -4
  187. data/test/regression/test_chart_errorbars04.rb +3 -4
  188. data/test/regression/test_chart_errorbars05.rb +3 -4
  189. data/test/regression/test_chart_errorbars06.rb +3 -4
  190. data/test/regression/test_chart_errorbars07.rb +6 -7
  191. data/test/regression/test_chart_errorbars08.rb +3 -7
  192. data/test/regression/test_chart_errorbars09.rb +3 -7
  193. data/test/regression/test_chart_errorbars10.rb +3 -7
  194. data/test/regression/test_chart_font01.rb +3 -3
  195. data/test/regression/test_chart_font02.rb +3 -3
  196. data/test/regression/test_chart_font03.rb +3 -3
  197. data/test/regression/test_chart_font04.rb +3 -3
  198. data/test/regression/test_chart_font05.rb +3 -3
  199. data/test/regression/test_chart_font06.rb +3 -3
  200. data/test/regression/test_chart_font07.rb +3 -3
  201. data/test/regression/test_chart_font08.rb +3 -3
  202. data/test/regression/test_chart_font09.rb +2 -6
  203. data/test/regression/test_chart_format01.rb +3 -3
  204. data/test/regression/test_chart_format02.rb +3 -3
  205. data/test/regression/test_chart_format03.rb +3 -3
  206. data/test/regression/test_chart_format04.rb +3 -3
  207. data/test/regression/test_chart_format05.rb +3 -3
  208. data/test/regression/test_chart_format06.rb +8 -10
  209. data/test/regression/test_chart_format07.rb +8 -10
  210. data/test/regression/test_chart_format08.rb +8 -10
  211. data/test/regression/test_chart_format09.rb +8 -10
  212. data/test/regression/test_chart_format10.rb +8 -10
  213. data/test/regression/test_chart_format11.rb +8 -10
  214. data/test/regression/test_chart_format12.rb +8 -10
  215. data/test/regression/test_chart_format13.rb +8 -10
  216. data/test/regression/test_chart_format14.rb +8 -10
  217. data/test/regression/test_chart_format15.rb +8 -10
  218. data/test/regression/test_chart_format16.rb +8 -10
  219. data/test/regression/test_chart_format17.rb +3 -4
  220. data/test/regression/test_chart_format18.rb +3 -4
  221. data/test/regression/test_chart_format19.rb +3 -4
  222. data/test/regression/test_chart_format20.rb +3 -4
  223. data/test/regression/test_chart_gap01.rb +3 -3
  224. data/test/regression/test_chart_gap02.rb +3 -3
  225. data/test/regression/test_chart_gap03.rb +3 -3
  226. data/test/regression/test_chart_gap04.rb +3 -3
  227. data/test/regression/test_chart_gap05.rb +3 -3
  228. data/test/regression/test_chart_gradient01.rb +3 -6
  229. data/test/regression/test_chart_gradient02.rb +3 -6
  230. data/test/regression/test_chart_gradient03.rb +3 -6
  231. data/test/regression/test_chart_gradient04.rb +3 -6
  232. data/test/regression/test_chart_gradient05.rb +3 -6
  233. data/test/regression/test_chart_gradient06.rb +3 -6
  234. data/test/regression/test_chart_gradient07.rb +3 -6
  235. data/test/regression/test_chart_gradient08.rb +3 -6
  236. data/test/regression/test_chart_gradient09.rb +3 -6
  237. data/test/regression/test_chart_gradient10.rb +3 -6
  238. data/test/regression/test_chart_gradient11.rb +3 -6
  239. data/test/regression/test_chart_gradient12.rb +3 -6
  240. data/test/regression/test_chart_gradient13.rb +3 -6
  241. data/test/regression/test_chart_gridlines01.rb +3 -6
  242. data/test/regression/test_chart_gridlines02.rb +3 -6
  243. data/test/regression/test_chart_gridlines03.rb +6 -8
  244. data/test/regression/test_chart_gridlines04.rb +3 -6
  245. data/test/regression/test_chart_gridlines05.rb +3 -6
  246. data/test/regression/test_chart_gridlines06.rb +3 -6
  247. data/test/regression/test_chart_gridlines07.rb +6 -8
  248. data/test/regression/test_chart_gridlines08.rb +3 -6
  249. data/test/regression/test_chart_gridlines09.rb +3 -6
  250. data/test/regression/test_chart_layout01.rb +3 -3
  251. data/test/regression/test_chart_layout02.rb +3 -3
  252. data/test/regression/test_chart_layout03.rb +3 -3
  253. data/test/regression/test_chart_layout04.rb +3 -3
  254. data/test/regression/test_chart_layout05.rb +3 -3
  255. data/test/regression/test_chart_layout06.rb +3 -3
  256. data/test/regression/test_chart_layout07.rb +3 -3
  257. data/test/regression/test_chart_layout08.rb +3 -3
  258. data/test/regression/test_chart_legend01.rb +3 -8
  259. data/test/regression/test_chart_legend02.rb +3 -8
  260. data/test/regression/test_chart_line01.rb +3 -3
  261. data/test/regression/test_chart_line02.rb +9 -10
  262. data/test/regression/test_chart_line03.rb +3 -3
  263. data/test/regression/test_chart_line04.rb +3 -3
  264. data/test/regression/test_chart_name01.rb +3 -6
  265. data/test/regression/test_chart_name02.rb +3 -6
  266. data/test/regression/test_chart_name03.rb +3 -6
  267. data/test/regression/test_chart_order01.rb +3 -6
  268. data/test/regression/test_chart_order02.rb +3 -6
  269. data/test/regression/test_chart_order03.rb +10 -12
  270. data/test/regression/test_chart_pie01.rb +3 -3
  271. data/test/regression/test_chart_pie02.rb +3 -3
  272. data/test/regression/test_chart_pie03.rb +3 -3
  273. data/test/regression/test_chart_pie04.rb +3 -3
  274. data/test/regression/test_chart_pie05.rb +3 -3
  275. data/test/regression/test_chart_points01.rb +3 -3
  276. data/test/regression/test_chart_points02.rb +3 -3
  277. data/test/regression/test_chart_points03.rb +3 -3
  278. data/test/regression/test_chart_points04.rb +3 -3
  279. data/test/regression/test_chart_points05.rb +3 -3
  280. data/test/regression/test_chart_points06.rb +3 -3
  281. data/test/regression/test_chart_radar01.rb +3 -3
  282. data/test/regression/test_chart_radar02.rb +3 -3
  283. data/test/regression/test_chart_radar03.rb +3 -3
  284. data/test/regression/test_chart_scatter01.rb +3 -3
  285. data/test/regression/test_chart_scatter02.rb +3 -3
  286. data/test/regression/test_chart_scatter03.rb +3 -3
  287. data/test/regression/test_chart_scatter04.rb +3 -3
  288. data/test/regression/test_chart_scatter05.rb +3 -3
  289. data/test/regression/test_chart_scatter06.rb +3 -3
  290. data/test/regression/test_chart_scatter07.rb +9 -10
  291. data/test/regression/test_chart_scatter08.rb +3 -3
  292. data/test/regression/test_chart_scatter09.rb +3 -3
  293. data/test/regression/test_chart_scatter10.rb +3 -3
  294. data/test/regression/test_chart_scatter11.rb +3 -3
  295. data/test/regression/test_chart_scatter12.rb +3 -3
  296. data/test/regression/test_chart_scatter13.rb +3 -3
  297. data/test/regression/test_chart_scatter14.rb +3 -3
  298. data/test/regression/test_chart_scatter15.rb +3 -3
  299. data/test/regression/test_chart_size01.rb +3 -3
  300. data/test/regression/test_chart_size02.rb +3 -3
  301. data/test/regression/test_chart_size03.rb +3 -3
  302. data/test/regression/test_chart_size04.rb +3 -3
  303. data/test/regression/test_chart_size05.rb +3 -3
  304. data/test/regression/test_chart_sparse01.rb +6 -9
  305. data/test/regression/test_chart_stock01.rb +6 -8
  306. data/test/regression/test_chart_stock02.rb +10 -12
  307. data/test/regression/test_chart_str01.rb +3 -8
  308. data/test/regression/test_chart_str02.rb +3 -8
  309. data/test/regression/test_chart_table01.rb +3 -6
  310. data/test/regression/test_chart_table02.rb +3 -6
  311. data/test/regression/test_chart_title01.rb +3 -8
  312. data/test/regression/test_chart_title02.rb +3 -8
  313. data/test/regression/test_chartsheet01.rb +3 -8
  314. data/test/regression/test_chartsheet02.rb +8 -10
  315. data/test/regression/test_chartsheet03.rb +8 -10
  316. data/test/regression/test_chartsheet04.rb +8 -10
  317. data/test/regression/test_chartsheet05.rb +8 -10
  318. data/test/regression/test_chartsheet06.rb +7 -13
  319. data/test/regression/test_chartsheet07.rb +16 -18
  320. data/test/regression/test_chartsheet08.rb +16 -18
  321. data/test/regression/test_chartsheet09.rb +8 -10
  322. data/test/regression/test_comment01.rb +3 -3
  323. data/test/regression/test_comment02.rb +3 -3
  324. data/test/regression/test_comment03.rb +6 -7
  325. data/test/regression/test_comment04.rb +6 -7
  326. data/test/regression/test_comment06.rb +6 -7
  327. data/test/regression/test_comment07.rb +6 -7
  328. data/test/regression/test_comment08.rb +6 -7
  329. data/test/regression/test_comment09.rb +6 -7
  330. data/test/regression/test_comment10.rb +6 -7
  331. data/test/regression/test_comment11.rb +6 -8
  332. data/test/regression/test_comment12.rb +3 -8
  333. data/test/regression/test_cond_format01.rb +6 -7
  334. data/test/regression/test_cond_format02.rb +6 -7
  335. data/test/regression/test_cond_format03.rb +6 -7
  336. data/test/regression/test_cond_format04.rb +6 -7
  337. data/test/regression/test_cond_format05.rb +6 -7
  338. data/test/regression/test_cond_format06.rb +6 -7
  339. data/test/regression/test_cond_format07.rb +6 -7
  340. data/test/regression/test_cond_format08.rb +6 -7
  341. data/test/regression/test_cond_format10.rb +6 -7
  342. data/test/regression/test_cond_format11.rb +6 -7
  343. data/test/regression/test_cond_format12.rb +6 -7
  344. data/test/regression/test_cond_format13.rb +6 -7
  345. data/test/regression/test_custom_colors01.rb +3 -3
  346. data/test/regression/test_data_validation01.rb +3 -3
  347. data/test/regression/test_data_validation02.rb +3 -3
  348. data/test/regression/test_data_validation03.rb +3 -3
  349. data/test/regression/test_data_validation04.rb +1 -5
  350. data/test/regression/test_data_validation05.rb +1 -5
  351. data/test/regression/test_date_1904_01.rb +3 -8
  352. data/test/regression/test_date_1904_02.rb +3 -8
  353. data/test/regression/test_date_examples01.rb +3 -3
  354. data/test/regression/test_default_format01.rb +2 -6
  355. data/test/regression/test_default_row01.rb +3 -3
  356. data/test/regression/test_default_row02.rb +3 -3
  357. data/test/regression/test_default_row03.rb +3 -3
  358. data/test/regression/test_default_row04.rb +3 -3
  359. data/test/regression/test_defined_name01.rb +10 -12
  360. data/test/regression/test_defined_name02.rb +10 -12
  361. data/test/regression/test_defined_name03.rb +10 -12
  362. data/test/regression/test_defined_name04.rb +2 -7
  363. data/test/regression/test_escapes01.rb +8 -10
  364. data/test/regression/test_escapes02.rb +8 -9
  365. data/test/regression/test_escapes03.rb +8 -9
  366. data/test/regression/test_escapes04.rb +8 -10
  367. data/test/regression/test_escapes05.rb +8 -10
  368. data/test/regression/test_escapes06.rb +3 -6
  369. data/test/regression/test_escapes07.rb +3 -6
  370. data/test/regression/test_escapes08.rb +3 -6
  371. data/test/regression/test_excel2003_style01.rb +3 -3
  372. data/test/regression/test_excel2003_style02.rb +3 -3
  373. data/test/regression/test_excel2003_style03.rb +3 -3
  374. data/test/regression/test_excel2003_style04.rb +3 -3
  375. data/test/regression/test_excel2003_style05.rb +3 -3
  376. data/test/regression/test_excel2003_style06.rb +3 -3
  377. data/test/regression/test_excel2003_style07.rb +3 -3
  378. data/test/regression/test_excel2003_style08.rb +3 -3
  379. data/test/regression/test_firstsheet01.rb +3 -8
  380. data/test/regression/test_fit_to_pages01.rb +12 -14
  381. data/test/regression/test_fit_to_pages02.rb +12 -14
  382. data/test/regression/test_fit_to_pages03.rb +12 -14
  383. data/test/regression/test_fit_to_pages04.rb +12 -14
  384. data/test/regression/test_fit_to_pages05.rb +12 -14
  385. data/test/regression/test_format01.rb +3 -3
  386. data/test/regression/test_format02.rb +3 -3
  387. data/test/regression/test_format03.rb +3 -3
  388. data/test/regression/test_format04.rb +3 -3
  389. data/test/regression/test_format05.rb +3 -3
  390. data/test/regression/test_format11.rb +3 -3
  391. data/test/regression/test_format12.rb +3 -3
  392. data/test/regression/test_formula_results01.rb +3 -3
  393. data/test/regression/test_gridlines01.rb +12 -14
  394. data/test/regression/test_header01.rb +3 -3
  395. data/test/regression/test_header02.rb +3 -3
  396. data/test/regression/test_header03.rb +3 -3
  397. data/test/regression/test_header_image01.rb +3 -3
  398. data/test/regression/test_header_image02.rb +3 -3
  399. data/test/regression/test_header_image03.rb +3 -3
  400. data/test/regression/test_header_image04.rb +3 -3
  401. data/test/regression/test_header_image05.rb +3 -3
  402. data/test/regression/test_header_image06.rb +3 -3
  403. data/test/regression/test_header_image07.rb +3 -3
  404. data/test/regression/test_header_image08.rb +3 -3
  405. data/test/regression/test_header_image09.rb +8 -12
  406. data/test/regression/test_header_image10.rb +3 -3
  407. data/test/regression/test_header_image11.rb +3 -3
  408. data/test/regression/test_header_image12.rb +3 -3
  409. data/test/regression/test_header_image13.rb +3 -3
  410. data/test/regression/test_header_image14.rb +3 -3
  411. data/test/regression/test_hide01.rb +3 -8
  412. data/test/regression/test_hyperlink01.rb +3 -3
  413. data/test/regression/test_hyperlink02.rb +3 -3
  414. data/test/regression/test_hyperlink03.rb +3 -3
  415. data/test/regression/test_hyperlink04.rb +3 -3
  416. data/test/regression/test_hyperlink05.rb +3 -3
  417. data/test/regression/test_hyperlink06.rb +3 -3
  418. data/test/regression/test_hyperlink07.rb +2 -6
  419. data/test/regression/test_hyperlink08.rb +3 -3
  420. data/test/regression/test_hyperlink09.rb +3 -3
  421. data/test/regression/test_hyperlink10.rb +3 -3
  422. data/test/regression/test_hyperlink11.rb +3 -3
  423. data/test/regression/test_hyperlink12.rb +3 -3
  424. data/test/regression/test_hyperlink13.rb +3 -3
  425. data/test/regression/test_hyperlink14.rb +3 -3
  426. data/test/regression/test_hyperlink15.rb +3 -3
  427. data/test/regression/test_hyperlink16.rb +3 -3
  428. data/test/regression/test_hyperlink17.rb +3 -3
  429. data/test/regression/test_hyperlink18.rb +3 -3
  430. data/test/regression/test_hyperlink20.rb +3 -3
  431. data/test/regression/test_hyperlink21.rb +3 -3
  432. data/test/regression/test_image01.rb +3 -3
  433. data/test/regression/test_image02.rb +3 -3
  434. data/test/regression/test_image03.rb +3 -3
  435. data/test/regression/test_image04.rb +3 -3
  436. data/test/regression/test_image05.rb +3 -3
  437. data/test/regression/test_image06.rb +3 -3
  438. data/test/regression/test_image07.rb +3 -3
  439. data/test/regression/test_image08.rb +3 -3
  440. data/test/regression/test_image09.rb +3 -3
  441. data/test/regression/test_image10.rb +3 -3
  442. data/test/regression/test_image11.rb +3 -3
  443. data/test/regression/test_image12.rb +3 -3
  444. data/test/regression/test_image13.rb +3 -3
  445. data/test/regression/test_image14.rb +3 -3
  446. data/test/regression/test_image15.rb +3 -3
  447. data/test/regression/test_image16.rb +3 -3
  448. data/test/regression/test_image17.rb +2 -6
  449. data/test/regression/test_image18.rb +3 -3
  450. data/test/regression/test_image19.rb +3 -3
  451. data/test/regression/test_image22.rb +3 -3
  452. data/test/regression/test_image23.rb +3 -3
  453. data/test/regression/test_image24.rb +3 -3
  454. data/test/regression/test_image25.rb +3 -3
  455. data/test/regression/test_image26.rb +3 -3
  456. data/test/regression/test_image27.rb +3 -3
  457. data/test/regression/test_landscape01.rb +3 -3
  458. data/test/regression/test_macro01.rb +3 -3
  459. data/test/regression/test_merge_cells01.rb +2 -6
  460. data/test/regression/test_merge_range01.rb +3 -6
  461. data/test/regression/test_merge_range02.rb +3 -6
  462. data/test/regression/test_merge_range03.rb +3 -6
  463. data/test/regression/test_merge_range04.rb +3 -6
  464. data/test/regression/test_merge_range05.rb +3 -6
  465. data/test/regression/test_outline01.rb +12 -14
  466. data/test/regression/test_outline02.rb +12 -14
  467. data/test/regression/test_outline03.rb +12 -14
  468. data/test/regression/test_outline04.rb +12 -14
  469. data/test/regression/test_outline05.rb +12 -14
  470. data/test/regression/test_outline06.rb +12 -14
  471. data/test/regression/test_page_breaks01.rb +12 -14
  472. data/test/regression/test_page_breaks02.rb +12 -14
  473. data/test/regression/test_page_breaks03.rb +12 -14
  474. data/test/regression/test_page_breaks04.rb +12 -14
  475. data/test/regression/test_page_breaks05.rb +12 -14
  476. data/test/regression/test_page_breaks06.rb +12 -14
  477. data/test/regression/test_page_view01.rb +12 -14
  478. data/test/regression/test_panes01.rb +3 -8
  479. data/test/regression/test_print_across01.rb +12 -14
  480. data/test/regression/test_print_area01.rb +12 -14
  481. data/test/regression/test_print_area02.rb +12 -14
  482. data/test/regression/test_print_area03.rb +12 -14
  483. data/test/regression/test_print_area04.rb +12 -14
  484. data/test/regression/test_print_area05.rb +12 -14
  485. data/test/regression/test_print_area06.rb +12 -14
  486. data/test/regression/test_print_area07.rb +12 -14
  487. data/test/regression/test_print_options01.rb +12 -14
  488. data/test/regression/test_print_options02.rb +12 -14
  489. data/test/regression/test_print_options03.rb +12 -14
  490. data/test/regression/test_print_options04.rb +12 -14
  491. data/test/regression/test_print_options05.rb +12 -14
  492. data/test/regression/test_print_options06.rb +12 -14
  493. data/test/regression/test_print_options07.rb +3 -5
  494. data/test/regression/test_print_scale01.rb +12 -14
  495. data/test/regression/test_print_scale02.rb +12 -14
  496. data/test/regression/test_properties01.rb +6 -7
  497. data/test/regression/test_protect01.rb +3 -3
  498. data/test/regression/test_protect02.rb +3 -3
  499. data/test/regression/test_protect03.rb +3 -3
  500. data/test/regression/test_quote_name01.rb +3 -3
  501. data/test/regression/test_quote_name03.rb +3 -3
  502. data/test/regression/test_quote_name04.rb +3 -3
  503. data/test/regression/test_repeat01.rb +12 -14
  504. data/test/regression/test_repeat02.rb +12 -14
  505. data/test/regression/test_repeat03.rb +12 -14
  506. data/test/regression/test_repeat04.rb +12 -14
  507. data/test/regression/test_repeat05.rb +15 -17
  508. data/test/regression/test_rich_string01.rb +3 -3
  509. data/test/regression/test_rich_string02.rb +3 -3
  510. data/test/regression/test_rich_string03.rb +3 -3
  511. data/test/regression/test_rich_string04.rb +3 -3
  512. data/test/regression/test_rich_string05.rb +3 -3
  513. data/test/regression/test_rich_string06.rb +3 -3
  514. data/test/regression/test_rich_string07.rb +3 -3
  515. data/test/regression/test_rich_string08.rb +3 -3
  516. data/test/regression/test_rich_string09.rb +3 -3
  517. data/test/regression/test_rich_string10.rb +3 -3
  518. data/test/regression/test_rich_string11.rb +3 -3
  519. data/test/regression/test_rich_string12.rb +3 -3
  520. data/test/regression/test_row_col_format01.rb +3 -3
  521. data/test/regression/test_row_col_format02.rb +3 -3
  522. data/test/regression/test_row_col_format03.rb +3 -3
  523. data/test/regression/test_row_col_format04.rb +3 -3
  524. data/test/regression/test_row_col_format05.rb +3 -3
  525. data/test/regression/test_row_col_format06.rb +3 -3
  526. data/test/regression/test_row_col_format07.rb +3 -3
  527. data/test/regression/test_row_col_format08.rb +3 -3
  528. data/test/regression/test_row_col_format09.rb +3 -3
  529. data/test/regression/test_row_col_format10.rb +3 -3
  530. data/test/regression/test_row_col_format11.rb +3 -3
  531. data/test/regression/test_row_col_format12.rb +3 -3
  532. data/test/regression/test_row_col_format13.rb +3 -3
  533. data/test/regression/test_row_col_format14.rb +3 -3
  534. data/test/regression/test_selection01.rb +3 -3
  535. data/test/regression/test_selection02.rb +3 -3
  536. data/test/regression/test_set_column01.rb +3 -3
  537. data/test/regression/test_set_column02.rb +3 -3
  538. data/test/regression/test_set_column03.rb +2 -6
  539. data/test/regression/test_set_column04.rb +3 -3
  540. data/test/regression/test_set_column05.rb +3 -3
  541. data/test/regression/test_set_column06.rb +3 -3
  542. data/test/regression/test_set_column07.rb +3 -3
  543. data/test/regression/test_set_column08.rb +3 -3
  544. data/test/regression/test_set_column09.rb +3 -3
  545. data/test/regression/test_set_print_scale01.rb +3 -3
  546. data/test/regression/test_set_start_page01.rb +3 -3
  547. data/test/regression/test_set_start_page02.rb +3 -3
  548. data/test/regression/test_set_start_page03.rb +3 -3
  549. data/test/regression/test_shape01.rb +3 -3
  550. data/test/regression/test_shape02.rb +3 -3
  551. data/test/regression/test_shape03.rb +3 -3
  552. data/test/regression/test_shape04.rb +3 -3
  553. data/test/regression/test_shape_connect01.rb +3 -3
  554. data/test/regression/test_shape_connect02.rb +3 -3
  555. data/test/regression/test_shape_connect03.rb +3 -3
  556. data/test/regression/test_shape_connect04.rb +3 -3
  557. data/test/regression/test_shape_scale01.rb +12 -14
  558. data/test/regression/test_shape_stencil01.rb +3 -8
  559. data/test/regression/test_shared_strings01.rb +6 -8
  560. data/test/regression/test_shared_strings02.rb +6 -8
  561. data/test/regression/test_shared_strings_encoding.rb +0 -103
  562. data/test/regression/test_simple01.rb +3 -3
  563. data/test/regression/test_simple02.rb +3 -3
  564. data/test/regression/test_simple03.rb +3 -3
  565. data/test/regression/test_simple04.rb +3 -3
  566. data/test/regression/test_simple05.rb +3 -3
  567. data/test/regression/test_tab_color01.rb +2 -11
  568. data/test/regression/test_table01.rb +3 -3
  569. data/test/regression/test_table02.rb +3 -3
  570. data/test/regression/test_table03.rb +3 -3
  571. data/test/regression/test_table04.rb +3 -3
  572. data/test/regression/test_table05.rb +3 -3
  573. data/test/regression/test_table06.rb +3 -3
  574. data/test/regression/test_table07.rb +3 -3
  575. data/test/regression/test_table08.rb +3 -3
  576. data/test/regression/test_table09.rb +3 -3
  577. data/test/regression/test_table10.rb +3 -3
  578. data/test/regression/test_table11.rb +3 -3
  579. data/test/regression/test_table12.rb +3 -3
  580. data/test/regression/test_table13.rb +3 -3
  581. data/test/regression/test_table14.rb +3 -3
  582. data/test/regression/test_table15.rb +3 -3
  583. data/test/regression/test_table16.rb +3 -3
  584. data/test/regression/test_table17.rb +3 -3
  585. data/test/regression/test_tutorial01.rb +3 -3
  586. data/test/regression/test_tutorial02.rb +3 -3
  587. data/test/regression/test_tutorial03.rb +3 -3
  588. data/test/regression/test_urls_as_strings.rb +3 -3
  589. data/test/regression/test_utf8_01.rb +3 -3
  590. data/test/regression/test_utf8_03.rb +3 -3
  591. data/test/regression/test_utf8_04.rb +3 -3
  592. data/test/regression/test_utf8_05.rb +3 -3
  593. data/test/regression/test_utf8_06.rb +3 -3
  594. data/test/regression/test_utf8_07.rb +3 -3
  595. data/test/regression/test_utf8_08.rb +3 -3
  596. data/test/regression/test_utf8_09.rb +2 -6
  597. data/test/regression/test_utf8_10.rb +3 -3
  598. data/test/regression/test_vml01.rb +3 -3
  599. data/test/regression/test_vml02.rb +3 -3
  600. data/test/regression/test_vml03.rb +3 -3
  601. data/test/test_example_match.rb +199 -133
  602. metadata +3 -3
@@ -7,12 +7,12 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_tutorial02
14
14
  @xlsx = 'tutorial02.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  bold = workbook.add_format(:bold => 1)
@@ -36,7 +36,7 @@ def test_tutorial02
36
36
  worksheet.write(expenses.size + 1, 1, '=SUM(B2:B5)', money, 1450)
37
37
 
38
38
  workbook.close
39
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx,
39
+ compare_for_regression(
40
40
  ['xl/calcChain.xml', '[Content_Types].xml', 'xl/_rels/workbook.xml.rels'],
41
41
  {}
42
42
  )
@@ -7,12 +7,12 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_tutorial03
14
14
  @xlsx = 'tutorial03.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  bold = workbook.add_format(:bold => 1)
@@ -41,7 +41,7 @@ def test_tutorial03
41
41
  worksheet.write(expenses.size + 1, 2, '=SUM(C2:C5)', money_format, 1450)
42
42
 
43
43
  workbook.close
44
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx,
44
+ compare_for_regression(
45
45
  ['xl/calcChain.xml', '[Content_Types].xml', 'xl/_rels/workbook.xml.rels'],
46
46
  {}
47
47
  )
@@ -7,12 +7,12 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_urls_as_strings
14
14
  @xlsx = 'urls_as_strings.xlsx'
15
- workbook = WriteXLSX.new(@xlsx, strings_to_urls: false)
15
+ workbook = WriteXLSX.new(@io, strings_to_urls: false)
16
16
  worksheet = workbook.add_worksheet
17
17
  worksheet.write('A1', 'http://www.write_xlsx.com')
18
18
  worksheet.write('A2', 'mailto:write_xlsx@example.com')
@@ -20,6 +20,6 @@ def test_urls_as_strings
20
20
  worksheet.write('A4', 'internal:Sheet1!A1' )
21
21
  worksheet.write('A5', 'external:c:\foo.xlsx')
22
22
  workbook.close
23
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
23
+ compare_for_regression
24
24
  end
25
25
  end
@@ -7,17 +7,17 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_utf8_01
14
14
  @xlsx = 'utf8_01.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  worksheet.write('A1', 'Это фраза на русском!')
19
19
 
20
20
  workbook.close
21
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
21
+ compare_for_regression
22
22
  end
23
23
  end
@@ -7,17 +7,17 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_utf8_03
14
14
  @xlsx = 'utf8_03.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet('Café')
17
17
 
18
18
  worksheet.write('A1', 'Café')
19
19
 
20
20
  workbook.close
21
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
21
+ compare_for_regression
22
22
  end
23
23
  end
@@ -7,17 +7,17 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_utf8_04
14
14
  @xlsx = 'utf8_04.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet('Café & Café')
17
17
 
18
18
  worksheet.write('A1', 'Café & Café')
19
19
 
20
20
  workbook.close
21
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
21
+ compare_for_regression
22
22
  end
23
23
  end
@@ -7,18 +7,18 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_utf8_05
14
14
  @xlsx = 'utf8_05.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  worksheet.write('A1', '="Café"', nil, 'Café')
19
19
 
20
20
  workbook.close
21
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx,
21
+ compare_for_regression(
22
22
  [ 'xl/calcChain.xml', '[Content_Types].xml', 'xl/_rels/workbook.xml.rels' ],
23
23
  {'xl/workbook.xml' => ['<workbookView']}
24
24
  )
@@ -7,12 +7,12 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_utf8_06
14
14
  @xlsx = 'utf8_06.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  bold = workbook.add_format(:bold => 1)
@@ -23,6 +23,6 @@ def test_utf8_06
23
23
  worksheet.write_rich_string('A3', 'Caf', bold, 'é')
24
24
 
25
25
  workbook.close
26
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
26
+ compare_for_regression
27
27
  end
28
28
  end
@@ -7,12 +7,12 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_utf8_07
14
14
  @xlsx = 'utf8_07.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  worksheet.write('A1', 'Foo')
@@ -22,6 +22,6 @@ def test_utf8_07
22
22
  worksheet.comments_author = 'John'
23
23
 
24
24
  workbook.close
25
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
25
+ compare_for_regression
26
26
  end
27
27
  end
@@ -7,12 +7,12 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_utf8_08
14
14
  @xlsx = 'utf8_08.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  worksheet.write('A1', 'Foo')
@@ -23,7 +23,7 @@ def test_utf8_08
23
23
  worksheet.paper = 9
24
24
 
25
25
  workbook.close
26
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx,
26
+ compare_for_regression(
27
27
  [
28
28
  'xl/printerSettings/printerSettings1.bin',
29
29
  'xl/worksheets/_rels/sheet1.xml.rels'
@@ -6,19 +6,15 @@ def setup
6
6
  setup_dir_var
7
7
  end
8
8
 
9
- def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
11
- end
12
-
13
9
  def test_utf8_09
14
10
  @xlsx = 'utf8_09.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
11
+ workbook = WriteXLSX.new(@io)
16
12
  worksheet = workbook.add_worksheet
17
13
  num_format = workbook.add_format(:num_format => '[$¥-411]#,##0.00')
18
14
 
19
15
  worksheet.write('A1', 1, num_format)
20
16
 
21
17
  workbook.close
22
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
18
+ compare_for_regression
23
19
  end
24
20
  end
@@ -7,12 +7,12 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_utf8_10
14
14
  @xlsx = 'utf8_10.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet
17
17
  chart = workbook.add_chart(:type => 'bar', :embedded => 1)
18
18
 
@@ -37,6 +37,6 @@ def test_utf8_10
37
37
  worksheet.insert_chart('E9', chart)
38
38
 
39
39
  workbook.close
40
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
40
+ compare_for_regression
41
41
  end
42
42
  end
@@ -7,12 +7,12 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_vml01
14
14
  @xlsx = 'vml01.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  worksheet.write('A1', 'Foo')
@@ -24,6 +24,6 @@ def test_vml01
24
24
  worksheet.insert_button('C4', {})
25
25
 
26
26
  workbook.close
27
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
27
+ compare_for_regression
28
28
  end
29
29
  end
@@ -7,12 +7,12 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_vml02
14
14
  @xlsx = 'vml02.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet = workbook.add_worksheet
17
17
 
18
18
  worksheet.write('A1', 'Foo')
@@ -26,6 +26,6 @@ def test_vml02
26
26
  worksheet.insert_button('E8', {})
27
27
 
28
28
  workbook.close
29
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
29
+ compare_for_regression
30
30
  end
31
31
  end
@@ -7,12 +7,12 @@ def setup
7
7
  end
8
8
 
9
9
  def teardown
10
- File.delete(@xlsx) if File.exist?(@xlsx)
10
+ @tempfile.close(true)
11
11
  end
12
12
 
13
13
  def test_vml03
14
14
  @xlsx = 'vml03.xlsx'
15
- workbook = WriteXLSX.new(@xlsx)
15
+ workbook = WriteXLSX.new(@io)
16
16
  worksheet1 = workbook.add_worksheet
17
17
  worksheet2 = workbook.add_worksheet
18
18
  worksheet3 = workbook.add_worksheet
@@ -35,6 +35,6 @@ def test_vml03
35
35
  worksheet3.insert_button('E8', {})
36
36
 
37
37
  workbook.close
38
- compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
38
+ compare_for_regression
39
39
  end
40
40
  end
@@ -8,13 +8,13 @@ def setup
8
8
  end
9
9
 
10
10
  def teardown
11
- File.delete(@xlsx) if File.exist?(@xlsx)
11
+ @tempfile.close
12
12
  end
13
13
 
14
14
  def test_a_simple
15
15
  @xlsx = 'a_simple.xlsx'
16
16
  # Create a new workbook called simple.xls and add a worksheet
17
- workbook = WriteXLSX.new(@xlsx)
17
+ workbook = WriteXLSX.new(@io)
18
18
  worksheet = workbook.add_worksheet
19
19
 
20
20
  # The general syntax is write(row, column, token). Note that row and
@@ -43,12 +43,13 @@ def test_a_simple
43
43
  worksheet.write(10, 0, 'http://www.ruby-lang.org/', hyperlink_format)
44
44
 
45
45
  workbook.close
46
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
46
+ store_to_tempfile
47
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
47
48
  end
48
49
 
49
50
  def test_array_formula
50
51
  @xlsx = 'array_formula.xlsx'
51
- workbook = WriteXLSX.new(@xlsx)
52
+ workbook = WriteXLSX.new(@io)
52
53
  worksheet = workbook.add_worksheet
53
54
 
54
55
  # Write some test data.
@@ -65,12 +66,13 @@ def test_array_formula
65
66
  worksheet.write_array_formula('A5:A7', '{=TREND(C5:C7,B5:B7)}')
66
67
 
67
68
  workbook.close
68
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
69
+ store_to_tempfile
70
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
69
71
  end
70
72
 
71
73
  def test_autofilter
72
74
  @xlsx = 'autofilter.xlsx'
73
- workbook = WriteXLSX.new(@xlsx)
75
+ workbook = WriteXLSX.new(@io)
74
76
 
75
77
  worksheet1 = workbook.add_worksheet
76
78
  worksheet2 = workbook.add_worksheet
@@ -236,12 +238,13 @@ def test_autofilter
236
238
  end
237
239
 
238
240
  workbook.close
239
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
241
+ store_to_tempfile
242
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
240
243
  end
241
244
 
242
245
  def test_chart_scatter06
243
246
  @xlsx = 'chart_scatter06.xlsx'
244
- workbook = WriteXLSX.new(@xlsx)
247
+ workbook = WriteXLSX.new(@io)
245
248
  worksheet = workbook.add_worksheet
246
249
  chart = workbook.add_chart(:type => 'scatter', :embedded => 1)
247
250
 
@@ -273,7 +276,8 @@ def test_chart_scatter06
273
276
  worksheet.insert_chart('E9', chart)
274
277
 
275
278
  workbook.close
276
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
279
+ store_to_tempfile
280
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
277
281
  end
278
282
 
279
283
  def autofilter_data
@@ -334,7 +338,7 @@ def autofilter_data
334
338
 
335
339
  def test_chart_area
336
340
  @xlsx = 'chart_area.xlsx'
337
- workbook = WriteXLSX.new(@xlsx)
341
+ workbook = WriteXLSX.new(@io)
338
342
  worksheet = workbook.add_worksheet
339
343
  bold = workbook.add_format(:bold => 1)
340
344
 
@@ -379,12 +383,13 @@ def test_chart_area
379
383
  worksheet.insert_chart('D2', chart, 25, 10)
380
384
 
381
385
  workbook.close
382
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
386
+ store_to_tempfile
387
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
383
388
  end
384
389
 
385
390
  def test_chart_bar
386
391
  @xlsx = 'chart_bar.xlsx'
387
- workbook = WriteXLSX.new(@xlsx)
392
+ workbook = WriteXLSX.new(@io)
388
393
  worksheet = workbook.add_worksheet
389
394
  bold = workbook.add_format(:bold => 1)
390
395
 
@@ -429,12 +434,13 @@ def test_chart_bar
429
434
  worksheet.insert_chart('D2', chart, 25, 10)
430
435
 
431
436
  workbook.close
432
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
437
+ store_to_tempfile
438
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
433
439
  end
434
440
 
435
441
  def test_chart_column
436
442
  @xlsx = 'chart_column.xlsx'
437
- workbook = WriteXLSX.new(@xlsx)
443
+ workbook = WriteXLSX.new(@io)
438
444
  worksheet = workbook.add_worksheet
439
445
  bold = workbook.add_format(:bold => 1)
440
446
 
@@ -479,12 +485,13 @@ def test_chart_column
479
485
  worksheet.insert_chart('D2', chart, 25, 10)
480
486
 
481
487
  workbook.close
482
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
488
+ store_to_tempfile
489
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
483
490
  end
484
491
 
485
492
  def test_chart_doughnut
486
493
  @xlsx = 'chart_doughnut.xlsx'
487
- workbook = WriteXLSX.new(@xlsx)
494
+ workbook = WriteXLSX.new(@io)
488
495
  worksheet = workbook.add_worksheet
489
496
  bold = workbook.add_format(:bold => 1)
490
497
 
@@ -595,12 +602,13 @@ def test_chart_doughnut
595
602
  worksheet.insert_chart('C50', chart4, 25, 10)
596
603
 
597
604
  workbook.close
598
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
605
+ store_to_tempfile
606
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
599
607
  end
600
608
 
601
609
  def test_chart_line
602
610
  @xlsx = 'chart_line.xlsx'
603
- workbook = WriteXLSX.new(@xlsx)
611
+ workbook = WriteXLSX.new(@io)
604
612
  worksheet = workbook.add_worksheet
605
613
  bold = workbook.add_format(:bold => 1)
606
614
 
@@ -645,12 +653,13 @@ def test_chart_line
645
653
  worksheet.insert_chart('D2', chart, 25, 10)
646
654
 
647
655
  workbook.close
648
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
656
+ store_to_tempfile
657
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
649
658
  end
650
659
 
651
660
  def test_chart_pie
652
661
  @xlsx = 'chart_pie.xlsx'
653
- workbook = WriteXLSX.new(@xlsx)
662
+ workbook = WriteXLSX.new(@io)
654
663
  worksheet = workbook.add_worksheet
655
664
  bold = workbook.add_format(:bold => 1)
656
665
 
@@ -711,12 +720,13 @@ def test_chart_pie
711
720
 
712
721
 
713
722
  workbook.close
714
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
723
+ store_to_tempfile
724
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
715
725
  end
716
726
 
717
727
  def test_chart_radar
718
728
  @xlsx = 'chart_radar.xlsx'
719
- workbook = WriteXLSX.new(@xlsx)
729
+ workbook = WriteXLSX.new(@io)
720
730
  worksheet = workbook.add_worksheet
721
731
  bold = workbook.add_format(:bold => 1)
722
732
 
@@ -829,12 +839,13 @@ def test_chart_radar
829
839
  worksheet.insert_chart('D34', chart3, 25, 11)
830
840
 
831
841
  workbook.close
832
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
842
+ store_to_tempfile
843
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
833
844
  end
834
845
 
835
846
  def test_chart_scatter
836
847
  @xlsx = 'chart_scatter.xlsx'
837
- workbook = WriteXLSX.new(@xlsx)
848
+ workbook = WriteXLSX.new(@io)
838
849
  worksheet = workbook.add_worksheet
839
850
  bold = workbook.add_format(:bold => 1)
840
851
 
@@ -879,12 +890,13 @@ def test_chart_scatter
879
890
  worksheet.insert_chart('D2', chart, 25, 10)
880
891
 
881
892
  workbook.close
882
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
893
+ store_to_tempfile
894
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
883
895
  end
884
896
 
885
897
  def test_chart_stock
886
898
  @xlsx = 'chart_stock.xlsx'
887
- workbook = WriteXLSX.new(@xlsx)
899
+ workbook = WriteXLSX.new(@io)
888
900
  worksheet = workbook.add_worksheet
889
901
  bold = workbook.add_format(:bold => 1)
890
902
  date_format = workbook.add_format(:num_format => 'dd/mm/yyyy')
@@ -935,12 +947,13 @@ def test_chart_stock
935
947
  worksheet.insert_chart('E9', chart)
936
948
 
937
949
  workbook.close
938
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
950
+ store_to_tempfile
951
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
939
952
  end
940
953
 
941
954
  def test_chart_secondary_axis
942
955
  @xlsx = 'chart_secondary_axis.xlsx'
943
- workbook = WriteXLSX.new(@xlsx)
956
+ workbook = WriteXLSX.new(@io)
944
957
  worksheet = workbook.add_worksheet
945
958
  bold = workbook.add_format(:bold => 1)
946
959
 
@@ -981,24 +994,26 @@ def test_chart_secondary_axis
981
994
  worksheet.insert_chart('D2', chart, 25, 10)
982
995
 
983
996
  workbook.close
984
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
997
+ store_to_tempfile
998
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
985
999
  end
986
1000
 
987
1001
  def test_comments1
988
1002
  @xlsx = 'comments1.xlsx'
989
- workbook = WriteXLSX.new(@xlsx)
1003
+ workbook = WriteXLSX.new(@io)
990
1004
  worksheet = workbook.add_worksheet
991
1005
 
992
1006
  worksheet.write('A1', 'Hello')
993
1007
  worksheet.write_comment('A1', 'This is a comment')
994
1008
 
995
1009
  workbook.close
996
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
1010
+ store_to_tempfile
1011
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
997
1012
  end
998
1013
 
999
1014
  def test_comments2
1000
1015
  @xlsx = 'comments2.xlsx'
1001
- workbook = WriteXLSX.new(@xlsx)
1016
+ workbook = WriteXLSX.new(@io)
1002
1017
 
1003
1018
  text_wrap = workbook.add_format( :text_wrap => 1, :valign => 'top' )
1004
1019
  worksheet1 = workbook.add_worksheet
@@ -1328,12 +1343,13 @@ def test_comments2
1328
1343
  worksheet8.write_comment( 'C6', comment )
1329
1344
 
1330
1345
  workbook.close
1331
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
1346
+ store_to_tempfile
1347
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
1332
1348
  end
1333
1349
 
1334
1350
  def test_conditional_format
1335
1351
  @xlsx = 'conditional_format.xlsx'
1336
- workbook = WriteXLSX.new(@xlsx)
1352
+ workbook = WriteXLSX.new(@io)
1337
1353
  worksheet1 = workbook.add_worksheet
1338
1354
  worksheet2 = workbook.add_worksheet
1339
1355
  worksheet3 = workbook.add_worksheet
@@ -1627,12 +1643,13 @@ def test_conditional_format
1627
1643
  )
1628
1644
 
1629
1645
  workbook.close
1630
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
1646
+ store_to_tempfile
1647
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
1631
1648
  end
1632
1649
 
1633
1650
  def test_data_validate
1634
1651
  @xlsx = 'data_validate.xlsx'
1635
- workbook = WriteXLSX.new(@xlsx)
1652
+ workbook = WriteXLSX.new(@io)
1636
1653
  worksheet = workbook.add_worksheet
1637
1654
 
1638
1655
  # Add a format for the header cells.
@@ -1894,12 +1911,13 @@ def test_data_validate
1894
1911
  })
1895
1912
 
1896
1913
  workbook.close
1897
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
1914
+ store_to_tempfile
1915
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
1898
1916
  end
1899
1917
 
1900
1918
  def test_date_time
1901
1919
  @xlsx = 'date_time.xlsx'
1902
- workbook = WriteXLSX.new(@xlsx)
1920
+ workbook = WriteXLSX.new(@io)
1903
1921
  worksheet = workbook.add_worksheet
1904
1922
  bold = workbook.add_format(:bold => 1)
1905
1923
 
@@ -1968,12 +1986,13 @@ def test_date_time
1968
1986
  worksheet.write(row, 1, 'Invalid date. Written as string.', bold)
1969
1987
 
1970
1988
  workbook.close
1971
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
1989
+ store_to_tempfile
1990
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
1972
1991
  end
1973
1992
 
1974
1993
  def test_defined_name
1975
1994
  @xlsx = 'defined_name.xlsx'
1976
- workbook = WriteXLSX.new(@xlsx)
1995
+ workbook = WriteXLSX.new(@io)
1977
1996
  worksheet1 = workbook.add_worksheet
1978
1997
  worksheet2 = workbook.add_worksheet
1979
1998
 
@@ -1995,12 +2014,13 @@ def test_defined_name
1995
2014
  end
1996
2015
 
1997
2016
  workbook.close
1998
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2017
+ store_to_tempfile
2018
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
1999
2019
  end
2000
2020
 
2001
2021
  def test_demo
2002
2022
  @xlsx = 'demo.xlsx'
2003
- workbook = WriteXLSX.new(@xlsx)
2023
+ workbook = WriteXLSX.new(@io)
2004
2024
  worksheet = workbook.add_worksheet('Demo')
2005
2025
  worksheet2 = workbook.add_worksheet('Another sheet')
2006
2026
  worksheet3 = workbook.add_worksheet('And another')
@@ -2094,12 +2114,13 @@ def test_demo
2094
2114
  worksheet.write('A19', "Multiple worksheets")
2095
2115
 
2096
2116
  workbook.close
2097
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2117
+ store_to_tempfile
2118
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2098
2119
  end
2099
2120
 
2100
2121
  def test_diag_border
2101
2122
  @xlsx = 'diag_border.xlsx'
2102
- workbook = WriteXLSX.new(@xlsx)
2123
+ workbook = WriteXLSX.new(@io)
2103
2124
  worksheet = workbook.add_worksheet()
2104
2125
 
2105
2126
 
@@ -2119,12 +2140,13 @@ def test_diag_border
2119
2140
  worksheet.write('B12', 'Text', format4)
2120
2141
 
2121
2142
  workbook.close
2122
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2143
+ store_to_tempfile
2144
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2123
2145
  end
2124
2146
 
2125
2147
  def test_fit_to_pages
2126
2148
  @xlsx = 'fit_to_pages.xlsx'
2127
- workbook = WriteXLSX.new(@xlsx)
2149
+ workbook = WriteXLSX.new(@io)
2128
2150
  worksheet1 = workbook.add_worksheet
2129
2151
  worksheet2 = workbook.add_worksheet
2130
2152
  worksheet3 = workbook.add_worksheet
@@ -2144,12 +2166,13 @@ def test_fit_to_pages
2144
2166
  worksheet4.fit_to_pages(1, 0) # 1 page wide and as long as necessary
2145
2167
 
2146
2168
  workbook.close
2147
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2169
+ store_to_tempfile
2170
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2148
2171
  end
2149
2172
 
2150
2173
  def test_formats
2151
2174
  @xlsx = 'formats.xlsx'
2152
- workbook = WriteXLSX.new(@xlsx)
2175
+ workbook = WriteXLSX.new(@io)
2153
2176
 
2154
2177
  # Some common formats
2155
2178
  center = workbook.add_format(:align => 'center')
@@ -2626,12 +2649,13 @@ def misc(workbook, center, heading, colors)
2626
2649
  alignment(workbook, center, heading, colors)
2627
2650
  misc(workbook, center, heading, colors)
2628
2651
  workbook.close
2629
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2652
+ store_to_tempfile
2653
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2630
2654
  end
2631
2655
 
2632
2656
  def test_headers
2633
2657
  @xlsx = 'headers.xlsx'
2634
- workbook = WriteXLSX.new(@xlsx)
2658
+ workbook = WriteXLSX.new(@io)
2635
2659
  preview = 'Select Print Preview to see the header and footer'
2636
2660
 
2637
2661
 
@@ -2708,12 +2732,13 @@ def test_headers
2708
2732
  worksheet5.write('A1', preview)
2709
2733
 
2710
2734
  workbook.close
2711
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2735
+ store_to_tempfile
2736
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2712
2737
  end
2713
2738
 
2714
2739
  def test_hide_first_sheet
2715
2740
  @xlsx = 'hide_first_sheet.xlsx'
2716
- workbook = WriteXLSX.new(@xlsx)
2741
+ workbook = WriteXLSX.new(@io)
2717
2742
  worksheet1 = workbook.add_worksheet
2718
2743
  worksheet2 = workbook.add_worksheet
2719
2744
 
@@ -2721,12 +2746,13 @@ def test_hide_first_sheet
2721
2746
  worksheet1.hide
2722
2747
 
2723
2748
  workbook.close
2724
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2749
+ store_to_tempfile
2750
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2725
2751
  end
2726
2752
 
2727
2753
  def test_hide_sheet
2728
2754
  @xlsx = 'hide_sheet.xlsx'
2729
- workbook = WriteXLSX.new(@xlsx)
2755
+ workbook = WriteXLSX.new(@io)
2730
2756
  worksheet1 = workbook.add_worksheet
2731
2757
  worksheet2 = workbook.add_worksheet
2732
2758
  worksheet3 = workbook.add_worksheet
@@ -2743,13 +2769,14 @@ def test_hide_sheet
2743
2769
  worksheet3.write(0, 0, 'Sheet2 is hidden')
2744
2770
 
2745
2771
  workbook.close
2746
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2772
+ store_to_tempfile
2773
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2747
2774
  end
2748
2775
 
2749
2776
  def test_hyperlink
2750
2777
  @xlsx = 'hyperlink.xlsx'
2751
2778
  # Create a new workbook and add a worksheet
2752
- workbook = WriteXLSX.new(@xlsx)
2779
+ workbook = WriteXLSX.new(@io)
2753
2780
 
2754
2781
  worksheet = workbook.add_worksheet('Hyperlinks')
2755
2782
 
@@ -2790,12 +2817,13 @@ def test_hyperlink
2790
2817
  worksheet.write_string('A11', 'http://www.perl.com/')
2791
2818
 
2792
2819
  workbook.close
2793
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2820
+ store_to_tempfile
2821
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2794
2822
  end
2795
2823
 
2796
2824
  def test_indent
2797
2825
  @xlsx = 'indent.xlsx'
2798
- workbook = WriteXLSX.new(@xlsx)
2826
+ workbook = WriteXLSX.new(@io)
2799
2827
 
2800
2828
  worksheet = workbook.add_worksheet
2801
2829
  indent1 = workbook.add_format(:indent => 1)
@@ -2807,13 +2835,14 @@ def test_indent
2807
2835
  worksheet.write('A2', "This text is indented 2 levels", indent2)
2808
2836
 
2809
2837
  workbook.close
2810
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2838
+ store_to_tempfile
2839
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2811
2840
  end
2812
2841
 
2813
2842
  def test_merge1
2814
2843
  @xlsx = 'merge1.xlsx'
2815
2844
  # Create a new workbook and add a worksheet
2816
- workbook = WriteXLSX.new(@xlsx)
2845
+ workbook = WriteXLSX.new(@io)
2817
2846
  worksheet = workbook.add_worksheet
2818
2847
 
2819
2848
  # Increase the cell size of the merged cells to highlight the formatting.
@@ -2828,13 +2857,14 @@ def test_merge1
2828
2857
  worksheet.write_blank(2, 2, format)
2829
2858
  worksheet.write_blank(2, 3, format)
2830
2859
  workbook.close
2831
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2860
+ store_to_tempfile
2861
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2832
2862
  end
2833
2863
 
2834
2864
  def test_merge2
2835
2865
  # Create a new workbook and add a worksheet
2836
2866
  @xlsx = 'merge2.xlsx'
2837
- workbook = WriteXLSX.new(@xlsx)
2867
+ workbook = WriteXLSX.new(@io)
2838
2868
  worksheet = workbook.add_worksheet
2839
2869
 
2840
2870
  # Increase the cell size of the merged cells to highlight the formatting.
@@ -2859,14 +2889,15 @@ def test_merge2
2859
2889
  worksheet.write_blank(2, 2, format)
2860
2890
 
2861
2891
  workbook.close
2862
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2892
+ store_to_tempfile
2893
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2863
2894
  end
2864
2895
 
2865
2896
  def test_merge3
2866
2897
  @xlsx = 'merge3.xlsx'
2867
2898
 
2868
2899
  # Create a new workbook and add a worksheet
2869
- workbook = WriteXLSX.new(@xlsx)
2900
+ workbook = WriteXLSX.new(@io)
2870
2901
  worksheet = workbook.add_worksheet()
2871
2902
 
2872
2903
  # Increase the cell size of the merged cells to highlight the formatting.
@@ -2892,13 +2923,14 @@ def test_merge3
2892
2923
  worksheet.merge_range('B7:D8', 'http://www.perl.com', format)
2893
2924
 
2894
2925
  workbook.close
2895
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2926
+ store_to_tempfile
2927
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2896
2928
  end
2897
2929
 
2898
2930
  def test_merge4
2899
2931
  @xlsx = 'merge4.xlsx'
2900
2932
  # Create a new workbook and add a worksheet
2901
- workbook = WriteXLSX.new(@xlsx)
2933
+ workbook = WriteXLSX.new(@io)
2902
2934
  worksheet = workbook.add_worksheet
2903
2935
 
2904
2936
  # Increase the cell size of the merged cells to highlight the formatting.
@@ -2962,13 +2994,14 @@ def test_merge4
2962
2994
  worksheet.merge_range('B11:D12', 'Justified: ' << 'so on and ' * 18, format4)
2963
2995
 
2964
2996
  workbook.close
2965
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
2997
+ store_to_tempfile
2998
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
2966
2999
  end
2967
3000
 
2968
3001
  def test_merge5
2969
3002
  @xlsx = 'merge5.xlsx'
2970
3003
  # Create a new workbook and add a worksheet
2971
- workbook = WriteXLSX.new(@xlsx)
3004
+ workbook = WriteXLSX.new(@io)
2972
3005
  worksheet = workbook.add_worksheet
2973
3006
 
2974
3007
  # Increase the cell size of the merged cells to highlight the formatting.
@@ -3021,13 +3054,14 @@ def test_merge5
3021
3054
  worksheet.merge_range( 'F4:F9', 'Rotation -90°', format3 )
3022
3055
 
3023
3056
  workbook.close
3024
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3057
+ store_to_tempfile
3058
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3025
3059
  end
3026
3060
 
3027
3061
  def test_merge6
3028
3062
  @xlsx = 'merge6.xlsx'
3029
3063
  # Create a new workbook and add a worksheet
3030
- workbook = WriteXLSX.new(@xlsx)
3064
+ workbook = WriteXLSX.new(@io)
3031
3065
  worksheet = workbook.add_worksheet
3032
3066
 
3033
3067
  # Increase the cell size of the merged cells to highlight the formatting.
@@ -3059,13 +3093,14 @@ def test_merge6
3059
3093
  worksheet.merge_range('B6:D7', "UTF-8: A Unicode smiley #{smiley}", format)
3060
3094
 
3061
3095
  workbook.close
3062
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3096
+ store_to_tempfile
3097
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3063
3098
  end
3064
3099
 
3065
3100
  def test_outline
3066
3101
  @xlsx = 'outline.xlsx'
3067
3102
  # Create a new workbook and add some worksheets
3068
- workbook = WriteXLSX.new(@xlsx)
3103
+ workbook = WriteXLSX.new(@io)
3069
3104
  worksheet1 = workbook.add_worksheet('Outlined Rows')
3070
3105
  worksheet2 = workbook.add_worksheet('Collapsed Rows')
3071
3106
  worksheet3 = workbook.add_worksheet('Outline Columns')
@@ -3247,12 +3282,13 @@ def test_outline
3247
3282
  worksheet4.set_row(12, nil, nil, nil, 1)
3248
3283
 
3249
3284
  workbook.close
3250
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3285
+ store_to_tempfile
3286
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3251
3287
  end
3252
3288
 
3253
3289
  def test_outline_collapsed
3254
3290
  @xlsx = 'outline_collapsed.xlsx'
3255
- workbook = WriteXLSX.new(@xlsx)
3291
+ workbook = WriteXLSX.new(@io)
3256
3292
  worksheet1 = workbook.add_worksheet('Outlined Rows')
3257
3293
  worksheet2 = workbook.add_worksheet('Collapsed Rows 1')
3258
3294
  worksheet3 = workbook.add_worksheet('Collapsed Rows 2')
@@ -3394,7 +3430,8 @@ def test_outline_collapsed
3394
3430
  worksheet6.write('H6', '=SUM(H2:H5)', bold)
3395
3431
 
3396
3432
  workbook.close
3397
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3433
+ store_to_tempfile
3434
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3398
3435
  end
3399
3436
 
3400
3437
  #
@@ -3437,7 +3474,7 @@ def create_sub_totals(worksheet, bold)
3437
3474
 
3438
3475
  def test_panes
3439
3476
  @xlsx = 'panes.xlsx'
3440
- workbook = WriteXLSX.new(@xlsx)
3477
+ workbook = WriteXLSX.new(@io)
3441
3478
 
3442
3479
  worksheet1 = workbook.add_worksheet('Panes 1')
3443
3480
  worksheet2 = workbook.add_worksheet('Panes 2')
@@ -3530,12 +3567,13 @@ def test_panes
3530
3567
  end
3531
3568
 
3532
3569
  workbook.close
3533
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3570
+ store_to_tempfile
3571
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3534
3572
  end
3535
3573
 
3536
3574
  def test_print_scale
3537
3575
  @xlsx = 'print_scale.xlsx'
3538
- workbook = WriteXLSX.new(@xlsx)
3576
+ workbook = WriteXLSX.new(@io)
3539
3577
  worksheet1 = workbook.add_worksheet
3540
3578
  worksheet2 = workbook.add_worksheet
3541
3579
  worksheet3 = workbook.add_worksheet
@@ -3550,12 +3588,13 @@ def test_print_scale
3550
3588
  worksheet3.print_scale = 200
3551
3589
 
3552
3590
  workbook.close
3553
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3591
+ store_to_tempfile
3592
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3554
3593
  end
3555
3594
 
3556
3595
  def test_properties
3557
3596
  @xlsx = 'properties.xlsx'
3558
- workbook = WriteXLSX.new(@xlsx)
3597
+ workbook = WriteXLSX.new(@io)
3559
3598
  worksheet = workbook.add_worksheet
3560
3599
 
3561
3600
  workbook.set_properties(
@@ -3574,12 +3613,13 @@ def test_properties
3574
3613
  worksheet.write('A1', "Select 'Office Button -> Prepare -> Properties' to see the file properties.")
3575
3614
 
3576
3615
  workbook.close
3577
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3616
+ store_to_tempfile
3617
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3578
3618
  end
3579
3619
 
3580
3620
  def test_protection
3581
3621
  @xlsx = 'protection.xlsx'
3582
- workbook = WriteXLSX.new(@xlsx)
3622
+ workbook = WriteXLSX.new(@io)
3583
3623
  worksheet = workbook.add_worksheet
3584
3624
 
3585
3625
  # Create some format objects
@@ -3607,12 +3647,13 @@ def test_protection
3607
3647
  worksheet.write('A6', 'to remove the worksheet protection.')
3608
3648
 
3609
3649
  workbook.close
3610
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3650
+ store_to_tempfile
3651
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3611
3652
  end
3612
3653
 
3613
3654
  def test_regions
3614
3655
  @xlsx = 'regions.xlsx'
3615
- workbook = WriteXLSX.new(@xlsx)
3656
+ workbook = WriteXLSX.new(@io)
3616
3657
 
3617
3658
  # Add some worksheets
3618
3659
  north = workbook.add_worksheet('North')
@@ -3646,12 +3687,13 @@ def test_regions
3646
3687
  south.set_selection(0, 1)
3647
3688
 
3648
3689
  workbook.close
3649
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3690
+ store_to_tempfile
3691
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3650
3692
  end
3651
3693
 
3652
3694
  def test_rich_strings
3653
3695
  @xlsx = 'rich_strings.xlsx'
3654
- workbook = WriteXLSX.new(@xlsx)
3696
+ workbook = WriteXLSX.new(@io)
3655
3697
  worksheet = workbook.add_worksheet
3656
3698
 
3657
3699
  worksheet.set_column('A:A', 30)
@@ -3678,12 +3720,13 @@ def test_rich_strings
3678
3720
  italic, 'j = k', superc, '(n-1)', center)
3679
3721
 
3680
3722
  workbook.close
3681
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3723
+ store_to_tempfile
3724
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3682
3725
  end
3683
3726
 
3684
3727
  def test_right_to_left
3685
3728
  @xlsx = 'right_to_left.xlsx'
3686
- workbook = WriteXLSX.new(@xlsx)
3729
+ workbook = WriteXLSX.new(@io)
3687
3730
  worksheet1 = workbook.add_worksheet
3688
3731
  worksheet2 = workbook.add_worksheet
3689
3732
 
@@ -3692,12 +3735,13 @@ def test_right_to_left
3692
3735
  worksheet1.write(0, 0, 'Hello') # A1, B1, C1, ...
3693
3736
  worksheet2.write(0, 0, 'Hello') # ..., C1, B1, A1
3694
3737
  workbook.close
3695
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3738
+ store_to_tempfile
3739
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3696
3740
  end
3697
3741
 
3698
3742
  def test_shape1
3699
3743
  @xlsx = 'shape1.xlsx'
3700
- workbook = WriteXLSX.new(@xlsx)
3744
+ workbook = WriteXLSX.new(@io)
3701
3745
  worksheet = workbook.add_worksheet
3702
3746
 
3703
3747
  # Add a circle, with centered text.
@@ -3715,12 +3759,13 @@ def test_shape1
3715
3759
  worksheet.insert_shape('D8', plus)
3716
3760
 
3717
3761
  workbook.close
3718
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3762
+ store_to_tempfile
3763
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3719
3764
  end
3720
3765
 
3721
3766
  def test_shape2
3722
3767
  @xlsx = 'shape2.xlsx'
3723
- workbook = WriteXLSX.new(@xlsx)
3768
+ workbook = WriteXLSX.new(@io)
3724
3769
  worksheet = workbook.add_worksheet
3725
3770
 
3726
3771
  worksheet.hide_gridlines(2)
@@ -3758,12 +3803,13 @@ def test_shape2
3758
3803
  worksheet.insert_shape('A1', decor, 250, 50)
3759
3804
 
3760
3805
  workbook.close
3761
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3806
+ store_to_tempfile
3807
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3762
3808
  end
3763
3809
 
3764
3810
  def test_shape3
3765
3811
  @xlsx = 'shape3.xlsx'
3766
- workbook = WriteXLSX.new(@xlsx)
3812
+ workbook = WriteXLSX.new(@io)
3767
3813
  worksheet = workbook.add_worksheet
3768
3814
 
3769
3815
  normal = workbook.add_shape(
@@ -3780,12 +3826,13 @@ def test_shape3
3780
3826
  worksheet.insert_shape('A1', normal, 250, 50, 3, 2)
3781
3827
 
3782
3828
  workbook.close
3783
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3829
+ store_to_tempfile
3830
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3784
3831
  end
3785
3832
 
3786
3833
  def test_shape4
3787
3834
  @xlsx = 'shape4.xlsx'
3788
- workbook = WriteXLSX.new(@xlsx)
3835
+ workbook = WriteXLSX.new(@io)
3789
3836
  worksheet = workbook.add_worksheet
3790
3837
  worksheet.hide_gridlines(2)
3791
3838
 
@@ -3824,12 +3871,13 @@ def test_shape4
3824
3871
  stencil.text = 'Now its a circle'
3825
3872
 
3826
3873
  workbook.close
3827
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3874
+ store_to_tempfile
3875
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3828
3876
  end
3829
3877
 
3830
3878
  def test_shape5
3831
3879
  @xlsx = 'shape5.xlsx'
3832
- workbook = WriteXLSX.new(@xlsx)
3880
+ workbook = WriteXLSX.new(@io)
3833
3881
  worksheet = workbook.add_worksheet
3834
3882
 
3835
3883
  s1 = workbook.add_shape(
@@ -3862,12 +3910,13 @@ def test_shape5
3862
3910
  worksheet.insert_shape('A1', cxn_shape, 0, 0)
3863
3911
 
3864
3912
  workbook.close
3865
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3913
+ store_to_tempfile
3914
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3866
3915
  end
3867
3916
 
3868
3917
  def test_shape6
3869
3918
  @xlsx = 'shape6.xlsx'
3870
- workbook = WriteXLSX.new(@xlsx)
3919
+ workbook = WriteXLSX.new(@io)
3871
3920
  worksheet = workbook.add_worksheet
3872
3921
 
3873
3922
  s1 = workbook.add_shape(
@@ -3900,12 +3949,13 @@ def test_shape6
3900
3949
  worksheet.insert_shape('A1', cxn_shape, 0, 0)
3901
3950
 
3902
3951
  workbook.close
3903
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
3952
+ store_to_tempfile
3953
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3904
3954
  end
3905
3955
 
3906
3956
  def test_shape7
3907
3957
  @xlsx = 'shape7.xlsx'
3908
- workbook = WriteXLSX.new(@xlsx)
3958
+ workbook = WriteXLSX.new(@io)
3909
3959
  worksheet = workbook.add_worksheet
3910
3960
 
3911
3961
  # Add a circle, with centered text. c is for circle, not center.
@@ -3964,12 +4014,13 @@ def test_shape7
3964
4014
  worksheet.insert_shape('A1', cxn_shape, 0, 0)
3965
4015
 
3966
4016
  workbook.close
3967
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
4017
+ store_to_tempfile
4018
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
3968
4019
  end
3969
4020
 
3970
4021
  def test_shape8
3971
4022
  @xlsx = 'shape8.xlsx'
3972
- workbook = WriteXLSX.new(@xlsx)
4023
+ workbook = WriteXLSX.new(@io)
3973
4024
  worksheet = workbook.add_worksheet
3974
4025
 
3975
4026
  # Add a circle, with centered text. c is for circle, not center.
@@ -4027,12 +4078,13 @@ def test_shape8
4027
4078
  worksheet.insert_shape('A1', cxn_shape, 0, 0)
4028
4079
 
4029
4080
  workbook.close
4030
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
4081
+ store_to_tempfile
4082
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
4031
4083
  end
4032
4084
 
4033
4085
  def test_shape_all
4034
4086
  @xlsx = 'shape_all.xlsx'
4035
- workbook = WriteXLSX.new(@xlsx)
4087
+ workbook = WriteXLSX.new(@io)
4036
4088
  worksheet = nil
4037
4089
  last_sheet = ''
4038
4090
  row = 0
@@ -4062,7 +4114,8 @@ def test_shape_all
4062
4114
  end
4063
4115
 
4064
4116
  workbook.close
4065
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
4117
+ store_to_tempfile
4118
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
4066
4119
  end
4067
4120
 
4068
4121
  def shapes_list
@@ -4259,7 +4312,7 @@ def shapes_list
4259
4312
 
4260
4313
  def test_stats
4261
4314
  @xlsx = 'stats.xlsx'
4262
- workbook = WriteXLSX.new(@xlsx)
4315
+ workbook = WriteXLSX.new(@io)
4263
4316
  worksheet = workbook.add_worksheet('Test data')
4264
4317
 
4265
4318
  # Set the column width for column 1
@@ -4313,12 +4366,13 @@ def test_stats
4313
4366
  worksheet.write(10, 1, '=KURT(B2:I2)')
4314
4367
 
4315
4368
  workbook.close
4316
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
4369
+ store_to_tempfile
4370
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
4317
4371
  end
4318
4372
 
4319
4373
  def test_stats_ext
4320
4374
  @xlsx = 'stats_ext.xlsx'
4321
- workbook = WriteXLSX.new(@xlsx)
4375
+ workbook = WriteXLSX.new(@io)
4322
4376
  worksheet1 = workbook.add_worksheet('Test results')
4323
4377
  worksheet2 = workbook.add_worksheet('Data')
4324
4378
 
@@ -4377,12 +4431,13 @@ def test_stats_ext
4377
4431
  worksheet2.write(8, 1, 24.8, numformat)
4378
4432
 
4379
4433
  workbook.close
4380
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
4434
+ store_to_tempfile
4435
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
4381
4436
  end
4382
4437
 
4383
4438
  def test_stocks
4384
4439
  @xlsx = 'stocks.xlsx'
4385
- workbook = WriteXLSX.new(@xlsx)
4440
+ workbook = WriteXLSX.new(@io)
4386
4441
  worksheet = workbook.add_worksheet
4387
4442
 
4388
4443
  # Set the column width for columns 1, 2, 3 and 4
@@ -4437,12 +4492,13 @@ def test_stocks
4437
4492
  worksheet.write(3, 3, 0, f_change) # 0 in the font color (black)
4438
4493
 
4439
4494
  workbook.close
4440
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
4495
+ store_to_tempfile
4496
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
4441
4497
  end
4442
4498
 
4443
4499
  def test_tab_colors
4444
4500
  @xlsx = 'tab_colors.xlsx'
4445
- workbook = WriteXLSX.new(@xlsx)
4501
+ workbook = WriteXLSX.new(@io)
4446
4502
 
4447
4503
  worksheet1 = workbook.add_worksheet
4448
4504
  worksheet2 = workbook.add_worksheet
@@ -4455,12 +4511,13 @@ def test_tab_colors
4455
4511
  worksheet4.tab_color = 0x35 # Orange
4456
4512
 
4457
4513
  workbook.close
4458
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
4514
+ store_to_tempfile
4515
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
4459
4516
  end
4460
4517
 
4461
4518
  def test_tables
4462
4519
  @xlsx = 'tables.xlsx'
4463
- workbook = WriteXLSX.new(@xlsx)
4520
+ workbook = WriteXLSX.new(@io)
4464
4521
  worksheet1 = workbook.add_worksheet
4465
4522
  worksheet2 = workbook.add_worksheet
4466
4523
  worksheet3 = workbook.add_worksheet
@@ -4796,12 +4853,13 @@ def test_tables
4796
4853
  )
4797
4854
 
4798
4855
  workbook.close
4799
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
4856
+ store_to_tempfile
4857
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
4800
4858
  end
4801
4859
 
4802
4860
  def test_sparklines1
4803
4861
  @xlsx = 'sparklines1.xlsx'
4804
- workbook = WriteXLSX.new(@xlsx)
4862
+ workbook = WriteXLSX.new(@io)
4805
4863
  worksheet = workbook.add_worksheet
4806
4864
 
4807
4865
  # Some sample data to plot.
@@ -4844,12 +4902,13 @@ def test_sparklines1
4844
4902
  )
4845
4903
 
4846
4904
  workbook.close
4847
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
4905
+ store_to_tempfile
4906
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
4848
4907
  end
4849
4908
 
4850
4909
  def test_sparklines2
4851
4910
  @xlsx = 'sparklines2.xlsx'
4852
- workbook = WriteXLSX.new(@xlsx)
4911
+ workbook = WriteXLSX.new(@io)
4853
4912
  worksheet1 = workbook.add_worksheet
4854
4913
  worksheet2 = workbook.add_worksheet
4855
4914
  bold = workbook.add_format(:bold => 1)
@@ -5221,12 +5280,13 @@ def test_sparklines2
5221
5280
  worksheet2.write_col('A1', data)
5222
5281
 
5223
5282
  workbook.close
5224
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
5283
+ store_to_tempfile
5284
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
5225
5285
  end
5226
5286
 
5227
5287
  def test_add_vba_project
5228
5288
  @xlsx = 'add_vba_project.xlsm'
5229
- workbook = WriteXLSX.new(@xlsx)
5289
+ workbook = WriteXLSX.new(@io)
5230
5290
  worksheet = workbook.add_worksheet
5231
5291
 
5232
5292
  worksheet.set_column('A:A', 50)
@@ -5243,12 +5303,13 @@ def test_add_vba_project
5243
5303
  worksheet.write('B6', '=MyFunction(7)')
5244
5304
 
5245
5305
  workbook.close
5246
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
5306
+ store_to_tempfile
5307
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
5247
5308
  end
5248
5309
 
5249
5310
  def test_hide_row_col
5250
5311
  @xlsx = 'hide_row_col.xlsx'
5251
- workbook = WriteXLSX.new(@xlsx)
5312
+ workbook = WriteXLSX.new(@io)
5252
5313
  worksheet = workbook.add_worksheet
5253
5314
 
5254
5315
  # Write some data
@@ -5265,12 +5326,13 @@ def test_hide_row_col
5265
5326
  worksheet.set_column('G:XFD', nil, nil, 1)
5266
5327
 
5267
5328
  workbook.close
5268
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
5329
+ store_to_tempfile
5330
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
5269
5331
  end
5270
5332
 
5271
5333
  def test_chart_data_table
5272
5334
  @xlsx = 'chart_data_table.xlsx'
5273
- workbook = WriteXLSX.new(@xlsx)
5335
+ workbook = WriteXLSX.new(@io)
5274
5336
  worksheet = workbook.add_worksheet
5275
5337
  bold = workbook.add_format(:bold => 1)
5276
5338
 
@@ -5349,12 +5411,13 @@ def test_chart_data_table
5349
5411
  worksheet.insert_chart('D18', chart2, 25, 11)
5350
5412
 
5351
5413
  workbook.close
5352
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
5414
+ store_to_tempfile
5415
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
5353
5416
  end
5354
5417
 
5355
5418
  def test_chart_data_tools
5356
5419
  @xlsx = 'chart_data_tools.xlsx'
5357
- workbook = WriteXLSX.new(@xlsx)
5420
+ workbook = WriteXLSX.new(@io)
5358
5421
  worksheet = workbook.add_worksheet
5359
5422
  bold = workbook.add_format(:bold => 1)
5360
5423
 
@@ -5544,12 +5607,13 @@ def test_chart_data_tools
5544
5607
  worksheet.insert_chart('D82', chart6, 25, 10)
5545
5608
 
5546
5609
  workbook.close
5547
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
5610
+ store_to_tempfile
5611
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
5548
5612
  end
5549
5613
 
5550
5614
  def test_chart_combined
5551
5615
  @xlsx = 'chart_combined.xlsx'
5552
- workbook = WriteXLSX.new(@xlsx)
5616
+ workbook = WriteXLSX.new(@io)
5553
5617
  worksheet = workbook.add_worksheet
5554
5618
  bold = workbook.add_format(:bold => 1)
5555
5619
 
@@ -5642,12 +5706,13 @@ def test_chart_combined
5642
5706
  worksheet.insert_chart('E18', column_chart2)
5643
5707
 
5644
5708
  workbook.close
5645
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
5709
+ store_to_tempfile
5710
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
5646
5711
  end
5647
5712
 
5648
5713
  def test_chart_pareto
5649
5714
  @xlsx = 'chart_pareto.xlsx'
5650
- workbook = WriteXLSX.new(@xlsx)
5715
+ workbook = WriteXLSX.new(@io)
5651
5716
  worksheet = workbook.add_worksheet
5652
5717
 
5653
5718
  # Formats used in the workbook.
@@ -5716,6 +5781,7 @@ def test_chart_pareto
5716
5781
  worksheet.insert_chart('F2', column_chart)
5717
5782
 
5718
5783
  workbook.close
5719
- compare_xlsx(File.join(@perl_output, @xlsx), @xlsx)
5784
+ store_to_tempfile
5785
+ compare_xlsx(File.join(@perl_output, @xlsx), @tempfile.path)
5720
5786
  end
5721
5787
  end