rubyXL 2.5.4 → 2.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (332) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -1
  3. data/VERSION +1 -1
  4. data/lib/rubyXL/worksheet.rb +39 -38
  5. data/rdoc/README_rdoc.html +1 -1
  6. data/rdoc/RubyXL.html +1 -1
  7. data/rdoc/RubyXL/AExtension.html +1 -1
  8. data/rdoc/RubyXL/AExtensionStorageArea.html +1 -1
  9. data/rdoc/RubyXL/AdjustHandleList.html +1 -1
  10. data/rdoc/RubyXL/Alignment.html +1 -1
  11. data/rdoc/RubyXL/AlternateContent.html +1 -1
  12. data/rdoc/RubyXL/AutoFilter.html +1 -1
  13. data/rdoc/RubyXL/AutoFilterColumn.html +1 -1
  14. data/rdoc/RubyXL/BodyProperties.html +1 -1
  15. data/rdoc/RubyXL/BooleanNode.html +1 -1
  16. data/rdoc/RubyXL/BooleanValue.html +1 -1
  17. data/rdoc/RubyXL/Border.html +1 -1
  18. data/rdoc/RubyXL/BorderEdge.html +1 -1
  19. data/rdoc/RubyXL/Borders.html +1 -1
  20. data/rdoc/RubyXL/Break.html +1 -1
  21. data/rdoc/RubyXL/BreakList.html +1 -1
  22. data/rdoc/RubyXL/CT_AdjPoint2D.html +1 -1
  23. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +1 -1
  24. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +1 -1
  25. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +1 -1
  26. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +1 -1
  27. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +1 -1
  28. data/rdoc/RubyXL/CT_Backdrop.html +1 -1
  29. data/rdoc/RubyXL/CT_Bevel.html +1 -1
  30. data/rdoc/RubyXL/CT_BiLevelEffect.html +1 -1
  31. data/rdoc/RubyXL/CT_BlendEffect.html +1 -1
  32. data/rdoc/RubyXL/CT_Blip.html +1 -1
  33. data/rdoc/RubyXL/CT_BlipFillProperties.html +1 -1
  34. data/rdoc/RubyXL/CT_BlurEffect.html +1 -1
  35. data/rdoc/RubyXL/CT_Camera.html +1 -1
  36. data/rdoc/RubyXL/CT_Color.html +1 -1
  37. data/rdoc/RubyXL/CT_ColorChangeEffect.html +1 -1
  38. data/rdoc/RubyXL/CT_ColorMapping.html +1 -1
  39. data/rdoc/RubyXL/CT_ColorScheme.html +1 -1
  40. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +1 -1
  41. data/rdoc/RubyXL/CT_ConnectionSite.html +1 -1
  42. data/rdoc/RubyXL/CT_ConnectionSiteList.html +1 -1
  43. data/rdoc/RubyXL/CT_DashStop.html +1 -1
  44. data/rdoc/RubyXL/CT_DashStopList.html +1 -1
  45. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +1 -1
  46. data/rdoc/RubyXL/CT_DuotoneEffect.html +1 -1
  47. data/rdoc/RubyXL/CT_EffectContainer.html +1 -1
  48. data/rdoc/RubyXL/CT_EffectList.html +1 -1
  49. data/rdoc/RubyXL/CT_EffectReference.html +1 -1
  50. data/rdoc/RubyXL/CT_EffectStyleItem.html +1 -1
  51. data/rdoc/RubyXL/CT_EffectStyleList.html +1 -1
  52. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +1 -1
  53. data/rdoc/RubyXL/CT_FillEffect.html +1 -1
  54. data/rdoc/RubyXL/CT_FillOverlayEffect.html +1 -1
  55. data/rdoc/RubyXL/CT_FillStyleList.html +1 -1
  56. data/rdoc/RubyXL/CT_FlatText.html +1 -1
  57. data/rdoc/RubyXL/CT_FontCollection.html +1 -1
  58. data/rdoc/RubyXL/CT_FontReference.html +1 -1
  59. data/rdoc/RubyXL/CT_GeomGuideList.html +1 -1
  60. data/rdoc/RubyXL/CT_GlowEffect.html +1 -1
  61. data/rdoc/RubyXL/CT_GradientFillProperties.html +1 -1
  62. data/rdoc/RubyXL/CT_GradientStop.html +1 -1
  63. data/rdoc/RubyXL/CT_GradientStopList.html +1 -1
  64. data/rdoc/RubyXL/CT_HSLEffect.html +1 -1
  65. data/rdoc/RubyXL/CT_HslColor.html +1 -1
  66. data/rdoc/RubyXL/CT_Hyperlink.html +1 -1
  67. data/rdoc/RubyXL/CT_InnerShadowEffect.html +1 -1
  68. data/rdoc/RubyXL/CT_LightRig.html +1 -1
  69. data/rdoc/RubyXL/CT_LineEndProperties.html +1 -1
  70. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +1 -1
  71. data/rdoc/RubyXL/CT_LineProperties.html +1 -1
  72. data/rdoc/RubyXL/CT_LineStyleList.html +1 -1
  73. data/rdoc/RubyXL/CT_LinearShadeProperties.html +1 -1
  74. data/rdoc/RubyXL/CT_LuminanceEffect.html +1 -1
  75. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +1 -1
  76. data/rdoc/RubyXL/CT_OuterShadowEffect.html +1 -1
  77. data/rdoc/RubyXL/CT_Path2D.html +1 -1
  78. data/rdoc/RubyXL/CT_Path2DArcTo.html +1 -1
  79. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +1 -1
  80. data/rdoc/RubyXL/CT_Path2DList.html +1 -1
  81. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +1 -1
  82. data/rdoc/RubyXL/CT_Path2DTo.html +1 -1
  83. data/rdoc/RubyXL/CT_PathShadeProperties.html +1 -1
  84. data/rdoc/RubyXL/CT_PatternFillProperties.html +1 -1
  85. data/rdoc/RubyXL/CT_Point3D.html +1 -1
  86. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +1 -1
  87. data/rdoc/RubyXL/CT_PresetColor.html +1 -1
  88. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +1 -1
  89. data/rdoc/RubyXL/CT_PresetShadowEffect.html +1 -1
  90. data/rdoc/RubyXL/CT_PresetTextShape.html +1 -1
  91. data/rdoc/RubyXL/CT_ReflectionEffect.html +1 -1
  92. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +1 -1
  93. data/rdoc/RubyXL/CT_RelativeRect.html +1 -1
  94. data/rdoc/RubyXL/CT_SRgbColor.html +1 -1
  95. data/rdoc/RubyXL/CT_ScRgbColor.html +1 -1
  96. data/rdoc/RubyXL/CT_Scene3D.html +1 -1
  97. data/rdoc/RubyXL/CT_SchemeColor.html +1 -1
  98. data/rdoc/RubyXL/CT_Shape3D.html +1 -1
  99. data/rdoc/RubyXL/CT_ShapeStyle.html +1 -1
  100. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +1 -1
  101. data/rdoc/RubyXL/CT_SphereCoords.html +1 -1
  102. data/rdoc/RubyXL/CT_StretchInfoProperties.html +1 -1
  103. data/rdoc/RubyXL/CT_StyleMatrix.html +1 -1
  104. data/rdoc/RubyXL/CT_StyleMatrixReference.html +1 -1
  105. data/rdoc/RubyXL/CT_SupplementalFont.html +1 -1
  106. data/rdoc/RubyXL/CT_SystemColor.html +1 -1
  107. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +1 -1
  108. data/rdoc/RubyXL/CT_TextBlipBullet.html +1 -1
  109. data/rdoc/RubyXL/CT_TextCharBullet.html +1 -1
  110. data/rdoc/RubyXL/CT_TextCharacterProperties.html +1 -1
  111. data/rdoc/RubyXL/CT_TextFont.html +1 -1
  112. data/rdoc/RubyXL/CT_TextListStyle.html +1 -1
  113. data/rdoc/RubyXL/CT_TextNormalAutofit.html +1 -1
  114. data/rdoc/RubyXL/CT_TextParagraphProperties.html +1 -1
  115. data/rdoc/RubyXL/CT_TextSpacing.html +1 -1
  116. data/rdoc/RubyXL/CT_TextTabStop.html +1 -1
  117. data/rdoc/RubyXL/CT_TextTabStopList.html +1 -1
  118. data/rdoc/RubyXL/CT_TileInfoProperties.html +1 -1
  119. data/rdoc/RubyXL/CT_TintEffect.html +1 -1
  120. data/rdoc/RubyXL/CT_Transform2D.html +1 -1
  121. data/rdoc/RubyXL/CT_TransformEffect.html +1 -1
  122. data/rdoc/RubyXL/CT_Vector3D.html +1 -1
  123. data/rdoc/RubyXL/CT_XYAdjustHandle.html +1 -1
  124. data/rdoc/RubyXL/CalculationChain.html +1 -1
  125. data/rdoc/RubyXL/CalculationChainCell.html +1 -1
  126. data/rdoc/RubyXL/CalculationProperties.html +1 -1
  127. data/rdoc/RubyXL/Cell.html +1 -1
  128. data/rdoc/RubyXL/CellSmartTag.html +1 -1
  129. data/rdoc/RubyXL/CellSmartTagProperty.html +1 -1
  130. data/rdoc/RubyXL/CellSmartTags.html +1 -1
  131. data/rdoc/RubyXL/CellStyle.html +1 -1
  132. data/rdoc/RubyXL/CellStyleXFs.html +1 -1
  133. data/rdoc/RubyXL/CellStyles.html +1 -1
  134. data/rdoc/RubyXL/CellValue.html +1 -1
  135. data/rdoc/RubyXL/CellWatch.html +1 -1
  136. data/rdoc/RubyXL/CellWatches.html +1 -1
  137. data/rdoc/RubyXL/CellXFs.html +1 -1
  138. data/rdoc/RubyXL/Chartsheet.html +1 -1
  139. data/rdoc/RubyXL/ChartsheetPageSetup.html +1 -1
  140. data/rdoc/RubyXL/ChartsheetProperties.html +1 -1
  141. data/rdoc/RubyXL/ChartsheetProtection.html +1 -1
  142. data/rdoc/RubyXL/ChartsheetView.html +1 -1
  143. data/rdoc/RubyXL/ChartsheetViews.html +1 -1
  144. data/rdoc/RubyXL/Color.html +1 -1
  145. data/rdoc/RubyXL/ColorFilter.html +1 -1
  146. data/rdoc/RubyXL/ColorScale.html +1 -1
  147. data/rdoc/RubyXL/ColorSet.html +1 -1
  148. data/rdoc/RubyXL/Colors.html +1 -1
  149. data/rdoc/RubyXL/ColumnRange.html +1 -1
  150. data/rdoc/RubyXL/ColumnRanges.html +1 -1
  151. data/rdoc/RubyXL/ConditionalFormatValue.html +1 -1
  152. data/rdoc/RubyXL/ConditionalFormatting.html +1 -1
  153. data/rdoc/RubyXL/ConditionalFormattingRule.html +1 -1
  154. data/rdoc/RubyXL/ContentTypeDefault.html +1 -1
  155. data/rdoc/RubyXL/ContentTypeOverride.html +1 -1
  156. data/rdoc/RubyXL/ContentTypes.html +1 -1
  157. data/rdoc/RubyXL/CoreProperties.html +1 -1
  158. data/rdoc/RubyXL/CustomColor.html +1 -1
  159. data/rdoc/RubyXL/CustomColorList.html +1 -1
  160. data/rdoc/RubyXL/CustomFilter.html +1 -1
  161. data/rdoc/RubyXL/CustomFilters.html +1 -1
  162. data/rdoc/RubyXL/CustomGeometry.html +1 -1
  163. data/rdoc/RubyXL/CustomProperties.html +1 -1
  164. data/rdoc/RubyXL/CustomProperty.html +1 -1
  165. data/rdoc/RubyXL/CustomSheetView.html +1 -1
  166. data/rdoc/RubyXL/CustomSheetViews.html +1 -1
  167. data/rdoc/RubyXL/CustomWorkbookView.html +1 -1
  168. data/rdoc/RubyXL/CustomWorkbookViews.html +1 -1
  169. data/rdoc/RubyXL/DXF.html +1 -1
  170. data/rdoc/RubyXL/DXFs.html +1 -1
  171. data/rdoc/RubyXL/DataBar.html +1 -1
  172. data/rdoc/RubyXL/DataConsolidate.html +1 -1
  173. data/rdoc/RubyXL/DataConsolidationReference.html +1 -1
  174. data/rdoc/RubyXL/DataConsolidationReferences.html +1 -1
  175. data/rdoc/RubyXL/DataType.html +1 -1
  176. data/rdoc/RubyXL/DataValidation.html +1 -1
  177. data/rdoc/RubyXL/DataValidations.html +1 -1
  178. data/rdoc/RubyXL/DateGroupItem.html +1 -1
  179. data/rdoc/RubyXL/DefinedName.html +1 -1
  180. data/rdoc/RubyXL/DefinedNames.html +1 -1
  181. data/rdoc/RubyXL/DocumentProperties.html +1 -1
  182. data/rdoc/RubyXL/DynamicFilter.html +1 -1
  183. data/rdoc/RubyXL/EmbeddedControl.html +1 -1
  184. data/rdoc/RubyXL/EmbeddedControls.html +1 -1
  185. data/rdoc/RubyXL/Extension.html +1 -1
  186. data/rdoc/RubyXL/ExtensionStorageArea.html +1 -1
  187. data/rdoc/RubyXL/Extents.html +1 -1
  188. data/rdoc/RubyXL/ExternalReference.html +1 -1
  189. data/rdoc/RubyXL/ExternalReferences.html +1 -1
  190. data/rdoc/RubyXL/ExtraColorSchemeList.html +1 -1
  191. data/rdoc/RubyXL/FieldItem.html +1 -1
  192. data/rdoc/RubyXL/FileRecoveryProperties.html +1 -1
  193. data/rdoc/RubyXL/FileSharing.html +1 -1
  194. data/rdoc/RubyXL/FileVersion.html +1 -1
  195. data/rdoc/RubyXL/Fill.html +1 -1
  196. data/rdoc/RubyXL/Fills.html +1 -1
  197. data/rdoc/RubyXL/FilterContainer.html +1 -1
  198. data/rdoc/RubyXL/FloatNode.html +1 -1
  199. data/rdoc/RubyXL/FloatValue.html +1 -1
  200. data/rdoc/RubyXL/Font.html +1 -1
  201. data/rdoc/RubyXL/FontScheme.html +1 -1
  202. data/rdoc/RubyXL/Fonts.html +1 -1
  203. data/rdoc/RubyXL/Formula.html +1 -1
  204. data/rdoc/RubyXL/FunctionGroup.html +1 -1
  205. data/rdoc/RubyXL/FunctionGroups.html +1 -1
  206. data/rdoc/RubyXL/GenericStorage.html +1 -1
  207. data/rdoc/RubyXL/GradientFill.html +1 -1
  208. data/rdoc/RubyXL/HeaderFooterSettings.html +1 -1
  209. data/rdoc/RubyXL/Hyperlink.html +1 -1
  210. data/rdoc/RubyXL/Hyperlinks.html +1 -1
  211. data/rdoc/RubyXL/IconFilter.html +1 -1
  212. data/rdoc/RubyXL/IconSet.html +1 -1
  213. data/rdoc/RubyXL/IgnoredError.html +1 -1
  214. data/rdoc/RubyXL/IgnoredErrors.html +1 -1
  215. data/rdoc/RubyXL/IndexedColors.html +1 -1
  216. data/rdoc/RubyXL/InputCells.html +1 -1
  217. data/rdoc/RubyXL/IntegerNode.html +1 -1
  218. data/rdoc/RubyXL/IntegerValue.html +1 -1
  219. data/rdoc/RubyXL/LegacyCell.html +1 -1
  220. data/rdoc/RubyXL/LegacyWorkbook.html +1 -1
  221. data/rdoc/RubyXL/LegacyWorksheet.html +54 -54
  222. data/rdoc/RubyXL/MRUColors.html +1 -1
  223. data/rdoc/RubyXL/MergedCell.html +1 -1
  224. data/rdoc/RubyXL/MergedCells.html +1 -1
  225. data/rdoc/RubyXL/NumFmt.html +1 -1
  226. data/rdoc/RubyXL/NumberFormat.html +1 -1
  227. data/rdoc/RubyXL/NumberFormats.html +1 -1
  228. data/rdoc/RubyXL/OLEObject.html +1 -1
  229. data/rdoc/RubyXL/OLEObjects.html +1 -1
  230. data/rdoc/RubyXL/OLESize.html +1 -1
  231. data/rdoc/RubyXL/OOXMLContainerObject.html +1 -1
  232. data/rdoc/RubyXL/OOXMLObject.html +1 -1
  233. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +1 -1
  234. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +1 -1
  235. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +1 -1
  236. data/rdoc/RubyXL/OOXMLTopLevelObject.html +1 -1
  237. data/rdoc/RubyXL/Offset.html +1 -1
  238. data/rdoc/RubyXL/OutlineProperties.html +1 -1
  239. data/rdoc/RubyXL/PageMargins.html +1 -1
  240. data/rdoc/RubyXL/PageSetup.html +1 -1
  241. data/rdoc/RubyXL/PageSetupProperties.html +1 -1
  242. data/rdoc/RubyXL/Pane.html +1 -1
  243. data/rdoc/RubyXL/Parser.html +1 -1
  244. data/rdoc/RubyXL/PatternFill.html +1 -1
  245. data/rdoc/RubyXL/PhoneticProperties.html +1 -1
  246. data/rdoc/RubyXL/PhoneticRun.html +1 -1
  247. data/rdoc/RubyXL/PivotArea.html +1 -1
  248. data/rdoc/RubyXL/PivotCache.html +1 -1
  249. data/rdoc/RubyXL/PivotCaches.html +1 -1
  250. data/rdoc/RubyXL/PivotReference.html +1 -1
  251. data/rdoc/RubyXL/PivotReferences.html +1 -1
  252. data/rdoc/RubyXL/PivotTableSelection.html +1 -1
  253. data/rdoc/RubyXL/PresetGeometry.html +1 -1
  254. data/rdoc/RubyXL/PrintOptions.html +1 -1
  255. data/rdoc/RubyXL/ProtectedRange.html +1 -1
  256. data/rdoc/RubyXL/ProtectedRanges.html +1 -1
  257. data/rdoc/RubyXL/Protection.html +1 -1
  258. data/rdoc/RubyXL/RID.html +1 -1
  259. data/rdoc/RubyXL/RawOOXML.html +1 -1
  260. data/rdoc/RubyXL/Reference.html +1 -1
  261. data/rdoc/RubyXL/Relationship.html +1 -1
  262. data/rdoc/RubyXL/RichText.html +1 -1
  263. data/rdoc/RubyXL/RichTextRun.html +1 -1
  264. data/rdoc/RubyXL/RootRelationships.html +1 -1
  265. data/rdoc/RubyXL/Row.html +1 -1
  266. data/rdoc/RubyXL/RunProperties.html +1 -1
  267. data/rdoc/RubyXL/Scenario.html +1 -1
  268. data/rdoc/RubyXL/Scenarios.html +1 -1
  269. data/rdoc/RubyXL/Selection.html +1 -1
  270. data/rdoc/RubyXL/ShapeGuide.html +1 -1
  271. data/rdoc/RubyXL/ShapeTextRectangle.html +1 -1
  272. data/rdoc/RubyXL/SharedStringsTable.html +1 -1
  273. data/rdoc/RubyXL/Sheet.html +1 -1
  274. data/rdoc/RubyXL/SheetCalculationProperties.html +1 -1
  275. data/rdoc/RubyXL/SheetData.html +1 -1
  276. data/rdoc/RubyXL/Sheets.html +1 -1
  277. data/rdoc/RubyXL/SmartTagProperties.html +1 -1
  278. data/rdoc/RubyXL/SmartTagType.html +1 -1
  279. data/rdoc/RubyXL/SmartTagTypes.html +1 -1
  280. data/rdoc/RubyXL/SmartTags.html +1 -1
  281. data/rdoc/RubyXL/SortCondition.html +1 -1
  282. data/rdoc/RubyXL/SortState.html +1 -1
  283. data/rdoc/RubyXL/Sqref.html +1 -1
  284. data/rdoc/RubyXL/Stop.html +1 -1
  285. data/rdoc/RubyXL/StringNode.html +1 -1
  286. data/rdoc/RubyXL/StringNodeW3C.html +1 -1
  287. data/rdoc/RubyXL/StringValue.html +1 -1
  288. data/rdoc/RubyXL/Stylesheet.html +1 -1
  289. data/rdoc/RubyXL/TableParts.html +1 -1
  290. data/rdoc/RubyXL/TableStyle.html +1 -1
  291. data/rdoc/RubyXL/TableStyles.html +1 -1
  292. data/rdoc/RubyXL/Text.html +1 -1
  293. data/rdoc/RubyXL/Theme.html +1 -1
  294. data/rdoc/RubyXL/ThemeElements.html +1 -1
  295. data/rdoc/RubyXL/Top10.html +1 -1
  296. data/rdoc/RubyXL/Variant.html +1 -1
  297. data/rdoc/RubyXL/Vector.html +1 -1
  298. data/rdoc/RubyXL/VectorValue.html +1 -1
  299. data/rdoc/RubyXL/VisualProperties.html +1 -1
  300. data/rdoc/RubyXL/WebPublishObject.html +1 -1
  301. data/rdoc/RubyXL/WebPublishObjects.html +1 -1
  302. data/rdoc/RubyXL/WebPublishingItem.html +1 -1
  303. data/rdoc/RubyXL/WebPublishingItems.html +1 -1
  304. data/rdoc/RubyXL/WebPublishingProperties.html +1 -1
  305. data/rdoc/RubyXL/Workbook.html +1 -1
  306. data/rdoc/RubyXL/WorkbookProperties.html +1 -1
  307. data/rdoc/RubyXL/WorkbookProtection.html +1 -1
  308. data/rdoc/RubyXL/WorkbookRelationships.html +1 -1
  309. data/rdoc/RubyXL/WorkbookView.html +1 -1
  310. data/rdoc/RubyXL/WorkbookViews.html +1 -1
  311. data/rdoc/RubyXL/Worksheet.html +1 -1
  312. data/rdoc/RubyXL/WorksheetDimensions.html +1 -1
  313. data/rdoc/RubyXL/WorksheetFormatProperties.html +1 -1
  314. data/rdoc/RubyXL/WorksheetProperties.html +1 -1
  315. data/rdoc/RubyXL/WorksheetProtection.html +1 -1
  316. data/rdoc/RubyXL/WorksheetView.html +1 -1
  317. data/rdoc/RubyXL/WorksheetViews.html +1 -1
  318. data/rdoc/RubyXL/XF.html +1 -1
  319. data/rdoc/created.rid +2 -2
  320. data/rdoc/index.html +2 -2
  321. data/rdoc/js/search_index.js +1 -1
  322. data/rdoc/table_of_contents.html +2 -2
  323. data/rubyXL.gemspec +2 -6
  324. data/spec/lib/cell_spec.rb +67 -67
  325. data/spec/lib/color_spec.rb +2 -2
  326. data/spec/lib/parser_spec.rb +20 -20
  327. data/spec/lib/reference_spec.rb +10 -10
  328. data/spec/lib/stylesheet_spec.rb +6 -6
  329. data/spec/lib/workbook_spec.rb +11 -10
  330. data/spec/lib/worksheet_spec.rb +744 -712
  331. metadata +1 -16
  332. data/Gemfile.lock +0 -94
@@ -4,11 +4,11 @@ require 'rubyXL'
4
4
  describe RubyXL::Color do
5
5
  describe '.validate_color' do
6
6
  it 'should return true if a valid hex color without a # is passed' do
7
- RubyXL::Color.validate_color('0fbCAd').should == true
7
+ expect(RubyXL::Color.validate_color('0fbCAd')).to eq(true)
8
8
  end
9
9
 
10
10
  it 'should cause an error if an invalid hex color code or one with a # is passed' do
11
- lambda {RubyXL::Color.validate_color('#G')}.should raise_error
11
+ expect {RubyXL::Color.validate_color('#G')}.to raise_error
12
12
  end
13
13
  end
14
14
  end
@@ -48,22 +48,22 @@ describe RubyXL::Parser do
48
48
  it 'should parse a valid Excel xlsx or xlsm workbook correctly' do
49
49
  @workbook2 = RubyXL::Parser.parse(@file)
50
50
 
51
- @workbook2.worksheets.size.should == @workbook.worksheets.size
51
+ expect(@workbook2.worksheets.size).to eq(@workbook.worksheets.size)
52
52
  @workbook2.worksheets.each_index { |i|
53
- @workbook2[i].extract_data.should == @workbook[i].extract_data
53
+ expect(@workbook2[i].extract_data).to eq(@workbook[i].extract_data)
54
54
  }
55
55
  end
56
56
 
57
57
  it 'should cause an error if an xlsx or xlsm workbook is not passed' do
58
- lambda {@workbook2 = RubyXL::Parser.parse("nonexistent_file.tmp")}.should raise_error
58
+ expect {@workbook2 = RubyXL::Parser.parse("nonexistent_file.tmp")}.to raise_error
59
59
  end
60
60
 
61
61
  it 'should not cause an error if an xlsx or xlsm workbook is not passed but the skip_filename_check option is used' do
62
62
  filename = @time_str
63
63
  FileUtils.cp(@file, filename)
64
64
 
65
- lambda {@workbook2 = RubyXL::Parser.parse(filename)}.should raise_error
66
- lambda {@workbook2 = RubyXL::Parser.parse(filename, :skip_filename_check => true)}.should_not raise_error
65
+ expect {@workbook2 = RubyXL::Parser.parse(filename)}.to raise_error
66
+ expect {@workbook2 = RubyXL::Parser.parse(filename, :skip_filename_check => true)}.not_to raise_error
67
67
 
68
68
  File.delete(filename)
69
69
  end
@@ -71,9 +71,9 @@ describe RubyXL::Parser do
71
71
  it 'should only read the data and not any of the styles (for the sake of speed) when passed true' do
72
72
  @workbook2 = RubyXL::Parser.parse(@file, :data_only => true)
73
73
 
74
- @workbook2.worksheets.size.should == @workbook.worksheets.size
75
- @workbook2[0].extract_data.should == @workbook[0].extract_data
76
- @workbook2[0].extract_data.should == @workbook[0].extract_data
74
+ expect(@workbook2.worksheets.size).to eq(@workbook.worksheets.size)
75
+ expect(@workbook2[0].extract_data).to eq(@workbook[0].extract_data)
76
+ expect(@workbook2[0].extract_data).to eq(@workbook[0].extract_data)
77
77
  end
78
78
 
79
79
  =begin
@@ -86,27 +86,27 @@ describe RubyXL::Parser do
86
86
 
87
87
  it 'should unescape HTML entities properly' do
88
88
  @workbook2 = RubyXL::Parser.parse(@file)
89
- @workbook2["Escape Test"][0][0].value.should == "&"
90
- @workbook2["Escape Test"][0][1].value.should == "<"
91
- @workbook2["Escape Test"][0][2].value.should == ">"
89
+ expect(@workbook2["Escape Test"][0][0].value).to eq("&")
90
+ expect(@workbook2["Escape Test"][0][1].value).to eq("<")
91
+ expect(@workbook2["Escape Test"][0][2].value).to eq(">")
92
92
 
93
- @workbook2["Escape Test"][1][0].value.should == "&"
94
- @workbook2["Escape Test"][1][1].value.should == "<"
95
- @workbook2["Escape Test"][1][2].value.should == ">"
93
+ expect(@workbook2["Escape Test"][1][0].value).to eq("&")
94
+ expect(@workbook2["Escape Test"][1][1].value).to eq("<")
95
+ expect(@workbook2["Escape Test"][1][2].value).to eq(">")
96
96
  end
97
97
 
98
98
  it 'should parse Core properties correctly' do
99
99
  @workbook2 = RubyXL::Parser.parse(@file)
100
- @workbook2.creator.should == "test creator"
101
- @workbook2.modifier.should == "test modifier"
102
- @workbook2.created_at.should == @time
103
- @workbook2.modified_at.should == @time2
100
+ expect(@workbook2.creator).to eq("test creator")
101
+ expect(@workbook2.modifier).to eq("test modifier")
102
+ expect(@workbook2.created_at).to eq(@time)
103
+ expect(@workbook2.modified_at).to eq(@time2)
104
104
  end
105
105
 
106
106
  it 'should trim excessively long sheet names on save' do
107
107
  @workbook2 = RubyXL::Parser.parse(@file)
108
- @workbook2[@test_sheet_name].should be_nil
109
- @workbook2[@test_sheet_name[0..30]].should_not be_nil
108
+ expect(@workbook2[@test_sheet_name]).to be_nil
109
+ expect(@workbook2[@test_sheet_name[0..30]]).not_to be_nil
110
110
  end
111
111
 
112
112
  end
@@ -5,24 +5,24 @@ describe RubyXL::Reference do
5
5
 
6
6
  describe '.ind2ref + .ref2ind' do
7
7
  it 'should correctly return the "Excel Style" description of cells when given a row/column number' do
8
- RubyXL::Reference.ind2ref(0, 26).should == 'AA1'
9
- RubyXL::Reference.ind2ref(99, 0).should == 'A100'
10
- RubyXL::Reference.ind2ref(0, 26).should == 'AA1'
11
- RubyXL::Reference.ind2ref(0, 51).should == 'AZ1'
12
- RubyXL::Reference.ind2ref(0, 52).should == 'BA1'
13
- RubyXL::Reference.ind2ref(0, 77).should == 'BZ1'
14
- RubyXL::Reference.ind2ref(0, 78).should == 'CA1'
15
- RubyXL::Reference.ind2ref(0, 16383).should == 'XFD1'
8
+ expect(RubyXL::Reference.ind2ref(0, 26)).to eq('AA1')
9
+ expect(RubyXL::Reference.ind2ref(99, 0)).to eq('A100')
10
+ expect(RubyXL::Reference.ind2ref(0, 26)).to eq('AA1')
11
+ expect(RubyXL::Reference.ind2ref(0, 51)).to eq('AZ1')
12
+ expect(RubyXL::Reference.ind2ref(0, 52)).to eq('BA1')
13
+ expect(RubyXL::Reference.ind2ref(0, 77)).to eq('BZ1')
14
+ expect(RubyXL::Reference.ind2ref(0, 78)).to eq('CA1')
15
+ expect(RubyXL::Reference.ind2ref(0, 16383)).to eq('XFD1')
16
16
  end
17
17
 
18
18
  it 'should correctly convert back and forth between "Excel Style" and index style cell references' do
19
19
  0.upto(16383) do |n|
20
- RubyXL::Reference.ref2ind(RubyXL::Reference.ind2ref(n, 16383 - n)).should == [ n, 16383 - n ]
20
+ expect(RubyXL::Reference.ref2ind(RubyXL::Reference.ind2ref(n, 16383 - n))).to eq([ n, 16383 - n ])
21
21
  end
22
22
  end
23
23
 
24
24
  it 'should return [-1, -1] if the Excel index is not well-formed' do
25
- RubyXL::Reference.ref2ind('A1B').should == [-1, -1]
25
+ expect(RubyXL::Reference.ref2ind('A1B')).to eq([-1, -1])
26
26
  end
27
27
  end
28
28
 
@@ -5,23 +5,23 @@ describe RubyXL::NumberFormat do
5
5
 
6
6
  describe '.is_date_format?' do
7
7
  it 'should return true if number format = dd// yy// mm' do
8
- RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => 'dd// yy// mm').is_date_format?().should == true
8
+ expect(RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => 'dd// yy// mm').is_date_format?()).to eq(true)
9
9
  end
10
10
 
11
11
  it 'should return true if number format = DD// YY// MM (uppercase)' do
12
- RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => 'DD// YY// MM').is_date_format?().should == true
12
+ expect(RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => 'DD// YY// MM').is_date_format?()).to eq(true)
13
13
  end
14
14
 
15
15
  it 'should return false if number format = @' do
16
- RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => '@').is_date_format?().should == false
17
- RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => 'general').is_date_format?().should == false
18
- RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => '0.00e+00').is_date_format?().should == false
16
+ expect(RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => '@').is_date_format?()).to eq(false)
17
+ expect(RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => 'general').is_date_format?()).to eq(false)
18
+ expect(RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => '0.00e+00').is_date_format?()).to eq(false)
19
19
  end
20
20
 
21
21
  it 'should properly detect date formats amongst default ones' do
22
22
  all_formats = RubyXL::NumberFormats::DEFAULT_NUMBER_FORMATS
23
23
  id_list = all_formats.collect { |fmt| fmt.num_fmt_id if fmt.is_date_format? }.compact.sort
24
- id_list.should == [14, 15, 16, 17, 18, 19, 20, 21, 22, 45, 46, 47]
24
+ expect(id_list).to eq([14, 15, 16, 17, 18, 19, 20, 21, 22, 45, 46, 47])
25
25
  end
26
26
 
27
27
  end
@@ -17,39 +17,40 @@ describe RubyXL::Workbook do
17
17
 
18
18
  describe '.new' do
19
19
  it 'should automatically create a blank worksheet named "Sheet1"' do
20
- @workbook[0].sheet_name.should == 'Sheet1'
20
+ expect(@workbook[0]).not_to be_nil
21
+ expect(@workbook[0].sheet_name).to eq('Sheet1')
21
22
  end
22
23
  end
23
24
 
24
25
  describe '[]' do
25
26
  it 'should properly locate worksheet by index' do
26
- @workbook[1].sheet_name.should == 'Test Worksheet'
27
+ expect(@workbook[1]).not_to be_nil
28
+ expect(@workbook[1].sheet_name).to eq('Test Worksheet')
27
29
  end
28
30
 
29
31
  it 'should properly locate worksheet by name' do
30
- @workbook['Test Worksheet'].sheet_name.should == 'Test Worksheet'
32
+ expect(@workbook['Test Worksheet']).not_to be_nil
33
+ expect(@workbook['Test Worksheet'].sheet_name).to eq('Test Worksheet')
31
34
  end
32
35
  end
33
36
 
34
37
  describe '.add_worksheet' do
35
38
  it 'when not given a name, it should automatically pick a name "SheetX" that is not taken yet' do
39
+ expect(@workbook['Sheet2']).to be_nil
36
40
  @workbook.add_worksheet
37
- @workbook['Sheet2'].sheet_name.should == 'Sheet2'
41
+ expect(@workbook['Sheet2']).not_to be_nil
42
+ expect(@workbook['Sheet2'].sheet_name).to eq('Sheet2')
38
43
  end
39
44
  end
40
45
 
41
- describe '.write' do
42
- #method not conducive to unit tests
43
- end
44
-
45
46
  describe '.get_fill_color' do
46
47
  it 'should return the fill color of a particular style attribute' do
47
48
  @cell.change_fill('000000')
48
- @workbook.get_fill_color(@workbook.cell_xfs[@cell.style_index]).should == '000000'
49
+ expect(@workbook.get_fill_color(@workbook.cell_xfs[@cell.style_index])).to eq('000000')
49
50
  end
50
51
 
51
52
  it 'should return white (ffffff) if no fill color is specified in style' do
52
- @workbook.get_fill_color(@workbook.cell_xfs[@cell.style_index]).should == 'ffffff'
53
+ expect(@workbook.get_fill_color(@workbook.cell_xfs[@cell.style_index])).to eq('ffffff')
53
54
  end
54
55
  end
55
56
 
@@ -20,1606 +20,1638 @@ describe RubyXL::Worksheet do
20
20
  describe '.extract_data' do
21
21
  it 'should return a 2d array of just the cell values (without style or formula information)' do
22
22
  data = @worksheet.extract_data()
23
- data[0][0].should == '0:0'
24
- data.size.should == @worksheet.sheet_data.size
25
- data[0].size.should == @worksheet[0].size
23
+ expect(data[0][0]).to eq('0:0')
24
+ expect(data.size).to eq(@worksheet.sheet_data.size)
25
+ expect(data[0].size).to eq(@worksheet[0].size)
26
26
  end
27
27
  end
28
28
 
29
29
  describe '.get_table' do
30
30
  it 'should return nil if table cannot be found with specified string' do
31
- @worksheet.get_table('TEST').should be_nil
31
+ expect(@worksheet.get_table('TEST')).to be_nil
32
32
  end
33
33
 
34
34
  it 'should return nil if table cannot be found with specified headers' do
35
- @worksheet.get_table(['TEST']).should be_nil
35
+ expect(@worksheet.get_table(['TEST'])).to be_nil
36
36
  end
37
37
 
38
38
  it 'should return a hash when given an array of headers it can find, where :table points to an array of hashes (rows), where each symbol is a column' do
39
39
  headers = ["0:0", "0:1", "0:4"]
40
40
  table_hash = @worksheet.get_table(headers)
41
41
 
42
- table_hash[:table].size.should == 10
43
- table_hash["0:0"].size.should == 10
44
- table_hash["0:1"].size.should == 10
45
- table_hash["0:4"].size.should == 10
42
+ expect(table_hash[:table].size).to eq(10)
43
+ expect(table_hash["0:0"].size).to eq(10)
44
+ expect(table_hash["0:1"].size).to eq(10)
45
+ expect(table_hash["0:4"].size).to eq(10)
46
46
  end
47
47
  end
48
48
 
49
49
  describe '.change_row_fill' do
50
50
  it 'should raise error if hex color code not passed' do
51
- lambda {
52
- @worksheet.change_row_fill(0, 'G')
53
- }.should raise_error
51
+ expect {
52
+ @worksheet.change_row_fill(0, 'G')
53
+ }.to raise_error
54
54
  end
55
55
 
56
56
  it 'should raise error if hex color code includes # character' do
57
- lambda {
57
+ expect {
58
58
  @worksheet.change_row_fill(3,'#FFF000')
59
- }.should raise_error
59
+ }.to raise_error
60
60
  end
61
61
 
62
62
  it 'should make row and cell fill colors equal hex color code passed' do
63
63
  @worksheet.change_row_fill(0, '111111')
64
- @worksheet.get_row_fill(0).should == '111111'
65
- @worksheet[0][5].fill_color.should == '111111'
64
+ expect(@worksheet.get_row_fill(0)).to eq('111111')
65
+ expect(@worksheet[0][5].fill_color).to eq('111111')
66
66
  end
67
67
 
68
68
  it 'should cause error if a negative argument is passed in' do
69
- lambda {
69
+ expect {
70
70
  @worksheet.change_row_fill(-1,'111111')
71
- }.should raise_error
71
+ }.to raise_error
72
72
  end
73
73
 
74
74
  it 'should expand matrix to fit argument if nonnegative' do
75
- @worksheet.sheet_data.size.should == 11
75
+ expect(@worksheet.sheet_data.size).to eq(11)
76
76
  @worksheet.change_row_fill(11,'111111')
77
- @worksheet.get_row_fill(11).should == '111111'
78
- @worksheet.sheet_data.size.should == 12
77
+ expect(@worksheet.get_row_fill(11)).to eq('111111')
78
+ expect(@worksheet.sheet_data.size).to eq(12)
79
79
  end
80
80
  end
81
81
 
82
82
  describe '.change_row_font_name' do
83
83
  it 'should make row and cell font names equal font name passed' do
84
84
  @worksheet.change_row_font_name(0, 'Arial')
85
- @worksheet.get_row_font_name(0).should == 'Arial'
86
- @worksheet[0][5].font_name.should == 'Arial'
85
+ expect(@worksheet.get_row_font_name(0)).to eq('Arial')
86
+ expect(@worksheet[0][5].font_name).to eq('Arial')
87
87
  end
88
88
 
89
89
  it 'should cause error if a negative argument is passed in' do
90
- lambda {
90
+ expect {
91
91
  @worksheet.change_row_font_name(-1,'Arial')
92
- }.should raise_error
92
+ }.to raise_error
93
93
  end
94
94
 
95
95
  it 'should expand matrix to fit argument if nonnegative' do
96
- @worksheet.sheet_data.size.should == 11
96
+ expect(@worksheet.sheet_data.size).to eq(11)
97
97
  @worksheet.change_row_font_name(11, 'Arial')
98
- @worksheet.get_row_font_name(11).should == "Arial"
99
- @worksheet.sheet_data.size.should == 12
98
+ expect(@worksheet.get_row_font_name(11)).to eq("Arial")
99
+ expect(@worksheet.sheet_data.size).to eq(12)
100
100
  end
101
101
  end
102
102
 
103
103
  describe '.change_row_font_size' do
104
104
  it 'should make row and cell font sizes equal font number passed' do
105
105
  @worksheet.change_row_font_size(0, 20)
106
- @worksheet.get_row_font_size(0).should == 20
107
- @worksheet[0][5].font_size.should == 20
106
+ expect(@worksheet.get_row_font_size(0)).to eq(20)
107
+ expect(@worksheet[0][5].font_size).to eq(20)
108
108
  end
109
109
 
110
110
  it 'should cause an error if a string passed' do
111
- lambda {
111
+ expect {
112
112
  @worksheet.change_row_font_size(0, '20')
113
- }.should raise_error
113
+ }.to raise_error
114
114
  end
115
115
 
116
116
  it 'should cause error if a negative argument is passed in' do
117
- lambda {
117
+ expect {
118
118
  @worksheet.change_row_font_size(-1,20)
119
- }.should raise_error
119
+ }.to raise_error
120
120
  end
121
121
 
122
122
  it 'should expand matrix to fit argument if nonnegative' do
123
- @worksheet.sheet_data.size.should == 11
123
+ expect(@worksheet.sheet_data.size).to eq(11)
124
124
  @worksheet.change_row_font_size(11,20)
125
- @worksheet.get_row_font_size(11).should == 20
126
- @worksheet.sheet_data.size.should == 12
125
+ expect(@worksheet.get_row_font_size(11)).to eq(20)
126
+ expect(@worksheet.sheet_data.size).to eq(12)
127
127
  end
128
128
  end
129
129
 
130
130
  describe '.change_row_font_color' do
131
131
  it 'should make row and cell font colors equal to font color passed' do
132
132
  @worksheet.change_row_font_color(0, '0f0f0f')
133
- @worksheet.get_row_font_color(0).should == '0f0f0f'
134
- @worksheet[0][5].font_color.should == '0f0f0f'
133
+ expect(@worksheet.get_row_font_color(0)).to eq('0f0f0f')
134
+ expect(@worksheet[0][5].font_color).to eq('0f0f0f')
135
135
  end
136
136
 
137
137
  it 'should raise error if hex color code not passed' do
138
- lambda {
139
- @worksheet.change_row_font_color(0, 'G')
140
- }.should raise_error
138
+ expect {
139
+ @worksheet.change_row_font_color(0, 'G')
140
+ }.to raise_error
141
141
  end
142
142
 
143
143
  it 'should raise error if hex color code includes # character' do
144
- lambda {
144
+ expect {
145
145
  @worksheet.change_row_font_color(3,'#FFF000')
146
- }.should raise_error
146
+ }.to raise_error
147
147
  end
148
148
 
149
149
  it 'should cause error if a negative argument is passed in' do
150
- lambda {
150
+ expect {
151
151
  @worksheet.change_row_font_color(-1,'0f0f0f')
152
- }.should raise_error
152
+ }.to raise_error
153
153
  end
154
154
 
155
155
  it 'should expand matrix to fit argument if nonnegative' do
156
- @worksheet.sheet_data.size.should == 11
156
+ expect(@worksheet.sheet_data.size).to eq(11)
157
157
  @worksheet.change_row_font_color(11,'0f0f0f')
158
- @worksheet.get_row_font_color(11).should == '0f0f0f'
159
- @worksheet.sheet_data.size.should == 12
158
+ expect(@worksheet.get_row_font_color(11)).to eq('0f0f0f')
159
+ expect(@worksheet.sheet_data.size).to eq(12)
160
160
  end
161
161
  end
162
162
 
163
163
  describe '.change_row_italics' do
164
164
  it 'should make row and cell fonts italicized when true is passed' do
165
- @worksheet.change_row_italics(0,true)
166
- @worksheet.is_row_italicized(0).should == true
167
- @worksheet[0][5].is_italicized.should == true
165
+ @worksheet.change_row_italics(0, true)
166
+ expect(@worksheet.is_row_italicized(0)).to eq(true)
167
+ expect(@worksheet[0][5].is_italicized).to eq(true)
168
168
  end
169
169
 
170
170
  it 'should cause error if a negative argument is passed in' do
171
- lambda {
171
+ expect {
172
172
  @worksheet.change_row_italics(-1,false)
173
- }.should raise_error
173
+ }.to raise_error
174
174
  end
175
175
 
176
176
  it 'should expand matrix to fit argument if nonnegative' do
177
- @worksheet.sheet_data.size.should == 11
177
+ expect(@worksheet.sheet_data.size).to eq(11)
178
178
  @worksheet.change_row_italics(11,true)
179
- @worksheet.is_row_italicized(11).should == true
180
- @worksheet.sheet_data.size.should == 12
179
+ expect(@worksheet.is_row_italicized(11)).to eq(true)
180
+ expect(@worksheet.sheet_data.size).to eq(12)
181
181
  end
182
182
  end
183
183
 
184
184
  describe '.change_row_bold' do
185
185
  it 'should make row and cell fonts bolded when true is passed' do
186
- @worksheet.change_row_bold(0,true)
187
- @worksheet.is_row_bolded(0).should == true
188
- @worksheet[0][5].is_bolded.should == true
186
+ @worksheet.change_row_bold(0, true)
187
+ expect(@worksheet.is_row_bolded(0)).to eq(true)
188
+ expect(@worksheet[0][5].is_bolded).to eq(true)
189
189
  end
190
190
 
191
191
  it 'should cause error if a negative argument is passed in' do
192
- lambda {
192
+ expect {
193
193
  @worksheet.change_row_bold(-1,false)
194
- }.should raise_error
194
+ }.to raise_error
195
195
  end
196
196
 
197
197
  it 'should expand matrix to fit argument if nonnegative' do
198
- @worksheet.sheet_data.size.should == 11
198
+ expect(@worksheet.sheet_data.size).to eq(11)
199
199
  @worksheet.change_row_bold(11,true)
200
- @worksheet.is_row_bolded(11).should == true
201
- @worksheet.sheet_data.size.should == 12
200
+ expect(@worksheet.is_row_bolded(11)).to eq(true)
201
+ expect(@worksheet.sheet_data.size).to eq(12)
202
202
  end
203
203
  end
204
204
 
205
205
  describe '.change_row_underline' do
206
206
  it 'should make row and cell fonts underlined when true is passed' do
207
- @worksheet.change_row_underline(0,true)
208
- @worksheet.is_row_underlined(0).should == true
209
- @worksheet[0][5].is_underlined.should == true
207
+ @worksheet.change_row_underline(0, true)
208
+ expect(@worksheet.is_row_underlined(0)).to eq(true)
209
+ expect(@worksheet[0][5].is_underlined).to eq(true)
210
210
  end
211
211
 
212
212
  it 'should cause error if a negative argument is passed in' do
213
- lambda {
213
+ expect {
214
214
  @worksheet.change_row_underline(-1,false)
215
- }.should raise_error
215
+ }.to raise_error
216
216
  end
217
217
 
218
218
  it 'should expand matrix to fit argument if nonnegative' do
219
- @worksheet.sheet_data.size.should == 11
219
+ expect(@worksheet.sheet_data.size).to eq(11)
220
220
  @worksheet.change_row_underline(11,true)
221
- @worksheet.is_row_underlined(11).should == true
222
- @worksheet.sheet_data.size.should == 12
221
+ expect(@worksheet.is_row_underlined(11)).to eq(true)
222
+ expect(@worksheet.sheet_data.size).to eq(12)
223
223
  end
224
224
  end
225
225
 
226
226
  describe '.change_row_strikethrough' do
227
227
  it 'should make row and cell fonts struckthrough when true is passed' do
228
- @worksheet.change_row_strikethrough(0,true)
229
- @worksheet.is_row_struckthrough(0).should == true
230
- @worksheet[0][5].is_struckthrough.should == true
228
+ @worksheet.change_row_strikethrough(0, true)
229
+ expect(@worksheet.is_row_struckthrough(0)).to eq(true)
230
+ expect(@worksheet[0][5].is_struckthrough).to eq(true)
231
231
  end
232
232
 
233
233
  it 'should cause error if a negative argument is passed in' do
234
- lambda {
234
+ expect {
235
235
  @worksheet.change_row_strikethrough(-1,false)
236
- }.should raise_error
236
+ }.to raise_error
237
237
  end
238
238
 
239
239
  it 'should expand matrix to fit argument if nonnegative' do
240
- @worksheet.sheet_data.size.should == 11
240
+ expect(@worksheet.sheet_data.size).to eq(11)
241
241
  @worksheet.change_row_strikethrough(11,true)
242
- @worksheet.is_row_struckthrough(11).should == true
243
- @worksheet.sheet_data.size.should == 12
242
+ expect(@worksheet.is_row_struckthrough(11)).to eq(true)
243
+ expect(@worksheet.sheet_data.size).to eq(12)
244
244
  end
245
245
  end
246
246
 
247
247
  describe '.change_row_height' do
248
248
  it 'should make row height match number which is passed' do
249
249
  @worksheet.change_row_height(0,30.0002)
250
- @worksheet.get_row_height(0).should == 30.0002
250
+ expect(@worksheet.get_row_height(0)).to eq(30.0002)
251
251
  end
252
252
 
253
253
  it 'should make row height a number equivalent of the string passed if it is a string which is a number' do
254
254
  @worksheet.change_row_height(0,'30.0002')
255
- @worksheet.get_row_height(0).should == 30.0002
255
+ expect(@worksheet.get_row_height(0)).to eq(30.0002)
256
256
  end
257
257
 
258
258
  it 'should cause error if a string which is not a number' do
259
- lambda {
259
+ expect {
260
260
  @worksheet.change_row_height(0,'TEST')
261
- }.should raise_error
261
+ }.to raise_error
262
262
  end
263
263
 
264
264
  it 'should cause error if a negative argument is passed in' do
265
- lambda {
265
+ expect {
266
266
  @worksheet.change_row_height(-1,30)
267
- }.should raise_error
267
+ }.to raise_error
268
268
  end
269
269
 
270
270
  it 'should expand matrix to fit argument if nonnegative' do
271
- @worksheet.sheet_data.size.should == 11
271
+ expect(@worksheet.sheet_data.size).to eq(11)
272
272
  @worksheet.change_row_height(11,30)
273
- @worksheet.get_row_height(11).should == 30
274
- @worksheet.sheet_data.size.should == 12
273
+ expect(@worksheet.get_row_height(11)).to eq(30)
274
+ expect(@worksheet.sheet_data.size).to eq(12)
275
275
  end
276
276
  end
277
277
 
278
278
  describe '.change_row_horizontal_alignment' do
279
279
  it 'should cause row and cells to horizontally align as specified by the passed in string' do
280
280
  @worksheet.change_row_horizontal_alignment(0,'center')
281
- @worksheet.get_row_horizontal_alignment(0).should == 'center'
282
- @worksheet[0][5].horizontal_alignment.should == 'center'
281
+ expect(@worksheet.get_row_horizontal_alignment(0)).to eq('center')
282
+ expect(@worksheet[0][5].horizontal_alignment).to eq('center')
283
283
  end
284
284
 
285
285
 
286
286
  it 'should cause error if a negative argument is passed in' do
287
- lambda {
287
+ expect {
288
288
  @worksheet.change_row_horizontal_alignment(-1,'center')
289
- }.should raise_error
289
+ }.to raise_error
290
290
  end
291
291
 
292
292
  it 'should expand matrix to fit argument if nonnegative' do
293
- @worksheet.sheet_data.size.should == 11
293
+ expect(@worksheet.sheet_data.size).to eq(11)
294
294
  @worksheet.change_row_horizontal_alignment(11,'center')
295
- @worksheet.get_row_horizontal_alignment(11).should == 'center'
296
- @worksheet.sheet_data.size.should == 12
295
+ expect(@worksheet.get_row_horizontal_alignment(11)).to eq('center')
296
+ expect(@worksheet.sheet_data.size).to eq(12)
297
297
  end
298
298
  end
299
299
 
300
300
  describe '.change_row_vertical_alignment' do
301
301
  it 'should cause row and cells to vertically align as specified by the passed in string' do
302
302
  @worksheet.change_row_vertical_alignment(0,'center')
303
- @worksheet.get_row_vertical_alignment(0).should == 'center'
304
- @worksheet[0][5].vertical_alignment.should == 'center'
303
+ expect(@worksheet.get_row_vertical_alignment(0)).to eq('center')
304
+ expect(@worksheet[0][5].vertical_alignment).to eq('center')
305
305
  end
306
306
 
307
307
  it 'should cause error if a negative argument is passed in' do
308
- lambda {
308
+ expect {
309
309
  @worksheet.change_row_vertical_alignment(-1,'center')
310
- }.should raise_error
310
+ }.to raise_error
311
311
  end
312
312
 
313
313
  it 'should expand matrix to fit argument if nonnegative' do
314
- @worksheet.sheet_data.size.should == 11
314
+ expect(@worksheet.sheet_data.size).to eq(11)
315
315
  @worksheet.change_row_vertical_alignment(11,'center')
316
- @worksheet.get_row_vertical_alignment(11).should == 'center'
317
- @worksheet.sheet_data.size.should == 12
316
+ expect(@worksheet.get_row_vertical_alignment(11)).to eq('center')
317
+ expect(@worksheet.sheet_data.size).to eq(12)
318
318
  end
319
319
  end
320
320
 
321
321
  describe '.change_row_border_top' do
322
322
  it 'should cause row and cells to have border at top of specified weight' do
323
323
  @worksheet.change_row_border_top(0, 'thin')
324
- @worksheet.get_row_border_top(0).should == 'thin'
325
- @worksheet[0][5].border_top.should == 'thin'
324
+ expect(@worksheet.get_row_border_top(0)).to eq('thin')
325
+ expect(@worksheet[0][5].border_top).to eq('thin')
326
326
  end
327
327
 
328
328
  it 'should cause error if a negative argument is passed in' do
329
- lambda {
329
+ expect {
330
330
  @worksheet.change_row_border_top(-1,'thin')
331
- }.should raise_error
331
+ }.to raise_error
332
332
  end
333
333
 
334
334
  it 'should expand matrix to fit argument if nonnegative' do
335
- @worksheet.sheet_data.size.should == 11
335
+ expect(@worksheet.sheet_data.size).to eq(11)
336
336
  @worksheet.change_row_border_top(11,'thin')
337
- @worksheet.get_row_border_top(11).should == 'thin'
338
- @worksheet.sheet_data.size.should == 12
337
+ expect(@worksheet.get_row_border_top(11)).to eq('thin')
338
+ expect(@worksheet.sheet_data.size).to eq(12)
339
339
  end
340
340
  end
341
341
 
342
342
  describe '.change_row_border_left' do
343
343
  it 'should cause row and cells to have border at left of specified weight' do
344
344
  @worksheet.change_row_border_left(0, 'thin')
345
- @worksheet.get_row_border_left(0).should == 'thin'
346
- @worksheet[0][5].border_left.should == 'thin'
345
+ expect(@worksheet.get_row_border_left(0)).to eq('thin')
346
+ expect(@worksheet[0][5].border_left).to eq('thin')
347
347
  end
348
348
 
349
349
  it 'should cause error if a negative argument is passed in' do
350
- lambda {
350
+ expect {
351
351
  @worksheet.change_row_border_left(-1,'thin')
352
- }.should raise_error
352
+ }.to raise_error
353
353
  end
354
354
 
355
355
  it 'should expand matrix to fit argument if nonnegative' do
356
- @worksheet.sheet_data.size.should == 11
356
+ expect(@worksheet.sheet_data.size).to eq(11)
357
357
  @worksheet.change_row_border_left(11,'thin')
358
- @worksheet.get_row_border_left(11).should == 'thin'
359
- @worksheet.sheet_data.size.should == 12
358
+ expect(@worksheet.get_row_border_left(11)).to eq('thin')
359
+ expect(@worksheet.sheet_data.size).to eq(12)
360
360
  end
361
361
  end
362
362
 
363
363
  describe '.change_row_border_right' do
364
364
  it 'should cause row and cells to have border at right of specified weight' do
365
365
  @worksheet.change_row_border_right(0, 'thin')
366
- @worksheet.get_row_border_right(0).should == 'thin'
367
- @worksheet[0][5].border_right.should == 'thin'
366
+ expect(@worksheet.get_row_border_right(0)).to eq('thin')
367
+ expect(@worksheet[0][5].border_right).to eq('thin')
368
368
  end
369
369
 
370
370
  it 'should cause error if a negative argument is passed in' do
371
- lambda {
371
+ expect {
372
372
  @worksheet.change_row_border_right(-1,'thin')
373
- }.should raise_error
373
+ }.to raise_error
374
374
  end
375
375
 
376
376
  it 'should expand matrix to fit argument if nonnegative' do
377
- @worksheet.sheet_data.size.should == 11
377
+ expect(@worksheet.sheet_data.size).to eq(11)
378
378
  @worksheet.change_row_border_right(11,'thin')
379
- @worksheet.get_row_border_right(11).should == 'thin'
380
- @worksheet.sheet_data.size.should == 12
379
+ expect(@worksheet.get_row_border_right(11)).to eq('thin')
380
+ expect(@worksheet.sheet_data.size).to eq(12)
381
381
  end
382
382
  end
383
383
 
384
384
  describe '.change_row_border_bottom' do
385
385
  it 'should cause row to have border at bottom of specified weight' do
386
386
  @worksheet.change_row_border_bottom(0, 'thin')
387
- @worksheet.get_row_border_bottom(0).should == 'thin'
388
- @worksheet[0][5].border_bottom.should == 'thin'
387
+ expect(@worksheet.get_row_border_bottom(0)).to eq('thin')
388
+ expect(@worksheet[0][5].border_bottom).to eq('thin')
389
389
  end
390
390
 
391
391
  it 'should cause error if a negative argument is passed in' do
392
- lambda {
392
+ expect {
393
393
  @worksheet.change_row_border_bottom(-1,'thin')
394
- }.should raise_error
394
+ }.to raise_error
395
395
  end
396
396
 
397
397
  it 'should expand matrix to fit argument if nonnegative' do
398
- @worksheet.sheet_data.size.should == 11
398
+ expect(@worksheet.sheet_data.size).to eq(11)
399
399
  @worksheet.change_row_border_bottom(11,'thin')
400
- @worksheet.get_row_border_bottom(11).should == 'thin'
401
- @worksheet.sheet_data.size.should == 12
400
+ expect(@worksheet.get_row_border_bottom(11)).to eq('thin')
401
+ expect(@worksheet.sheet_data.size).to eq(12)
402
402
  end
403
403
  end
404
404
 
405
405
  describe '.change_row_border_diagonal' do
406
406
  it 'should cause row to have border at diagonal of specified weight' do
407
407
  @worksheet.change_row_border_diagonal(0, 'thin')
408
- @worksheet.get_row_border_diagonal(0).should == 'thin'
409
- @worksheet[0][5].border_diagonal.should == 'thin'
408
+ expect(@worksheet.get_row_border_diagonal(0)).to eq('thin')
409
+ expect(@worksheet[0][5].border_diagonal).to eq('thin')
410
410
  end
411
411
 
412
412
  it 'should cause error if a negative argument is passed in' do
413
- lambda {
413
+ expect {
414
414
  @worksheet.change_row_border_diagonal(-1,'thin')
415
- }.should raise_error
415
+ }.to raise_error
416
416
  end
417
417
 
418
418
  it 'should expand matrix to fit argument if nonnegative' do
419
- @worksheet.sheet_data.size.should == 11
419
+ expect(@worksheet.sheet_data.size).to eq(11)
420
420
  @worksheet.change_row_border_diagonal(11,'thin')
421
- @worksheet.get_row_border_diagonal(11).should == 'thin'
422
- @worksheet.sheet_data.size.should == 12
421
+ expect(@worksheet.get_row_border_diagonal(11)).to eq('thin')
422
+ expect(@worksheet.sheet_data.size).to eq(12)
423
423
  end
424
424
  end
425
425
 
426
426
  describe '.change_column_font_name' do
427
427
  it 'should cause column and cell font names to match string passed in' do
428
428
  @worksheet.change_column_font_name(0, 'Arial')
429
- @worksheet.get_column_font_name(0).should == 'Arial'
430
- @worksheet[5][0].font_name.should == 'Arial'
429
+ expect(@worksheet.get_column_font_name(0)).to eq('Arial')
430
+ expect(@worksheet[5][0].font_name).to eq('Arial')
431
431
  end
432
432
 
433
433
  it 'should cause error if a negative argument is passed in' do
434
- lambda {
434
+ expect {
435
435
  @worksheet.change_column_font_name(-1,'Arial')
436
- }.should raise_error
436
+ }.to raise_error
437
437
  end
438
438
 
439
439
  it 'should expand matrix to fit argument if nonnegative' do
440
- @worksheet.sheet_data[0].size.should == 11
440
+ expect(@worksheet.sheet_data[0].size).to eq(11)
441
441
  @worksheet.change_column_font_name(11,'Arial')
442
- @worksheet.get_column_font_name(11).should == 'Arial'
443
- @worksheet.sheet_data[0].size.should == 12
442
+ expect(@worksheet.get_column_font_name(11)).to eq('Arial')
443
+ expect(@worksheet.sheet_data[0].size).to eq(12)
444
444
  end
445
445
  end
446
446
 
447
447
  describe '.change_column_font_size' do
448
448
  it 'should make column and cell font sizes equal font number passed' do
449
449
  @worksheet.change_column_font_size(0, 20)
450
- @worksheet.get_column_font_size(0).should == 20
451
- @worksheet[5][0].font_size.should == 20
450
+ expect(@worksheet.get_column_font_size(0)).to eq(20)
451
+ expect(@worksheet[5][0].font_size).to eq(20)
452
452
  end
453
453
 
454
454
  it 'should cause an error if a string passed' do
455
- lambda {
455
+ expect {
456
456
  @worksheet.change_column_font_size(0, '20')
457
- }.should raise_error
457
+ }.to raise_error
458
458
  end
459
459
 
460
460
  it 'should cause error if a negative argument is passed in' do
461
- lambda {
461
+ expect {
462
462
  @worksheet.change_column_font_size(-1,20)
463
- }.should raise_error
463
+ }.to raise_error
464
464
  end
465
465
 
466
466
  it 'should expand matrix to fit argument if nonnegative'do
467
- @worksheet.sheet_data[0].size.should == 11
467
+ expect(@worksheet.sheet_data[0].size).to eq(11)
468
468
  @worksheet.change_column_font_size(11,20)
469
- @worksheet.get_column_font_size(11).should == 20
470
- @worksheet.sheet_data[0].size.should == 12
469
+ expect(@worksheet.get_column_font_size(11)).to eq(20)
470
+ expect(@worksheet.sheet_data[0].size).to eq(12)
471
471
  end
472
472
  end
473
473
 
474
474
  describe '.change_column_font_color' do
475
475
  it 'should make column and cell font colors equal to font color passed' do
476
476
  @worksheet.change_column_font_color(0, '0f0f0f')
477
- @worksheet.get_column_font_color(0).should == '0f0f0f'
478
- @worksheet[5][0].font_color.should == '0f0f0f'
477
+ expect(@worksheet.get_column_font_color(0)).to eq('0f0f0f')
478
+ expect(@worksheet[5][0].font_color).to eq('0f0f0f')
479
479
  end
480
480
 
481
481
  it 'should raise error if hex color code not passed' do
482
- lambda {
483
- @worksheet.change_column_font_color(0, 'G')
484
- }.should raise_error
482
+ expect {
483
+ @worksheet.change_column_font_color(0, 'G')
484
+ }.to raise_error
485
485
  end
486
486
 
487
487
  it 'should raise error if hex color code includes # character' do
488
- lambda {
488
+ expect {
489
489
  @worksheet.change_column_font_color(0,'#FFF000')
490
- }.should raise_error
490
+ }.to raise_error
491
491
  end
492
492
 
493
493
  it 'should cause error if a negative argument is passed in' do
494
- lambda {
494
+ expect {
495
495
  @worksheet.change_column_font_color(-1,'0f0f0f')
496
- }.should raise_error
496
+ }.to raise_error
497
497
  end
498
498
 
499
499
  it 'should expand matrix to fit argument if nonnegative'do
500
- @worksheet.sheet_data[0].size.should == 11
500
+ expect(@worksheet.sheet_data[0].size).to eq(11)
501
501
  @worksheet.change_column_font_color(11,'0f0f0f')
502
- @worksheet.get_column_font_color(11).should == '0f0f0f'
503
- @worksheet.sheet_data[0].size.should == 12
502
+ expect(@worksheet.get_column_font_color(11)).to eq('0f0f0f')
503
+ expect(@worksheet.sheet_data[0].size).to eq(12)
504
504
  end
505
505
  end
506
506
 
507
507
  describe '.change_column_italics' do
508
508
  it 'should make column and cell fonts italicized when true is passed' do
509
- @worksheet.change_column_italics(0,true)
510
- @worksheet.is_column_italicized(0).should == true
511
- @worksheet[5][0].is_italicized.should == true
509
+ @worksheet.change_column_italics(0, true)
510
+ expect(@worksheet.is_column_italicized(0)).to eq(true)
511
+ expect(@worksheet[5][0].is_italicized).to eq(true)
512
512
  end
513
513
 
514
514
  it 'should cause error if a negative argument is passed in' do
515
- lambda {
515
+ expect {
516
516
  @worksheet.change_column_italicized(-1,false)
517
- }.should raise_error
517
+ }.to raise_error
518
518
  end
519
519
 
520
520
  it 'should expand matrix to fit argument if nonnegative'do
521
- @worksheet.sheet_data[0].size.should == 11
521
+ expect(@worksheet.sheet_data[0].size).to eq(11)
522
522
  @worksheet.change_column_italics(11,true)
523
- @worksheet.is_column_italicized(11).should == true
524
- @worksheet.sheet_data[0].size.should == 12
523
+ expect(@worksheet.is_column_italicized(11)).to eq(true)
524
+ expect(@worksheet.sheet_data[0].size).to eq(12)
525
525
  end
526
526
  end
527
527
 
528
528
  describe '.change_column_bold' do
529
529
  it 'should make column and cell fonts bolded when true is passed' do
530
- @worksheet.change_column_bold(0,true)
531
- @worksheet.is_column_bolded(0).should == true
532
- @worksheet[5][0].is_bolded.should == true
530
+ @worksheet.change_column_bold(0, true)
531
+ expect(@worksheet.is_column_bolded(0)).to eq(true)
532
+ expect(@worksheet[5][0].is_bolded).to eq(true)
533
533
  end
534
534
 
535
535
  it 'should cause error if a negative argument is passed in' do
536
- lambda {
536
+ expect {
537
537
  @worksheet.change_column_bold(-1,false)
538
- }.should raise_error
538
+ }.to raise_error
539
539
  end
540
540
 
541
541
  it 'should expand matrix to fit argument if nonnegative'do
542
- @worksheet.sheet_data[0].size.should == 11
542
+ expect(@worksheet.sheet_data[0].size).to eq(11)
543
543
  @worksheet.change_column_bold(11,true)
544
- @worksheet.is_column_bolded(11).should == true
545
- @worksheet.sheet_data[0].size.should == 12
544
+ expect(@worksheet.is_column_bolded(11)).to eq(true)
545
+ expect(@worksheet.sheet_data[0].size).to eq(12)
546
546
  end
547
547
  end
548
548
 
549
549
  describe '.change_column_underline' do
550
550
  it 'should make column and cell fonts underlined when true is passed' do
551
- @worksheet.change_column_underline(0,true)
552
- @worksheet.is_column_underlined(0).should == true
553
- @worksheet[5][0].is_underlined.should == true
551
+ @worksheet.change_column_underline(0, true)
552
+ expect(@worksheet.is_column_underlined(0)).to eq(true)
553
+ expect(@worksheet[5][0].is_underlined).to eq(true)
554
554
  end
555
555
 
556
556
  it 'should cause error if a negative argument is passed in' do
557
- lambda {
557
+ expect {
558
558
  @worksheet.change_column_underline(-1,false)
559
- }.should raise_error
559
+ }.to raise_error
560
560
  end
561
561
 
562
562
  it 'should expand matrix to fit argument if nonnegative'do
563
- @worksheet.sheet_data[0].size.should == 11
563
+ expect(@worksheet.sheet_data[0].size).to eq(11)
564
564
  @worksheet.change_column_underline(11,true)
565
- @worksheet.is_column_underlined(11).should == true
566
- @worksheet.sheet_data[0].size.should == 12
565
+ expect(@worksheet.is_column_underlined(11)).to eq(true)
566
+ expect(@worksheet.sheet_data[0].size).to eq(12)
567
567
  end
568
568
  end
569
569
 
570
570
  describe '.change_column_strikethrough' do
571
571
  it 'should make column and cell fonts struckthrough when true is passed' do
572
- @worksheet.change_column_strikethrough(0,true)
573
- @worksheet.is_column_struckthrough(0).should == true
574
- @worksheet[5][0].is_struckthrough.should == true
572
+ @worksheet.change_column_strikethrough(0, true)
573
+ expect(@worksheet.is_column_struckthrough(0)).to eq(true)
574
+ expect(@worksheet[5][0].is_struckthrough).to eq(true)
575
575
  end
576
576
 
577
577
  it 'should cause error if a negative argument is passed in' do
578
- lambda {
578
+ expect {
579
579
  @worksheet.change_column_strikethrough(-1,false)
580
- }.should raise_error
580
+ }.to raise_error
581
581
  end
582
582
 
583
583
  it 'should expand matrix to fit argument if nonnegative'do
584
- @worksheet.sheet_data[0].size.should == 11
584
+ expect(@worksheet.sheet_data[0].size).to eq(11)
585
585
  @worksheet.change_column_strikethrough(11,true)
586
- @worksheet.is_column_struckthrough(11).should == true
587
- @worksheet.sheet_data[0].size.should == 12
586
+ expect(@worksheet.is_column_struckthrough(11)).to eq(true)
587
+ expect(@worksheet.sheet_data[0].size).to eq(12)
588
588
  end
589
589
  end
590
590
 
591
- describe '.change_column_width' do
591
+ describe '.change_column_width_raw' do
592
592
  it 'should make column width match number which is passed' do
593
593
  @worksheet.change_column_width_raw(0, 30.0002)
594
- @worksheet.get_column_width_raw(0).should == 30.0002
594
+ expect(@worksheet.get_column_width_raw(0)).to eq(30.0002)
595
595
  end
596
596
 
597
597
  it 'should cause error if a negative argument is passed in' do
598
- lambda {
599
- @worksheet.change_column_width(-1,10)
600
- }.should raise_error
598
+ expect {
599
+ @worksheet.change_column_width_raw(-1, 10)
600
+ }.to raise_error
601
601
  end
602
602
 
603
603
  it 'should expand matrix to fit argument if nonnegative'do
604
- @worksheet.sheet_data[0].size.should == 11
605
- @worksheet.change_column_width(11,30)
606
- @worksheet.get_column_width(11).should == 30
607
- @worksheet.sheet_data[0].size.should == 12
604
+ expect(@worksheet.sheet_data[0].size).to eq(11)
605
+ @worksheet.change_column_width_raw(11, 30)
606
+ expect(@worksheet.get_column_width_raw(11)).to eq(30)
607
+ expect(@worksheet.sheet_data[0].size).to eq(12)
608
608
  end
609
609
  end
610
610
 
611
611
  describe '.change_column_fill' do
612
612
  it 'should raise error if hex color code not passed' do
613
- lambda {
614
- @worksheet.change_column_fill(0, 'G')
615
- }.should raise_error
613
+ expect {
614
+ @worksheet.change_column_fill(0, 'G')
615
+ }.to raise_error
616
616
  end
617
617
 
618
618
  it 'should raise error if hex color code includes # character' do
619
- lambda {
619
+ expect {
620
620
  @worksheet.change_column_fill(3,'#FFF000')
621
- }.should raise_error
621
+ }.to raise_error
622
622
  end
623
623
 
624
- it 'should make column and cell fill colors equal hex color code passed' do
625
- @worksheet.change_column_fill(0, '111111')
626
- @worksheet.get_column_fill(0).should == '111111'
627
- @worksheet[5][0].fill_color.should == '111111'
628
- end
624
+ it 'should make column and cell fill colors equal hex color code passed' do
625
+ @worksheet.change_column_fill(0, '111111')
626
+ expect(@worksheet.get_column_fill(0)).to eq('111111')
627
+ expect(@worksheet[5][0].fill_color).to eq('111111')
628
+ end
629
629
 
630
- it 'should cause error if a negative argument is passed in' do
631
- lambda {
630
+ it 'should cause error if a negative argument is passed in' do
631
+ expect {
632
632
  @worksheet.change_column_fill(-1,'111111')
633
- }.should raise_error
633
+ }.to raise_error
634
634
  end
635
635
 
636
636
  it 'should expand matrix to fit argument if nonnegative'do
637
- @worksheet.sheet_data[0].size.should == 11
637
+ expect(@worksheet.sheet_data[0].size).to eq(11)
638
638
  @worksheet.change_column_fill(11,'111111')
639
- @worksheet.get_column_fill(11).should == '111111'
640
- @worksheet.sheet_data[0].size.should == 12
639
+ expect(@worksheet.get_column_fill(11)).to eq('111111')
640
+ expect(@worksheet.sheet_data[0].size).to eq(12)
641
641
  end
642
642
  end
643
643
 
644
644
  describe '.change_column_horizontal_alignment' do
645
645
  it 'should cause column and cell to horizontally align as specified by the passed in string' do
646
646
  @worksheet.change_column_horizontal_alignment(0,'center')
647
- @worksheet.get_column_horizontal_alignment(0).should == 'center'
648
- @worksheet[5][0].horizontal_alignment.should == 'center'
647
+ expect(@worksheet.get_column_horizontal_alignment(0)).to eq('center')
648
+ expect(@worksheet[5][0].horizontal_alignment).to eq('center')
649
649
  end
650
650
 
651
651
  it 'should cause error if a negative argument is passed in' do
652
- lambda {
652
+ expect {
653
653
  @worksheet.change_column_horizontal_alignment(-1,'center')
654
- }.should raise_error
654
+ }.to raise_error
655
655
  end
656
656
 
657
657
  it 'should expand matrix to fit argument if nonnegative'do
658
- @worksheet.sheet_data[0].size.should == 11
658
+ expect(@worksheet.sheet_data[0].size).to eq(11)
659
659
  @worksheet.change_column_horizontal_alignment(11,'center')
660
- @worksheet.get_column_horizontal_alignment(11).should == 'center'
661
- @worksheet.sheet_data[0].size.should == 12
660
+ expect(@worksheet.get_column_horizontal_alignment(11)).to eq('center')
661
+ expect(@worksheet.sheet_data[0].size).to eq(12)
662
662
  end
663
663
  end
664
664
 
665
665
  describe '.change_column_vertical_alignment' do
666
666
  it 'should cause column and cell to vertically align as specified by the passed in string' do
667
- @worksheet.change_column_vertical_alignment(0,'center')
668
- @worksheet.get_column_vertical_alignment(0).should == 'center'
669
- @worksheet[5][0].vertical_alignment.should == 'center'
667
+ @worksheet.change_column_vertical_alignment(0, 'center')
668
+ expect(@worksheet.get_column_vertical_alignment(0)).to eq('center')
669
+ expect(@worksheet[5][0].vertical_alignment).to eq('center')
670
670
  end
671
671
 
672
672
  it 'should cause error if a negative argument is passed in' do
673
- lambda {
674
- @worksheet.change_column_vertical_alignment(-1,'center')
675
- }.should raise_error
673
+ expect {
674
+ @worksheet.change_column_vertical_alignment(-1, 'center')
675
+ }.to raise_error
676
676
  end
677
677
 
678
678
  it 'should expand matrix to fit argument if nonnegative'do
679
- @worksheet.sheet_data[0].size.should == 11
679
+ expect(@worksheet.sheet_data[0].size).to eq(11)
680
680
  @worksheet.change_column_vertical_alignment(11,'center')
681
- @worksheet.get_column_vertical_alignment(11).should == 'center'
682
- @worksheet.sheet_data[0].size.should == 12
681
+ expect(@worksheet.get_column_vertical_alignment(11)).to eq('center')
682
+ expect(@worksheet.sheet_data[0].size).to eq(12)
683
+ end
684
+
685
+ it 'should set column width if column alignment is changed' do
686
+ test_column = 2
687
+ expect(@worksheet.get_column_vertical_alignment(test_column)).to be_nil
688
+ expect(@worksheet.get_column_width_raw(test_column)).to be_nil
689
+ expect(@worksheet.get_column_width(test_column)).to eq(RubyXL::ColumnRange::DEFAULT_WIDTH)
690
+ @worksheet.change_column_vertical_alignment(test_column, 'top')
691
+ expect(@worksheet.get_column_width_raw(test_column)).not_to be_nil
692
+ expect(@worksheet.get_column_width(test_column)).to eq(RubyXL::ColumnRange::DEFAULT_WIDTH)
693
+ expect(@worksheet.get_column_vertical_alignment(test_column)).to eq('top')
683
694
  end
684
695
  end
685
696
 
686
697
  describe '.change_column_border_top' do
687
698
  it 'should cause column and cells within to have border at top of specified weight' do
688
699
  @worksheet.change_column_border_top(0, 'thin')
689
- @worksheet.get_column_border_top(0).should == 'thin'
690
- @worksheet[5][0].border_top.should == 'thin'
700
+ expect(@worksheet.get_column_border_top(0)).to eq('thin')
701
+ expect(@worksheet[5][0].border_top).to eq('thin')
691
702
  end
692
703
 
693
704
  it 'should cause error if a negative argument is passed in' do
694
- lambda {
705
+ expect {
695
706
  @worksheet.change_column_border_top(-1,'thin')
696
- }.should raise_error
707
+ }.to raise_error
697
708
  end
698
709
 
699
710
  it 'should expand matrix to fit argument if nonnegative'do
700
- @worksheet.sheet_data[0].size.should == 11
711
+ expect(@worksheet.sheet_data[0].size).to eq(11)
701
712
  @worksheet.change_column_border_top(11,'thin')
702
- @worksheet.get_column_border_top(11).should == 'thin'
703
- @worksheet.sheet_data[0].size.should == 12
713
+ expect(@worksheet.get_column_border_top(11)).to eq('thin')
714
+ expect(@worksheet.sheet_data[0].size).to eq(12)
704
715
  end
705
716
  end
706
717
 
707
718
  describe '.change_column_border_left' do
708
719
  it 'should cause column and cells within to have border at left of specified weight' do
709
720
  @worksheet.change_column_border_left(0, 'thin')
710
- @worksheet.get_column_border_left(0).should == 'thin'
711
- @worksheet[5][0].border_left.should == 'thin'
721
+ expect(@worksheet.get_column_border_left(0)).to eq('thin')
722
+ expect(@worksheet[5][0].border_left).to eq('thin')
712
723
  end
713
724
 
714
725
  it 'should cause error if a negative argument is passed in' do
715
- lambda {
726
+ expect {
716
727
  @worksheet.change_column_border_left(-1,'thin')
717
- }.should raise_error
728
+ }.to raise_error
718
729
  end
719
730
 
720
731
  it 'should expand matrix to fit argument if nonnegative' do
721
- @worksheet.sheet_data[0].size.should == 11
732
+ expect(@worksheet.sheet_data[0].size).to eq(11)
722
733
  @worksheet.change_column_border_left(11,'thin')
723
- @worksheet.get_column_border_left(11).should == 'thin'
724
- @worksheet.sheet_data[0].size.should == 12
734
+ expect(@worksheet.get_column_border_left(11)).to eq('thin')
735
+ expect(@worksheet.sheet_data[0].size).to eq(12)
725
736
  end
726
737
  end
727
738
 
728
739
  describe '.change_column_border_right' do
729
740
  it 'should cause column and cells within to have border at right of specified weight' do
730
741
  @worksheet.change_column_border_right(0, 'thin')
731
- @worksheet.get_column_border_right(0).should == 'thin'
732
- @worksheet[5][0].border_right.should == 'thin'
742
+ expect(@worksheet.get_column_border_right(0)).to eq('thin')
743
+ expect(@worksheet[5][0].border_right).to eq('thin')
733
744
  end
734
745
 
735
746
  it 'should cause error if a negative argument is passed in' do
736
- lambda {
747
+ expect {
737
748
  @worksheet.change_column_border_right(-1,'thin')
738
- }.should raise_error
749
+ }.to raise_error
739
750
  end
740
751
 
741
752
  it 'should expand matrix to fit argument if nonnegative'do
742
- @worksheet.sheet_data[0].size.should == 11
753
+ expect(@worksheet.sheet_data[0].size).to eq(11)
743
754
  @worksheet.change_column_border_right(11,'thin')
744
- @worksheet.get_column_border_right(11).should == 'thin'
745
- @worksheet.sheet_data[0].size.should == 12
755
+ expect(@worksheet.get_column_border_right(11)).to eq('thin')
756
+ expect(@worksheet.sheet_data[0].size).to eq(12)
746
757
  end
747
758
  end
748
759
 
749
760
  describe '.change_column_border_bottom' do
750
761
  it 'should cause column and cells within to have border at bottom of specified weight' do
751
762
  @worksheet.change_column_border_bottom(0, 'thin')
752
- @worksheet.get_column_border_bottom(0).should == 'thin'
753
- @worksheet[5][0].border_bottom.should == 'thin'
763
+ expect(@worksheet.get_column_border_bottom(0)).to eq('thin')
764
+ expect(@worksheet[5][0].border_bottom).to eq('thin')
754
765
  end
755
766
 
756
767
  it 'should cause error if a negative argument is passed in' do
757
- lambda {
768
+ expect {
758
769
  @worksheet.change_column_border_bottom(-1,'thin')
759
- }.should raise_error
770
+ }.to raise_error
760
771
  end
761
772
 
762
773
  it 'should expand matrix to fit argument if nonnegative'do
763
- @worksheet.sheet_data[0].size.should == 11
774
+ expect(@worksheet.sheet_data[0].size).to eq(11)
764
775
  @worksheet.change_column_border_bottom(11,'thin')
765
- @worksheet.get_column_border_bottom(11).should == 'thin'
766
- @worksheet.sheet_data[0].size.should == 12
776
+ expect(@worksheet.get_column_border_bottom(11)).to eq('thin')
777
+ expect(@worksheet.sheet_data[0].size).to eq(12)
767
778
  end
768
779
  end
769
780
 
770
781
  describe '.change_column_border_diagonal' do
771
782
  it 'should cause column and cells within to have border at diagonal of specified weight' do
772
783
  @worksheet.change_column_border_diagonal(0, 'thin')
773
- @worksheet.get_column_border_diagonal(0).should == 'thin'
774
- @worksheet[5][0].border_diagonal.should == 'thin'
784
+ expect(@worksheet.get_column_border_diagonal(0)).to eq('thin')
785
+ expect(@worksheet[5][0].border_diagonal).to eq('thin')
775
786
  end
776
787
 
777
788
  it 'should cause error if a negative argument is passed in' do
778
- lambda {
789
+ expect {
779
790
  @worksheet.change_column_border_diagonal(-1,'thin')
780
- }.should raise_error
791
+ }.to raise_error
781
792
  end
782
793
 
783
794
  it 'should expand matrix to fit argument if nonnegative' do
784
- @worksheet.sheet_data[0].size.should == 11
795
+ expect(@worksheet.sheet_data[0].size).to eq(11)
785
796
  @worksheet.change_column_border_diagonal(11,'thin')
786
- @worksheet.get_column_border_diagonal(11).should == 'thin'
787
- @worksheet.sheet_data[0].size.should == 12
797
+ expect(@worksheet.get_column_border_diagonal(11)).to eq('thin')
798
+ expect(@worksheet.sheet_data[0].size).to eq(12)
788
799
  end
789
800
  end
790
801
 
791
802
  describe '.merge_cells' do
792
803
  it 'should merge cells in any valid range specified by indices' do
793
804
  @worksheet.merge_cells(0, 0, 1, 1)
794
- @worksheet.merged_cells.collect{ |r| r.ref.to_s }.should == ["A1:B2"]
805
+ expect(@worksheet.merged_cells.collect{ |r| r.ref.to_s }).to eq(["A1:B2"])
795
806
  end
796
807
  end
797
808
 
798
809
  describe '.add_cell' do
799
810
  it 'should add new cell where specified, even if a cell is already there (default)' do
800
811
  @worksheet.add_cell(0,0,'TEST')
801
- @worksheet[0][0].value.should_not == @old_cell_value
802
- @worksheet[0][0].value.should == 'TEST'
812
+ expect(@worksheet[0][0].value).not_to eq(@old_cell_value)
813
+ expect(@worksheet[0][0].value).to eq('TEST')
803
814
  end
804
815
 
805
816
  it 'should add new cell where specified with formula, even if a cell is already there (default)' do
806
817
  @worksheet.add_cell(0,0,'','SUM(A2:A10)')
807
- @worksheet[0][0].value.should_not == @old_cell_value
808
- @worksheet[0][0].formula.should_not == @old_cell_formula
809
- @worksheet[0][0].value.should == ''
810
- @worksheet[0][0].formula.expression.should == 'SUM(A2:A10)'
818
+ expect(@worksheet[0][0].value).not_to eq(@old_cell_value)
819
+ expect(@worksheet[0][0].formula).not_to eq(@old_cell_formula)
820
+ expect(@worksheet[0][0].value).to eq('')
821
+ expect(@worksheet[0][0].formula.expression).to eq('SUM(A2:A10)')
811
822
  end
812
823
 
813
824
  it 'should not overwrite when a cell is present when overwrite is specified to be false' do
814
825
  @worksheet.add_cell(0,0,'TEST','B2',false)
815
- @worksheet[0][0].value.should == @old_cell_value
816
- @worksheet[0][0].formula.should == @old_cell_formula
826
+ expect(@worksheet[0][0].value).to eq(@old_cell_value)
827
+ expect(@worksheet[0][0].formula).to eq(@old_cell_formula)
817
828
  end
818
829
 
819
830
  it 'should still add a new cell when there is no cell to be overwritten' do
820
831
  @worksheet.add_cell(11,11,'TEST','B2',false)
821
- @worksheet[11][11].value.should == 'TEST'
822
- @worksheet[11][11].formula.expression.should == 'B2'
832
+ expect(@worksheet[11][11].value).to eq('TEST')
833
+ expect(@worksheet[11][11].formula.expression).to eq('B2')
823
834
  end
824
835
 
825
836
  it 'should cause error if a negative argument is passed in' do
826
- lambda {
837
+ expect {
827
838
  @worksheet.add_cell(-1,-1,'')
828
- }.should raise_error
839
+ }.to raise_error
829
840
  end
830
841
  end
831
842
 
832
843
  describe '.delete_row' do
833
844
  it 'should delete a row at index specified, "pushing" everything else "up"' do
834
845
  @worksheet.delete_row(0)
835
- @worksheet[0][0].value.should == "1:0"
836
- @worksheet[0][0].formula.should be_nil
837
- @worksheet[0][0].row.should == 0
838
- @worksheet[0][0].column.should == 0
846
+ expect(@worksheet[0][0].value).to eq("1:0")
847
+ expect(@worksheet[0][0].formula).to be_nil
848
+ expect(@worksheet[0][0].row).to eq(0)
849
+ expect(@worksheet[0][0].column).to eq(0)
839
850
  end
840
851
 
841
852
  it 'should delete a row at index specified, adjusting styles for other rows' do
842
853
  @worksheet.change_row_font_name(1,"Courier")
843
854
  @worksheet.delete_row(0)
844
- @worksheet.get_row_font_name(0).should == "Courier"
855
+ expect(@worksheet.get_row_font_name(0)).to eq("Courier")
845
856
  end
846
857
 
847
858
  it 'should preserve (rather than fix) formulas that reference cells in "pushed up" rows' do
848
- @worksheet.add_cell(11,0,nil,'SUM(A1:A10)')
859
+ @worksheet.add_cell(11, 0, nil, 'SUM(A1:A10)')
849
860
  @worksheet.delete_row(0)
850
- @worksheet[10][0].formula.expression.should == 'SUM(A1:A10)'
861
+ expect(@worksheet[10][0].formula.expression).to eq('SUM(A1:A10)')
851
862
  end
852
863
 
853
864
  it 'should cause error if a negative argument is passed in' do
854
- lambda {
865
+ expect {
855
866
  @worksheet.delete_row(-1)
856
- }.should raise_error
867
+ }.to raise_error
857
868
  end
858
869
  end
859
870
 
860
871
  describe '.insert_row' do
861
872
  it 'should insert a row at index specified, "pushing" everything else "down"' do
862
873
  @worksheet.insert_row(0)
863
- @worksheet[0][0].should be_nil
864
- @worksheet[1][0].value.should == @old_cell_value
865
- @worksheet[1][0].formula.should == @old_cell_formula
874
+ expect(@worksheet[0][0]).to be_nil
875
+ expect(@worksheet[1][0].value).to eq(@old_cell_value)
876
+ expect(@worksheet[1][0].formula).to eq(@old_cell_formula)
866
877
  end
867
878
 
868
879
  it 'should insert a row at index specified, copying styles from row "above"' do
869
880
  @worksheet.change_row_font_name(0,'Courier')
870
881
  @worksheet.insert_row(1)
871
- @worksheet.get_row_font_name(1).should == 'Courier'
882
+ expect(@worksheet.get_row_font_name(1)).to eq('Courier')
872
883
  end
873
884
 
874
885
  it 'should preserve (rather than fix) formulas that reference cells "pushed down" rows' do
875
886
  @worksheet.add_cell(5,0,nil,'SUM(A1:A4)')
876
887
  @worksheet.insert_row(0)
877
- @worksheet[6][0].formula.expression.should == 'SUM(A1:A4)'
888
+ expect(@worksheet[6][0].formula.expression).to eq('SUM(A1:A4)')
878
889
  end
879
890
 
880
891
  it 'should cause error if a negative argument is passed in' do
881
- lambda {
892
+ expect {
882
893
  @worksheet.insert_row(-1)
883
- }.should raise_error
894
+ }.to raise_error
884
895
  end
885
896
 
886
897
  it 'should expand matrix to fit argument if nonnegative' do
887
- @worksheet.sheet_data.size.should == 11
898
+ expect(@worksheet.sheet_data.size).to eq(11)
888
899
  @worksheet.insert_row(11)
889
- @worksheet.sheet_data.size.should == 13
900
+ expect(@worksheet.sheet_data.size).to eq(13)
890
901
  end
891
902
  end
892
903
 
893
904
  describe '.delete_column' do
894
905
  it 'should delete a column at index specified, "pushing" everything else "left"' do
895
906
  @worksheet.delete_column(0)
896
- @worksheet[0][0].value.should == "0:1"
897
- @worksheet[0][0].formula.should be_nil
898
- @worksheet[0][0].row.should == 0
899
- @worksheet[0][0].column.should == 0
907
+ expect(@worksheet[0][0].value).to eq("0:1")
908
+ expect(@worksheet[0][0].formula).to be_nil
909
+ expect(@worksheet[0][0].row).to eq(0)
910
+ expect(@worksheet[0][0].column).to eq(0)
900
911
  end
901
912
 
902
913
  it 'should delete a column at index specified, "pushing" styles "left"' do
903
914
  @worksheet.change_column_font_name(1,"Courier")
904
915
  @worksheet.delete_column(0)
905
- @worksheet.get_column_font_name(0).should == "Courier"
916
+ expect(@worksheet.get_column_font_name(0)).to eq("Courier")
906
917
  end
907
918
 
908
919
  it 'should preserve (rather than fix) formulas that reference cells in "pushed left" columns' do
909
920
  @worksheet.add_cell(0,4,nil,'SUM(A1:D1)')
910
921
  @worksheet.delete_column(0)
911
- @worksheet[0][3].formula.expression.should == 'SUM(A1:D1)'
922
+ expect(@worksheet[0][3].formula.expression).to eq('SUM(A1:D1)')
912
923
  end
913
924
 
914
925
  it 'should cause error if negative argument is passed in' do
915
- lambda {
926
+ expect {
916
927
  @worksheet.delete_column(-1)
917
- }.should raise_error
928
+ }.to raise_error
918
929
  end
919
930
  end
920
931
 
921
932
  describe '.insert_column' do
922
933
  it 'should insert a column at index specified, "pushing" everything else "right"' do
923
934
  @worksheet.insert_column(0)
924
- @worksheet[0][0].should be_nil
925
- @worksheet[0][1].value.should == @old_cell_value
926
- @worksheet[0][1].formula.should == @old_cell_formula
935
+ expect(@worksheet[0][0]).to be_nil
936
+ expect(@worksheet[0][1].value).to eq(@old_cell_value)
937
+ expect(@worksheet[0][1].formula).to eq(@old_cell_formula)
927
938
  end
928
939
 
929
940
  it 'should insert a column at index specified, copying styles from column to "left"' do
930
941
  @worksheet.change_column_font_name(0,'Courier')
931
942
  @worksheet.insert_column(1)
932
- @worksheet.get_column_font_name(1).should == 'Courier'
943
+ expect(@worksheet.get_column_font_name(1)).to eq('Courier')
933
944
  end
934
945
 
935
946
  it 'should insert a column at 0 without copying any styles, when passed 0 as column index' do
936
947
  @worksheet.change_column_font_name(0, 'Courier')
937
948
  @worksheet.insert_column(0)
938
- @worksheet.get_column_font_name(0).should == 'Verdana' #not courier
949
+ expect(@worksheet.get_column_font_name(0)).to eq('Verdana') #not courier
939
950
  end
940
951
 
941
952
  it 'should preserve (rather than fix) formulas that reference cells in "pushed right" column' do
942
953
  @worksheet.add_cell(0,5,nil,'SUM(A1:D1)')
943
954
  @worksheet.insert_column(0)
944
- @worksheet[0][6].formula.expression.should == 'SUM(A1:D1)'
955
+ expect(@worksheet[0][6].formula.expression).to eq('SUM(A1:D1)')
945
956
  end
946
957
 
947
958
  it 'should cause error if a negative argument is passed in' do
948
- lambda {
959
+ expect {
949
960
  @worksheet.insert_column(-1)
950
- }.should raise_error
961
+ }.to raise_error
951
962
  end
952
963
 
953
964
  it 'should expand matrix to fit argument if nonnegative' do
954
- @worksheet.sheet_data[0].size.should == 11
965
+ expect(@worksheet.sheet_data[0].size).to eq(11)
955
966
  @worksheet.insert_column(11)
956
- @worksheet.sheet_data[0].size.should == 13
967
+ expect(@worksheet.sheet_data[0].size).to eq(13)
957
968
  end
958
969
  end
959
970
 
960
971
  describe '.insert_cell' do
961
972
  it 'should simply add a cell if no shift argument is specified' do
962
973
  @worksheet.insert_cell(0,0,'test')
963
- @worksheet[0][0].value.should == 'test'
964
- @worksheet[0][1].value.should == '0:1'
965
- @worksheet[1][0].value.should == '1:0'
974
+ expect(@worksheet[0][0].value).to eq('test')
975
+ expect(@worksheet[0][1].value).to eq('0:1')
976
+ expect(@worksheet[1][0].value).to eq('1:0')
966
977
  end
967
978
 
968
979
  it 'should shift cells to the right if :right is specified' do
969
980
  @worksheet.insert_cell(0,0,'test',nil,:right)
970
- @worksheet[0][0].value.should == 'test'
971
- @worksheet[0][1].value.should == '0:0'
972
- @worksheet[1][0].value.should == '1:0'
981
+ expect(@worksheet[0][0].value).to eq('test')
982
+ expect(@worksheet[0][1].value).to eq('0:0')
983
+ expect(@worksheet[1][0].value).to eq('1:0')
973
984
  end
974
985
 
975
986
  it 'should shift cells down if :down is specified' do
976
987
  @worksheet.insert_cell(0,0,'test',nil,:down)
977
- @worksheet[0][0].value.should == 'test'
978
- @worksheet[0][1].value.should == '0:1'
979
- @worksheet[1][0].value.should == '0:0'
988
+ expect(@worksheet[0][0].value).to eq('test')
989
+ expect(@worksheet[0][1].value).to eq('0:1')
990
+ expect(@worksheet[1][0].value).to eq('0:0')
980
991
  end
981
992
 
982
993
  it 'should cause error if shift argument is specified whcih is not :right or :down' do
983
- lambda {
994
+ expect {
984
995
  @worksheet.insert_cell(0,0,'test',nil,:up)
985
- }.should raise_error
996
+ }.to raise_error
986
997
  end
987
998
 
988
999
  it 'should cause error if a negative argument is passed in' do
989
- lambda {
1000
+ expect {
990
1001
  @worksheet.insert_cell(-1,-1)
991
- }.should raise_error
1002
+ }.to raise_error
992
1003
  end
993
1004
  end
994
1005
 
995
1006
  describe '.delete_cell' do
996
1007
  it 'should make a cell nil if no shift argument specified' do
997
1008
  deleted = @worksheet.delete_cell(0,0)
998
- @worksheet[0][0].should be_nil
999
- @old_cell.inspect.should == deleted.inspect
1009
+ expect(@worksheet[0][0]).to be_nil
1010
+ expect(@old_cell.inspect).to eq(deleted.inspect)
1000
1011
  end
1001
1012
 
1002
1013
  it 'should return nil if a cell which is out of range is specified' do
1003
- @worksheet.delete_cell(12,12).should be_nil
1014
+ expect(@worksheet.delete_cell(12,12)).to be_nil
1004
1015
  end
1005
1016
 
1006
1017
  it 'should cause error if a negative argument is passed in' do
1007
- lambda {
1018
+ expect {
1008
1019
  @worksheet.delete_cell(-1,-1)
1009
- }.should raise_error
1020
+ }.to raise_error
1010
1021
  end
1011
1022
 
1012
1023
  it 'should shift cells to the right of the deleted cell left if :left is specified' do
1013
1024
  @worksheet.delete_cell(0,0,:left)
1014
- @worksheet[0][0].value.should == '0:1'
1025
+ expect(@worksheet[0][0].value).to eq('0:1')
1015
1026
  end
1016
1027
 
1017
1028
  it 'should shift cells below the deleted cell up if :up is specified' do
1018
1029
  @worksheet.delete_cell(0,0,:up)
1019
- @worksheet[0][0].value.should == '1:0'
1030
+ expect(@worksheet[0][0].value).to eq('1:0')
1020
1031
  end
1021
1032
 
1022
1033
  it 'should cause en error if an argument other than :left, :up, or nil is specified for shift' do
1023
- lambda {
1034
+ expect {
1024
1035
  @worksheet.delete_cell(0,0,:down)
1025
- }.should raise_error
1036
+ }.to raise_error
1026
1037
  end
1027
1038
  end
1028
1039
 
1029
1040
  describe '.get_row_fill' do
1030
1041
  it 'should return white (ffffff) if no fill color specified for row' do
1031
- @worksheet.get_row_fill(0).should == 'ffffff'
1042
+ expect(@worksheet.get_row_fill(0)).to eq('ffffff')
1032
1043
  end
1033
1044
 
1034
1045
  it 'should correctly reflect fill color if specified for row' do
1035
1046
  @worksheet.change_row_fill(0, '000000')
1036
- @worksheet.get_row_fill(0).should == '000000'
1047
+ expect(@worksheet.get_row_fill(0)).to eq('000000')
1037
1048
  end
1038
1049
 
1039
1050
  it 'should return nil if a row which does not exist is passed in' do
1040
- @worksheet.get_row_fill(11).should be_nil
1051
+ expect(@worksheet.get_row_fill(11)).to be_nil
1041
1052
  end
1042
1053
  end
1043
1054
 
1044
1055
  describe '.get_row_font_name' do
1045
1056
  it 'should correctly reflect font name for row' do
1046
1057
  @worksheet.change_row_font_name(0,'Courier')
1047
- @worksheet.get_row_font_name(0).should == 'Courier'
1058
+ expect(@worksheet.get_row_font_name(0)).to eq('Courier')
1048
1059
  end
1049
1060
 
1050
1061
  it 'should return nil if a (nonnegative) row which does not exist is passed in' do
1051
- @worksheet.get_row_font_name(11).should be_nil
1062
+ expect(@worksheet.get_row_font_name(11)).to be_nil
1052
1063
  end
1053
1064
  end
1054
1065
 
1055
1066
  describe '.get_row_font_size' do
1056
1067
  it 'should correctly reflect font size for row' do
1057
1068
  @worksheet.change_row_font_size(0,30)
1058
- @worksheet.get_row_font_size(0).should == 30
1069
+ expect(@worksheet.get_row_font_size(0)).to eq(30)
1059
1070
  end
1060
1071
 
1061
1072
  it 'should return nil if a (nonnegative) row which does not exist is passed in' do
1062
- @worksheet.get_row_font_size(11).should be_nil
1073
+ expect(@worksheet.get_row_font_size(11)).to be_nil
1063
1074
  end
1064
1075
  end
1065
1076
 
1066
1077
  describe '.get_row_font_color' do
1067
1078
  it 'should correctly reflect font color for row' do
1068
1079
  @worksheet.change_row_font_color(0,'0f0f0f')
1069
- @worksheet.get_row_font_color(0).should == '0f0f0f'
1080
+ expect(@worksheet.get_row_font_color(0)).to eq('0f0f0f')
1070
1081
  end
1071
1082
 
1072
1083
  it 'should return nil if a (nonnegative) row which does not exist is passed in' do
1073
- @worksheet.get_row_font_color(11).should be_nil
1084
+ expect(@worksheet.get_row_font_color(11)).to be_nil
1074
1085
  end
1075
1086
  end
1076
1087
 
1077
1088
  describe '.is_row_italicized' do
1078
1089
  it 'should correctly return whether row is italicized' do
1079
- @worksheet.change_row_italics(0,true)
1080
- @worksheet.is_row_italicized(0).should == true
1090
+ @worksheet.change_row_italics(0, true)
1091
+ expect(@worksheet.is_row_italicized(0)).to eq(true)
1081
1092
  end
1082
1093
 
1083
1094
  it 'should return nil if a (nonnegative) row which does not exist is passed in' do
1084
- @worksheet.is_row_italicized(11).should be_nil
1095
+ expect(@worksheet.is_row_italicized(11)).to be_nil
1085
1096
  end
1086
1097
  end
1087
1098
 
1088
1099
  describe '.is_row_bolded' do
1089
1100
  it 'should correctly return whether row is bolded' do
1090
- @worksheet.change_row_bold(0,true)
1091
- @worksheet.is_row_bolded(0).should == true
1101
+ @worksheet.change_row_bold(0, true)
1102
+ expect(@worksheet.is_row_bolded(0)).to eq(true)
1092
1103
  end
1093
1104
 
1094
1105
  it 'should return nil if a (nonnegative) row which does not exist is passed in' do
1095
- @worksheet.is_row_bolded(11).should be_nil
1106
+ expect(@worksheet.is_row_bolded(11)).to be_nil
1096
1107
  end
1097
1108
  end
1098
1109
 
1099
1110
  describe '.is_row_underlined' do
1100
1111
  it 'should correctly return whether row is underlined' do
1101
- @worksheet.change_row_underline(0,true)
1102
- @worksheet.is_row_underlined(0).should == true
1112
+ @worksheet.change_row_underline(0, true)
1113
+ expect(@worksheet.is_row_underlined(0)).to eq(true)
1103
1114
  end
1104
1115
 
1105
1116
  it 'should return nil if a (nonnegative) row which does not exist is passed in' do
1106
- @worksheet.is_row_underlined(11).should be_nil
1117
+ expect(@worksheet.is_row_underlined(11)).to be_nil
1107
1118
  end
1108
1119
  end
1109
1120
 
1110
1121
  describe '.is_row_struckthrough' do
1111
1122
  it 'should correctly return whether row is struckthrough' do
1112
- @worksheet.change_row_strikethrough(0,true)
1113
- @worksheet.is_row_struckthrough(0).should == true
1123
+ @worksheet.change_row_strikethrough(0, true)
1124
+ expect(@worksheet.is_row_struckthrough(0)).to eq(true)
1114
1125
  end
1115
1126
 
1116
1127
  it 'should return nil if a (nonnegative) row which does not exist is passed in' do
1117
- @worksheet.is_row_struckthrough(11).should be_nil
1128
+ expect(@worksheet.is_row_struckthrough(11)).to be_nil
1118
1129
  end
1119
1130
  end
1120
1131
 
1121
1132
  describe '.get_row_height' do
1122
1133
  it 'should return 13 if no height specified for row' do
1123
- @worksheet.get_row_height(0).should == 13
1134
+ expect(@worksheet.get_row_height(0)).to eq(13)
1124
1135
  end
1125
1136
 
1126
1137
  it 'should correctly reflect height if specified for row' do
1127
1138
  @worksheet.change_row_height(0, 30)
1128
- @worksheet.get_row_height(0).should == 30
1139
+ expect(@worksheet.get_row_height(0)).to eq(30)
1129
1140
  end
1130
1141
 
1131
1142
  it 'should return nil if a row which does not exist is passed in' do
1132
- @worksheet.get_row_height(11).should be_nil
1143
+ expect(@worksheet.get_row_height(11)).to be_nil
1133
1144
  end
1134
1145
 
1135
1146
  it 'should cause error if a negative argument is passed in' do
1136
- lambda {
1147
+ expect {
1137
1148
  @worksheet.get_row_height(-1)
1138
- }.should raise_error
1149
+ }.to raise_error
1139
1150
  end
1140
1151
  end
1141
1152
 
1142
1153
  describe '.get_row_horizontal_alignment' do
1143
1154
  it 'should return nil if no alignment specified for row' do
1144
- @worksheet.get_row_horizontal_alignment(0).should be_nil
1155
+ expect(@worksheet.get_row_horizontal_alignment(0)).to be_nil
1145
1156
  end
1146
1157
 
1147
1158
  it 'should return nil if a row which does not exist is passed in' do
1148
- @worksheet.get_row_horizontal_alignment(11).should be_nil
1159
+ expect(@worksheet.get_row_horizontal_alignment(11)).to be_nil
1149
1160
  end
1150
1161
 
1151
1162
  it 'should cause error if a negative argument is passed in' do
1152
- lambda {
1163
+ expect {
1153
1164
  @worksheet.get_row_horizontal_alignment(-1)
1154
- }.should raise_error
1165
+ }.to raise_error
1155
1166
  end
1156
1167
 
1157
1168
  it 'should return correct horizontal alignment if it is set for that row' do
1158
1169
  @worksheet.change_row_horizontal_alignment(0, 'center')
1159
- @worksheet.get_row_horizontal_alignment(0).should == 'center'
1170
+ expect(@worksheet.get_row_horizontal_alignment(0)).to eq('center')
1160
1171
  end
1161
1172
  end
1162
1173
 
1163
1174
  describe '.get_row_vertical_alignment' do
1164
1175
  it 'should return nil if no alignment specified for row' do
1165
- @worksheet.get_row_vertical_alignment(0).should be_nil
1176
+ expect(@worksheet.get_row_vertical_alignment(0)).to be_nil
1166
1177
  end
1167
1178
 
1168
1179
  it 'should return nil if a row which does not exist is passed in' do
1169
- @worksheet.get_row_vertical_alignment(11).should be_nil
1180
+ expect(@worksheet.get_row_vertical_alignment(11)).to be_nil
1170
1181
  end
1171
1182
 
1172
1183
  it 'should cause error if a negative argument is passed in' do
1173
- lambda {
1184
+ expect {
1174
1185
  @worksheet.get_row_vertical_alignment(-1)
1175
- }.should raise_error
1186
+ }.to raise_error
1176
1187
  end
1177
1188
 
1178
1189
  it 'should return correct vertical alignment if it is set for that row' do
1179
1190
  @worksheet.change_row_vertical_alignment(0, 'center')
1180
- @worksheet.get_row_vertical_alignment(0).should == 'center'
1191
+ expect(@worksheet.get_row_vertical_alignment(0)).to eq('center')
1181
1192
  end
1182
1193
  end
1183
1194
 
1184
1195
  describe '.get_row_border_top' do
1185
1196
  it 'should return nil if no border is specified for that row in that direction' do
1186
- @worksheet.get_row_border_top(0).should be_nil
1197
+ expect(@worksheet.get_row_border_top(0)).to be_nil
1187
1198
  end
1188
1199
 
1189
1200
  it 'should return type of border that this row has on top' do
1190
1201
  @worksheet.change_row_border_top(0,'thin')
1191
- @worksheet.get_row_border_top(0).should == 'thin'
1202
+ expect(@worksheet.get_row_border_top(0)).to eq('thin')
1192
1203
  end
1193
1204
 
1194
1205
  it 'should cause error if a negative argument is passed in' do
1195
- lambda {
1206
+ expect {
1196
1207
  @worksheet.get_row_border_top(-1)
1197
- }.should raise_error
1208
+ }.to raise_error
1198
1209
  end
1199
1210
 
1200
1211
  it 'should return nil if a row which does not exist is passed in' do
1201
- @worksheet.get_row_border_top(11).should be_nil
1212
+ expect(@worksheet.get_row_border_top(11)).to be_nil
1202
1213
  end
1203
1214
  end
1204
1215
 
1205
1216
  describe '.get_row_border_left' do
1206
1217
  it 'should return nil if no border is specified for that row in that direction' do
1207
- @worksheet.get_row_border_left(0).should be_nil
1218
+ expect(@worksheet.get_row_border_left(0)).to be_nil
1208
1219
  end
1209
1220
 
1210
1221
  it 'should return type of border that this row has on left' do
1211
1222
  @worksheet.change_row_border_left(0,'thin')
1212
- @worksheet.get_row_border_left(0).should == 'thin'
1223
+ expect(@worksheet.get_row_border_left(0)).to eq('thin')
1213
1224
  end
1214
1225
 
1215
1226
  it 'should cause error if a negative argument is passed in' do
1216
- lambda {
1227
+ expect {
1217
1228
  @worksheet.get_row_border_left(-1)
1218
- }.should raise_error
1229
+ }.to raise_error
1219
1230
  end
1220
1231
 
1221
1232
  it 'should return nil if a row which does not exist is passed in' do
1222
- @worksheet.get_row_border_left(11).should be_nil
1233
+ expect(@worksheet.get_row_border_left(11)).to be_nil
1223
1234
  end
1224
1235
  end
1225
1236
 
1226
1237
  describe '.get_row_border_right' do
1227
1238
  it 'should return nil if no border is specified for that row in that direction' do
1228
- @worksheet.get_row_border_right(0).should be_nil
1239
+ expect(@worksheet.get_row_border_right(0)).to be_nil
1229
1240
  end
1230
1241
 
1231
1242
  it 'should return type of border that this row has on right' do
1232
1243
  @worksheet.change_row_border_right(0,'thin')
1233
- @worksheet.get_row_border_right(0).should == 'thin'
1244
+ expect(@worksheet.get_row_border_right(0)).to eq('thin')
1234
1245
  end
1235
1246
 
1236
1247
  it 'should cause error if a negative argument is passed in' do
1237
- lambda {
1248
+ expect {
1238
1249
  @worksheet.get_row_border_right(-1)
1239
- }.should raise_error
1250
+ }.to raise_error
1240
1251
  end
1241
1252
 
1242
1253
  it 'should return nil if a row which does not exist is passed in' do
1243
- @worksheet.get_row_border_right(11).should be_nil
1254
+ expect(@worksheet.get_row_border_right(11)).to be_nil
1244
1255
  end
1245
1256
  end
1246
1257
 
1247
1258
 
1248
1259
  describe '.get_row_border_bottom' do
1249
1260
  it 'should return nil if no border is specified for that row in that direction' do
1250
- @worksheet.get_row_border_bottom(0).should be_nil
1261
+ expect(@worksheet.get_row_border_bottom(0)).to be_nil
1251
1262
  end
1252
1263
 
1253
1264
  it 'should return type of border that this row has on bottom' do
1254
1265
  @worksheet.change_row_border_bottom(0,'thin')
1255
- @worksheet.get_row_border_bottom(0).should == 'thin'
1266
+ expect(@worksheet.get_row_border_bottom(0)).to eq('thin')
1256
1267
  end
1257
1268
 
1258
1269
  it 'should cause error if a negative argument is passed in' do
1259
- lambda {
1270
+ expect {
1260
1271
  @worksheet.get_row_border_bottom(-1)
1261
- }.should raise_error
1272
+ }.to raise_error
1262
1273
  end
1263
1274
 
1264
1275
  it 'should return nil if a row which does not exist is passed in' do
1265
- @worksheet.get_row_border_bottom(11).should be_nil
1276
+ expect(@worksheet.get_row_border_bottom(11)).to be_nil
1266
1277
  end
1267
1278
  end
1268
1279
 
1269
1280
  describe '.get_row_border_diagonal' do
1270
1281
  it 'should return nil if no border is specified for that row in that direction' do
1271
- @worksheet.get_row_border_diagonal(0).should be_nil
1282
+ expect(@worksheet.get_row_border_diagonal(0)).to be_nil
1272
1283
  end
1273
1284
 
1274
1285
  it 'should return type of border that this row has on diagonal' do
1275
1286
  @worksheet.change_row_border_diagonal(0,'thin')
1276
- @worksheet.get_row_border_diagonal(0).should == 'thin'
1287
+ expect(@worksheet.get_row_border_diagonal(0)).to eq('thin')
1277
1288
  end
1278
1289
 
1279
1290
  it 'should cause error if a negative argument is passed in' do
1280
- lambda {
1291
+ expect {
1281
1292
  @worksheet.get_row_border_diagonal(-1)
1282
- }.should raise_error
1293
+ }.to raise_error
1283
1294
  end
1284
1295
 
1285
1296
  it 'should return nil if a row which does not exist is passed in' do
1286
- @worksheet.get_row_border_diagonal(11).should be_nil
1297
+ expect(@worksheet.get_row_border_diagonal(11)).to be_nil
1287
1298
  end
1288
1299
  end
1289
1300
 
1290
1301
  describe '.get_column_font_name' do
1291
1302
  it 'should correctly reflect font name for column' do
1292
1303
  @worksheet.change_column_font_name(0,'Courier')
1293
- @worksheet.get_column_font_name(0).should == 'Courier'
1304
+ expect(@worksheet.get_column_font_name(0)).to eq('Courier')
1294
1305
  end
1295
1306
 
1296
1307
  it 'should cause error if a negative argument is passed in' do
1297
- lambda {
1308
+ expect {
1298
1309
  @worksheet.get_column_font_name(-1)
1299
- }.should raise_error
1310
+ }.to raise_error
1300
1311
  end
1301
1312
 
1302
1313
  it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1303
- @worksheet.get_column_font_name(11).should be_nil
1314
+ expect(@worksheet.get_column_font_name(11)).to be_nil
1304
1315
  end
1305
1316
  end
1306
1317
 
1307
1318
  describe '.get_column_font_size' do
1308
- it 'should correctly reflect font size for column' do
1309
- @worksheet.change_column_font_size(0,30)
1310
- @worksheet.get_column_font_size(0).should == 30
1311
- end
1312
-
1313
- it 'should cause error if a negative argument is passed in' do
1314
- lambda {
1315
- @worksheet.get_column_font_size(-1)
1316
- }.should raise_error
1317
- end
1318
-
1319
- it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1320
- @worksheet.get_column_font_size(11).should be_nil
1321
- end
1322
- end
1323
-
1324
- describe '.get_column_font_color' do
1325
- it 'should correctly reflect font color for column' do
1326
- @worksheet.change_column_font_color(0,'0f0f0f')
1327
- @worksheet.get_column_font_color(0).should == '0f0f0f'
1328
- end
1329
-
1330
- it 'should cause error if a negative argument is passed in' do
1331
- lambda {
1332
- @worksheet.get_column_font_color(-1)
1333
- }.should raise_error
1334
- end
1335
-
1336
- it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1337
- @worksheet.get_column_font_color(11).should be_nil
1338
- end
1339
-
1340
- it 'should return black (000000) if no rgb font color is specified' do
1341
- @worksheet.get_column_font_color(0).should == '000000'
1342
- end
1343
- end
1344
-
1345
- describe '.is_column_italicized' do
1346
- it 'should correctly return whether column is italicized' do
1347
- @worksheet.change_column_italics(0,true)
1348
- @worksheet.is_column_italicized(0).should == true
1349
- end
1350
-
1351
- it 'should cause error if a negative argument is passed in' do
1352
- lambda {
1353
- @worksheet.is_column_italicized(-1)
1354
- }.should raise_error
1355
- end
1356
-
1357
- it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1358
- @worksheet.is_column_italicized(11).should be_nil
1359
- end
1360
- end
1361
-
1362
- describe '.is_column_bolded' do
1363
- it 'should correctly return whether column is bolded' do
1364
- @worksheet.change_column_bold(0,true)
1365
- @worksheet.is_column_bolded(0).should == true
1366
- end
1367
-
1368
- it 'should cause error if a negative argument is passed in' do
1369
- lambda {
1370
- @worksheet.is_column_bolded(-1)
1371
- }.should raise_error
1372
- end
1373
-
1374
- it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1375
- @worksheet.is_column_bolded(11).should be_nil
1376
- end
1377
- end
1378
-
1379
- describe '.is_column_underlined' do
1380
- it 'should correctly return whether column is underlined' do
1381
- @worksheet.change_column_underline(0,true)
1382
- @worksheet.is_column_underlined(0).should == true
1383
- end
1384
-
1385
- it 'should cause error if a negative argument is passed in' do
1386
- lambda {
1387
- @worksheet.is_column_underlined(-1)
1388
- }.should raise_error
1389
- end
1390
-
1391
- it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1392
- @worksheet.is_column_underlined(11).should be_nil
1393
- end
1394
- end
1395
-
1396
- describe '.is_column_struckthrough' do
1397
- it 'should correctly return whether column is struckthrough' do
1398
- @worksheet.change_column_strikethrough(0,true)
1399
- @worksheet.is_column_struckthrough(0).should == true
1400
- end
1401
-
1402
- it 'should cause error if a negative argument is passed in' do
1403
- lambda {
1404
- @worksheet.is_column_struckthrough(-1)
1405
- }.should raise_error
1406
- end
1407
-
1408
- it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1409
- @worksheet.is_column_struckthrough(11).should be_nil
1410
- end
1411
- end
1412
-
1413
- describe '.get_column_width' do
1414
- it 'should return 10 (base column width) if no width specified for column' do
1415
- @worksheet.get_column_width(0).should == RubyXL::ColumnRange::DEFAULT_WIDTH
1416
- end
1417
-
1418
- it 'should correctly reflect width if specified for column' do
1419
- @worksheet.change_column_width(0, 30)
1420
- @worksheet.get_column_width(0).should == 30
1421
- end
1422
-
1423
- it 'should return nil if a column which does not exist is passed in' do
1424
- @worksheet.get_column_width_raw(11).should be_nil
1425
- end
1426
-
1427
- it 'should cause error if a negative argument is passed in' do
1428
- lambda {
1429
- @worksheet.get_column_width(-1)
1430
- }.should raise_error
1431
- end
1432
- end
1433
-
1434
- describe '.get_column_fill' do
1435
- it 'should return white (ffffff) if no fill color specified for column' do
1436
- @worksheet.get_column_fill(0).should == 'ffffff'
1437
- end
1438
-
1439
- it 'should correctly reflect fill color if specified for column' do
1440
- @worksheet.change_column_fill(0, '000000')
1441
- @worksheet.get_column_fill(0).should == '000000'
1442
- end
1443
-
1444
- it 'should return nil if a column which does not exist is passed in' do
1445
- @worksheet.get_column_fill(11).should be_nil
1446
- end
1447
-
1448
- it 'should cause error if a negative argument is passed in' do
1449
- lambda {
1450
- @worksheet.get_column_fill(-1)
1451
- }.should raise_error
1452
- end
1453
- end
1454
-
1455
- describe '.get_column_horizontal_alignment' do
1456
- it 'should return nil if no alignment specified for column' do
1457
- @worksheet.get_column_horizontal_alignment(0).should be_nil
1458
- end
1459
-
1460
- it 'should return nil if a column which does not exist is passed in' do
1461
- @worksheet.get_column_horizontal_alignment(11).should be_nil
1462
- end
1463
-
1464
- it 'should cause error if a negative argument is passed in' do
1465
- lambda {
1466
- @worksheet.get_column_horizontal_alignment(-1)
1467
- }.should raise_error
1468
- end
1469
-
1470
- it 'should return correct horizontal alignment if it is set for that column' do
1471
- @worksheet.change_column_horizontal_alignment(0, 'center')
1472
- @worksheet.get_column_horizontal_alignment(0).should == 'center'
1473
- end
1474
- end
1475
-
1476
- describe '.get_column_vertical_alignment' do
1477
- it 'should return nil if no alignment specified for column' do
1478
- @worksheet.get_column_vertical_alignment(0).should be_nil
1479
- end
1480
-
1481
- it 'should return nil if a column which does not exist is passed in' do
1482
- @worksheet.get_column_vertical_alignment(11).should be_nil
1483
- end
1484
-
1485
- it 'should cause error if a negative argument is passed in' do
1486
- lambda {
1487
- @worksheet.get_column_vertical_alignment(-1)
1488
- }.should raise_error
1489
- end
1490
-
1491
- it 'should return correct vertical alignment if it is set for that column' do
1492
- @worksheet.change_column_vertical_alignment(0, 'center')
1493
- @worksheet.get_column_vertical_alignment(0).should == 'center'
1494
- end
1495
- end
1496
-
1497
- describe '.get_column_border_top' do
1498
- it 'should return nil if no border is specified for that column in that direction' do
1499
- @worksheet.get_column_border_top(0).should be_nil
1500
- end
1501
-
1502
- it 'should return type of border that this column has on top' do
1503
- @worksheet.change_column_border_top(0,'thin')
1504
- @worksheet.get_column_border_top(0).should == 'thin'
1505
- end
1506
-
1507
- it 'should cause error if a negative argument is passed in' do
1508
- lambda {
1509
- @worksheet.get_column_border_top(-1)
1510
- }.should raise_error
1511
- end
1512
-
1513
- it 'should return nil if a column which does not exist is passed in' do
1514
- @worksheet.get_column_border_top(11).should be_nil
1515
- end
1516
- end
1517
-
1518
- describe '.get_column_border_left' do
1519
- it 'should return nil if no border is specified for that column in that direction' do
1520
- @worksheet.get_column_border_left(0).should be_nil
1521
- end
1522
-
1523
- it 'should return type of border that this column has on left' do
1524
- @worksheet.change_column_border_left(0,'thin')
1525
- @worksheet.get_column_border_left(0).should == 'thin'
1526
- end
1527
-
1528
- it 'should cause error if a negative argument is passed in' do
1529
- lambda {
1530
- @worksheet.get_column_border_left(-1)
1531
- }.should raise_error
1532
- end
1533
-
1534
- it 'should return nil if a column which does not exist is passed in' do
1535
- @worksheet.get_column_border_left(11).should be_nil
1536
- end
1537
- end
1538
-
1539
- describe '.get_column_border_right' do
1540
- it 'should return nil if no border is specified for that column in that direction' do
1541
- @worksheet.get_column_border_right(0).should be_nil
1542
- end
1543
-
1544
- it 'should return type of border that this column has on right' do
1545
- @worksheet.change_column_border_right(0,'thin')
1546
- @worksheet.get_column_border_right(0).should == 'thin'
1547
- end
1548
-
1549
- it 'should cause error if a negative argument is passed in' do
1550
- lambda {
1551
- @worksheet.get_column_border_right(-1)
1552
- }.should raise_error
1553
- end
1554
-
1555
- it 'should return nil if a column which does not exist is passed in' do
1556
- @worksheet.get_column_border_right(11).should be_nil
1557
- end
1558
- end
1559
-
1560
- describe '.get_column_border_bottom' do
1561
- it 'should return nil if no border is specified for that column in that direction' do
1562
- @worksheet.get_column_border_bottom(0).should be_nil
1563
- end
1564
-
1565
- it 'should return type of border that this column has on bottom' do
1566
- @worksheet.change_column_border_bottom(0,'thin')
1567
- @worksheet.get_column_border_bottom(0).should == 'thin'
1568
- end
1569
-
1570
- it 'should cause error if a negative argument is passed in' do
1571
- lambda {
1572
- @worksheet.get_column_border_bottom(-1)
1573
- }.should raise_error
1574
- end
1575
-
1576
- it 'should return nil if a column which does not exist is passed in' do
1577
- @worksheet.get_column_border_bottom(11).should be_nil
1578
- end
1579
- end
1580
-
1581
- describe '.get_column_border_diagonal' do
1582
- it 'should return nil if no border is specified for that column in that direction' do
1583
- @worksheet.get_column_border_diagonal(0).should be_nil
1584
- end
1585
-
1586
- it 'should return type of border that this column has on diagonal' do
1587
- @worksheet.change_column_border_diagonal(0,'thin')
1588
- @worksheet.get_column_border_diagonal(0).should == 'thin'
1589
- end
1590
-
1591
- it 'should cause error if a negative argument is passed in' do
1592
- lambda {
1593
- @worksheet.get_column_border_diagonal(-1)
1594
- }.should raise_error
1595
- end
1596
-
1597
- it 'should return nil if a column which does not exist is passed in' do
1598
- @worksheet.get_column_border_diagonal(11).should be_nil
1599
- end
1600
- end
1319
+ it 'should correctly reflect font size for column' do
1320
+ @worksheet.change_column_font_size(0,30)
1321
+ expect(@worksheet.get_column_font_size(0)).to eq(30)
1322
+ end
1323
+
1324
+ it 'should cause error if a negative argument is passed in' do
1325
+ expect {
1326
+ @worksheet.get_column_font_size(-1)
1327
+ }.to raise_error
1328
+ end
1329
+
1330
+ it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1331
+ expect(@worksheet.get_column_font_size(11)).to be_nil
1332
+ end
1333
+ end
1334
+
1335
+ describe '.get_column_font_color' do
1336
+ it 'should correctly reflect font color for column' do
1337
+ @worksheet.change_column_font_color(0,'0f0f0f')
1338
+ expect(@worksheet.get_column_font_color(0)).to eq('0f0f0f')
1339
+ end
1340
+
1341
+ it 'should cause error if a negative argument is passed in' do
1342
+ expect {
1343
+ @worksheet.get_column_font_color(-1)
1344
+ }.to raise_error
1345
+ end
1346
+
1347
+ it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1348
+ expect(@worksheet.get_column_font_color(11)).to be_nil
1349
+ end
1350
+
1351
+ it 'should return black (000000) if no rgb font color is specified' do
1352
+ expect(@worksheet.get_column_font_color(0)).to eq('000000')
1353
+ end
1354
+ end
1355
+
1356
+ describe '.is_column_italicized' do
1357
+ it 'should correctly return whether column is italicized' do
1358
+ @worksheet.change_column_italics(0, true)
1359
+ expect(@worksheet.is_column_italicized(0)).to eq(true)
1360
+ end
1361
+
1362
+ it 'should cause error if a negative argument is passed in' do
1363
+ expect {
1364
+ @worksheet.is_column_italicized(-1)
1365
+ }.to raise_error
1366
+ end
1367
+
1368
+ it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1369
+ expect(@worksheet.is_column_italicized(11)).to be_nil
1370
+ end
1371
+ end
1372
+
1373
+ describe '.is_column_bolded' do
1374
+ it 'should correctly return whether column is bolded' do
1375
+ @worksheet.change_column_bold(0, true)
1376
+ expect(@worksheet.is_column_bolded(0)).to eq(true)
1377
+ end
1378
+
1379
+ it 'should cause error if a negative argument is passed in' do
1380
+ expect {
1381
+ @worksheet.is_column_bolded(-1)
1382
+ }.to raise_error
1383
+ end
1384
+
1385
+ it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1386
+ expect(@worksheet.is_column_bolded(11)).to be_nil
1387
+ end
1388
+ end
1389
+
1390
+ describe '.is_column_underlined' do
1391
+ it 'should correctly return whether column is underlined' do
1392
+ @worksheet.change_column_underline(0, true)
1393
+ expect(@worksheet.is_column_underlined(0)).to eq(true)
1394
+ end
1395
+
1396
+ it 'should cause error if a negative argument is passed in' do
1397
+ expect {
1398
+ @worksheet.is_column_underlined(-1)
1399
+ }.to raise_error
1400
+ end
1401
+
1402
+ it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1403
+ expect(@worksheet.is_column_underlined(11)).to be_nil
1404
+ end
1405
+ end
1406
+
1407
+ describe '.is_column_struckthrough' do
1408
+ it 'should correctly return whether column is struckthrough' do
1409
+ @worksheet.change_column_strikethrough(0, true)
1410
+ expect(@worksheet.is_column_struckthrough(0)).to eq(true)
1411
+ end
1412
+
1413
+ it 'should cause error if a negative argument is passed in' do
1414
+ expect {
1415
+ @worksheet.is_column_struckthrough(-1)
1416
+ }.to raise_error
1417
+ end
1418
+
1419
+ it 'should return nil if a (nonnegative) column which does not exist is passed in' do
1420
+ expect(@worksheet.is_column_struckthrough(11)).to be_nil
1421
+ end
1422
+ end
1423
+
1424
+ describe '.get_column_width_raw' do
1425
+ it 'should return nil if no width specified for column' do
1426
+ expect(@worksheet.get_column_width_raw(0)).to be_nil
1427
+ end
1428
+
1429
+ it 'should correctly reflect width if specified for column' do
1430
+ @worksheet.change_column_width_raw(0, 30.123)
1431
+ expect(@worksheet.get_column_width_raw(0)).to eq(30.123)
1432
+ end
1433
+
1434
+ it 'should return nil for a column that does not exist' do
1435
+ expect(@worksheet.get_column_width_raw(11)).to be_nil
1436
+ end
1437
+
1438
+ it 'should cause error if a negative argument is passed in' do
1439
+ expect {
1440
+ @worksheet.get_column_width_raw(-1)
1441
+ }.to raise_error
1442
+ end
1443
+ end
1444
+
1445
+ describe '.get_column_width' do
1446
+ it 'should return default width if no width specified for column' do
1447
+ expect(@worksheet.get_column_width(0)).to eq(RubyXL::ColumnRange::DEFAULT_WIDTH)
1448
+ end
1449
+
1450
+ it 'should correctly reflect width if specified for column' do
1451
+ @worksheet.change_column_width(0, 15)
1452
+ expect(@worksheet.get_column_width(0)).to eq(15)
1453
+ end
1454
+
1455
+ it 'should return default width for a column that does not exist' do
1456
+ expect(@worksheet.get_column_width(11)).to eq(RubyXL::ColumnRange::DEFAULT_WIDTH)
1457
+ end
1458
+
1459
+ it 'should cause error if a negative argument is passed in' do
1460
+ expect {
1461
+ @worksheet.get_column_width(-1)
1462
+ }.to raise_error
1463
+ end
1464
+ end
1465
+
1466
+ describe '.get_column_fill' do
1467
+ it 'should return white (ffffff) if no fill color specified for column' do
1468
+ expect(@worksheet.get_column_fill(0)).to eq('ffffff')
1469
+ end
1470
+
1471
+ it 'should correctly reflect fill color if specified for column' do
1472
+ @worksheet.change_column_fill(0, '000000')
1473
+ expect(@worksheet.get_column_fill(0)).to eq('000000')
1474
+ end
1475
+
1476
+ it 'should return nil if a column which does not exist is passed in' do
1477
+ expect(@worksheet.get_column_fill(11)).to be_nil
1478
+ end
1479
+
1480
+ it 'should cause error if a negative argument is passed in' do
1481
+ expect {
1482
+ @worksheet.get_column_fill(-1)
1483
+ }.to raise_error
1484
+ end
1485
+ end
1486
+
1487
+ describe '.get_column_horizontal_alignment' do
1488
+ it 'should return nil if no alignment specified for column' do
1489
+ expect(@worksheet.get_column_horizontal_alignment(0)).to be_nil
1490
+ end
1491
+
1492
+ it 'should return nil if a column which does not exist is passed in' do
1493
+ expect(@worksheet.get_column_horizontal_alignment(11)).to be_nil
1494
+ end
1495
+
1496
+ it 'should cause error if a negative argument is passed in' do
1497
+ expect {
1498
+ @worksheet.get_column_horizontal_alignment(-1)
1499
+ }.to raise_error
1500
+ end
1501
+
1502
+ it 'should return correct horizontal alignment if it is set for that column' do
1503
+ @worksheet.change_column_horizontal_alignment(0, 'center')
1504
+ expect(@worksheet.get_column_horizontal_alignment(0)).to eq('center')
1505
+ end
1506
+ end
1507
+
1508
+ describe '.get_column_vertical_alignment' do
1509
+ it 'should return nil if no alignment specified for column' do
1510
+ expect(@worksheet.get_column_vertical_alignment(0)).to be_nil
1511
+ end
1512
+
1513
+ it 'should return nil if a column which does not exist is passed in' do
1514
+ expect(@worksheet.get_column_vertical_alignment(11)).to be_nil
1515
+ end
1516
+
1517
+ it 'should cause error if a negative argument is passed in' do
1518
+ expect {
1519
+ @worksheet.get_column_vertical_alignment(-1)
1520
+ }.to raise_error
1521
+ end
1522
+
1523
+ it 'should return correct vertical alignment if it is set for that column' do
1524
+ @worksheet.change_column_vertical_alignment(0, 'center')
1525
+ expect(@worksheet.get_column_vertical_alignment(0)).to eq('center')
1526
+ end
1527
+ end
1528
+
1529
+ describe '.get_column_border_top' do
1530
+ it 'should return nil if no border is specified for that column in that direction' do
1531
+ expect(@worksheet.get_column_border_top(0)).to be_nil
1532
+ end
1533
+
1534
+ it 'should return type of border that this column has on top' do
1535
+ @worksheet.change_column_border_top(0,'thin')
1536
+ expect(@worksheet.get_column_border_top(0)).to eq('thin')
1537
+ end
1538
+
1539
+ it 'should cause error if a negative argument is passed in' do
1540
+ expect {
1541
+ @worksheet.get_column_border_top(-1)
1542
+ }.to raise_error
1543
+ end
1544
+
1545
+ it 'should return nil if a column which does not exist is passed in' do
1546
+ expect(@worksheet.get_column_border_top(11)).to be_nil
1547
+ end
1548
+ end
1549
+
1550
+ describe '.get_column_border_left' do
1551
+ it 'should return nil if no border is specified for that column in that direction' do
1552
+ expect(@worksheet.get_column_border_left(0)).to be_nil
1553
+ end
1554
+
1555
+ it 'should return type of border that this column has on left' do
1556
+ @worksheet.change_column_border_left(0,'thin')
1557
+ expect(@worksheet.get_column_border_left(0)).to eq('thin')
1558
+ end
1559
+
1560
+ it 'should cause error if a negative argument is passed in' do
1561
+ expect {
1562
+ @worksheet.get_column_border_left(-1)
1563
+ }.to raise_error
1564
+ end
1565
+
1566
+ it 'should return nil if a column which does not exist is passed in' do
1567
+ expect(@worksheet.get_column_border_left(11)).to be_nil
1568
+ end
1569
+ end
1570
+
1571
+ describe '.get_column_border_right' do
1572
+ it 'should return nil if no border is specified for that column in that direction' do
1573
+ expect(@worksheet.get_column_border_right(0)).to be_nil
1574
+ end
1575
+
1576
+ it 'should return type of border that this column has on right' do
1577
+ @worksheet.change_column_border_right(0,'thin')
1578
+ expect(@worksheet.get_column_border_right(0)).to eq('thin')
1579
+ end
1580
+
1581
+ it 'should cause error if a negative argument is passed in' do
1582
+ expect {
1583
+ @worksheet.get_column_border_right(-1)
1584
+ }.to raise_error
1585
+ end
1586
+
1587
+ it 'should return nil if a column which does not exist is passed in' do
1588
+ expect(@worksheet.get_column_border_right(11)).to be_nil
1589
+ end
1590
+ end
1591
+
1592
+ describe '.get_column_border_bottom' do
1593
+ it 'should return nil if no border is specified for that column in that direction' do
1594
+ expect(@worksheet.get_column_border_bottom(0)).to be_nil
1595
+ end
1596
+
1597
+ it 'should return type of border that this column has on bottom' do
1598
+ @worksheet.change_column_border_bottom(0,'thin')
1599
+ expect(@worksheet.get_column_border_bottom(0)).to eq('thin')
1600
+ end
1601
+
1602
+ it 'should cause error if a negative argument is passed in' do
1603
+ expect {
1604
+ @worksheet.get_column_border_bottom(-1)
1605
+ }.to raise_error
1606
+ end
1607
+
1608
+ it 'should return nil if a column which does not exist is passed in' do
1609
+ expect(@worksheet.get_column_border_bottom(11)).to be_nil
1610
+ end
1611
+ end
1612
+
1613
+ describe '.get_column_border_diagonal' do
1614
+ it 'should return nil if no border is specified for that column in that direction' do
1615
+ expect(@worksheet.get_column_border_diagonal(0)).to be_nil
1616
+ end
1617
+
1618
+ it 'should return type of border that this column has on diagonal' do
1619
+ @worksheet.change_column_border_diagonal(0,'thin')
1620
+ expect(@worksheet.get_column_border_diagonal(0)).to eq('thin')
1621
+ end
1622
+
1623
+ it 'should cause error if a negative argument is passed in' do
1624
+ expect {
1625
+ @worksheet.get_column_border_diagonal(-1)
1626
+ }.to raise_error
1627
+ end
1628
+
1629
+ it 'should return nil if a column which does not exist is passed in' do
1630
+ expect(@worksheet.get_column_border_diagonal(11)).to be_nil
1631
+ end
1632
+ end
1601
1633
 
1602
1634
 
1603
1635
  describe '@column_range' do
1604
1636
  it 'should properly handle range addition and modification' do
1605
1637
  # Ranges should be empty for brand new worskeet
1606
- @worksheet.cols.column_ranges.size.should == 0
1638
+ expect(@worksheet.cols.column_ranges.size).to eq(0)
1607
1639
 
1608
1640
  # Range should be created if the column has not been touched before
1609
1641
  @worksheet.change_column_width(0, 30)
1610
- @worksheet.get_column_width(0).should == 30
1611
- @worksheet.cols.column_ranges.size.should == 1
1642
+ expect(@worksheet.get_column_width(0)).to eq(30)
1643
+ expect(@worksheet.cols.column_ranges.size).to eq(1)
1612
1644
 
1613
1645
  # Range should be reused if the column has not been touched before
1614
1646
  @worksheet.change_column_width(0, 20)
1615
- @worksheet.get_column_width(0).should == 20
1616
- @worksheet.cols.column_ranges.size.should == 1
1647
+ expect(@worksheet.get_column_width(0)).to eq(20)
1648
+ expect(@worksheet.cols.column_ranges.size).to eq(1)
1617
1649
 
1618
1650
  # Creation of the new range should not affect previously changed columns
1619
1651
  @worksheet.change_column_width(1, 999)
1620
- @worksheet.get_column_width(1).should == 999
1621
- @worksheet.get_column_width(0).should == 20
1622
- @worksheet.cols.column_ranges.size.should == 2
1652
+ expect(@worksheet.get_column_width(1)).to eq(999)
1653
+ expect(@worksheet.get_column_width(0)).to eq(20)
1654
+ expect(@worksheet.cols.column_ranges.size).to eq(2)
1623
1655
  end
1624
1656
 
1625
1657
  end