rubyXL 2.5.4 → 2.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/VERSION +1 -1
- data/lib/rubyXL/worksheet.rb +39 -38
- data/rdoc/README_rdoc.html +1 -1
- data/rdoc/RubyXL.html +1 -1
- data/rdoc/RubyXL/AExtension.html +1 -1
- data/rdoc/RubyXL/AExtensionStorageArea.html +1 -1
- data/rdoc/RubyXL/AdjustHandleList.html +1 -1
- data/rdoc/RubyXL/Alignment.html +1 -1
- data/rdoc/RubyXL/AlternateContent.html +1 -1
- data/rdoc/RubyXL/AutoFilter.html +1 -1
- data/rdoc/RubyXL/AutoFilterColumn.html +1 -1
- data/rdoc/RubyXL/BodyProperties.html +1 -1
- data/rdoc/RubyXL/BooleanNode.html +1 -1
- data/rdoc/RubyXL/BooleanValue.html +1 -1
- data/rdoc/RubyXL/Border.html +1 -1
- data/rdoc/RubyXL/BorderEdge.html +1 -1
- data/rdoc/RubyXL/Borders.html +1 -1
- data/rdoc/RubyXL/Break.html +1 -1
- data/rdoc/RubyXL/BreakList.html +1 -1
- data/rdoc/RubyXL/CT_AdjPoint2D.html +1 -1
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +1 -1
- data/rdoc/RubyXL/CT_Backdrop.html +1 -1
- data/rdoc/RubyXL/CT_Bevel.html +1 -1
- data/rdoc/RubyXL/CT_BiLevelEffect.html +1 -1
- data/rdoc/RubyXL/CT_BlendEffect.html +1 -1
- data/rdoc/RubyXL/CT_Blip.html +1 -1
- data/rdoc/RubyXL/CT_BlipFillProperties.html +1 -1
- data/rdoc/RubyXL/CT_BlurEffect.html +1 -1
- data/rdoc/RubyXL/CT_Camera.html +1 -1
- data/rdoc/RubyXL/CT_Color.html +1 -1
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +1 -1
- data/rdoc/RubyXL/CT_ColorMapping.html +1 -1
- data/rdoc/RubyXL/CT_ColorScheme.html +1 -1
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +1 -1
- data/rdoc/RubyXL/CT_ConnectionSite.html +1 -1
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +1 -1
- data/rdoc/RubyXL/CT_DashStop.html +1 -1
- data/rdoc/RubyXL/CT_DashStopList.html +1 -1
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +1 -1
- data/rdoc/RubyXL/CT_DuotoneEffect.html +1 -1
- data/rdoc/RubyXL/CT_EffectContainer.html +1 -1
- data/rdoc/RubyXL/CT_EffectList.html +1 -1
- data/rdoc/RubyXL/CT_EffectReference.html +1 -1
- data/rdoc/RubyXL/CT_EffectStyleItem.html +1 -1
- data/rdoc/RubyXL/CT_EffectStyleList.html +1 -1
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +1 -1
- data/rdoc/RubyXL/CT_FillEffect.html +1 -1
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +1 -1
- data/rdoc/RubyXL/CT_FillStyleList.html +1 -1
- data/rdoc/RubyXL/CT_FlatText.html +1 -1
- data/rdoc/RubyXL/CT_FontCollection.html +1 -1
- data/rdoc/RubyXL/CT_FontReference.html +1 -1
- data/rdoc/RubyXL/CT_GeomGuideList.html +1 -1
- data/rdoc/RubyXL/CT_GlowEffect.html +1 -1
- data/rdoc/RubyXL/CT_GradientFillProperties.html +1 -1
- data/rdoc/RubyXL/CT_GradientStop.html +1 -1
- data/rdoc/RubyXL/CT_GradientStopList.html +1 -1
- data/rdoc/RubyXL/CT_HSLEffect.html +1 -1
- data/rdoc/RubyXL/CT_HslColor.html +1 -1
- data/rdoc/RubyXL/CT_Hyperlink.html +1 -1
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +1 -1
- data/rdoc/RubyXL/CT_LightRig.html +1 -1
- data/rdoc/RubyXL/CT_LineEndProperties.html +1 -1
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +1 -1
- data/rdoc/RubyXL/CT_LineProperties.html +1 -1
- data/rdoc/RubyXL/CT_LineStyleList.html +1 -1
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +1 -1
- data/rdoc/RubyXL/CT_LuminanceEffect.html +1 -1
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +1 -1
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +1 -1
- data/rdoc/RubyXL/CT_Path2D.html +1 -1
- data/rdoc/RubyXL/CT_Path2DArcTo.html +1 -1
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +1 -1
- data/rdoc/RubyXL/CT_Path2DList.html +1 -1
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +1 -1
- data/rdoc/RubyXL/CT_Path2DTo.html +1 -1
- data/rdoc/RubyXL/CT_PathShadeProperties.html +1 -1
- data/rdoc/RubyXL/CT_PatternFillProperties.html +1 -1
- data/rdoc/RubyXL/CT_Point3D.html +1 -1
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +1 -1
- data/rdoc/RubyXL/CT_PresetColor.html +1 -1
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +1 -1
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +1 -1
- data/rdoc/RubyXL/CT_PresetTextShape.html +1 -1
- data/rdoc/RubyXL/CT_ReflectionEffect.html +1 -1
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +1 -1
- data/rdoc/RubyXL/CT_RelativeRect.html +1 -1
- data/rdoc/RubyXL/CT_SRgbColor.html +1 -1
- data/rdoc/RubyXL/CT_ScRgbColor.html +1 -1
- data/rdoc/RubyXL/CT_Scene3D.html +1 -1
- data/rdoc/RubyXL/CT_SchemeColor.html +1 -1
- data/rdoc/RubyXL/CT_Shape3D.html +1 -1
- data/rdoc/RubyXL/CT_ShapeStyle.html +1 -1
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +1 -1
- data/rdoc/RubyXL/CT_SphereCoords.html +1 -1
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +1 -1
- data/rdoc/RubyXL/CT_StyleMatrix.html +1 -1
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +1 -1
- data/rdoc/RubyXL/CT_SupplementalFont.html +1 -1
- data/rdoc/RubyXL/CT_SystemColor.html +1 -1
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +1 -1
- data/rdoc/RubyXL/CT_TextBlipBullet.html +1 -1
- data/rdoc/RubyXL/CT_TextCharBullet.html +1 -1
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +1 -1
- data/rdoc/RubyXL/CT_TextFont.html +1 -1
- data/rdoc/RubyXL/CT_TextListStyle.html +1 -1
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +1 -1
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +1 -1
- data/rdoc/RubyXL/CT_TextSpacing.html +1 -1
- data/rdoc/RubyXL/CT_TextTabStop.html +1 -1
- data/rdoc/RubyXL/CT_TextTabStopList.html +1 -1
- data/rdoc/RubyXL/CT_TileInfoProperties.html +1 -1
- data/rdoc/RubyXL/CT_TintEffect.html +1 -1
- data/rdoc/RubyXL/CT_Transform2D.html +1 -1
- data/rdoc/RubyXL/CT_TransformEffect.html +1 -1
- data/rdoc/RubyXL/CT_Vector3D.html +1 -1
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +1 -1
- data/rdoc/RubyXL/CalculationChain.html +1 -1
- data/rdoc/RubyXL/CalculationChainCell.html +1 -1
- data/rdoc/RubyXL/CalculationProperties.html +1 -1
- data/rdoc/RubyXL/Cell.html +1 -1
- data/rdoc/RubyXL/CellSmartTag.html +1 -1
- data/rdoc/RubyXL/CellSmartTagProperty.html +1 -1
- data/rdoc/RubyXL/CellSmartTags.html +1 -1
- data/rdoc/RubyXL/CellStyle.html +1 -1
- data/rdoc/RubyXL/CellStyleXFs.html +1 -1
- data/rdoc/RubyXL/CellStyles.html +1 -1
- data/rdoc/RubyXL/CellValue.html +1 -1
- data/rdoc/RubyXL/CellWatch.html +1 -1
- data/rdoc/RubyXL/CellWatches.html +1 -1
- data/rdoc/RubyXL/CellXFs.html +1 -1
- data/rdoc/RubyXL/Chartsheet.html +1 -1
- data/rdoc/RubyXL/ChartsheetPageSetup.html +1 -1
- data/rdoc/RubyXL/ChartsheetProperties.html +1 -1
- data/rdoc/RubyXL/ChartsheetProtection.html +1 -1
- data/rdoc/RubyXL/ChartsheetView.html +1 -1
- data/rdoc/RubyXL/ChartsheetViews.html +1 -1
- data/rdoc/RubyXL/Color.html +1 -1
- data/rdoc/RubyXL/ColorFilter.html +1 -1
- data/rdoc/RubyXL/ColorScale.html +1 -1
- data/rdoc/RubyXL/ColorSet.html +1 -1
- data/rdoc/RubyXL/Colors.html +1 -1
- data/rdoc/RubyXL/ColumnRange.html +1 -1
- data/rdoc/RubyXL/ColumnRanges.html +1 -1
- data/rdoc/RubyXL/ConditionalFormatValue.html +1 -1
- data/rdoc/RubyXL/ConditionalFormatting.html +1 -1
- data/rdoc/RubyXL/ConditionalFormattingRule.html +1 -1
- data/rdoc/RubyXL/ContentTypeDefault.html +1 -1
- data/rdoc/RubyXL/ContentTypeOverride.html +1 -1
- data/rdoc/RubyXL/ContentTypes.html +1 -1
- data/rdoc/RubyXL/CoreProperties.html +1 -1
- data/rdoc/RubyXL/CustomColor.html +1 -1
- data/rdoc/RubyXL/CustomColorList.html +1 -1
- data/rdoc/RubyXL/CustomFilter.html +1 -1
- data/rdoc/RubyXL/CustomFilters.html +1 -1
- data/rdoc/RubyXL/CustomGeometry.html +1 -1
- data/rdoc/RubyXL/CustomProperties.html +1 -1
- data/rdoc/RubyXL/CustomProperty.html +1 -1
- data/rdoc/RubyXL/CustomSheetView.html +1 -1
- data/rdoc/RubyXL/CustomSheetViews.html +1 -1
- data/rdoc/RubyXL/CustomWorkbookView.html +1 -1
- data/rdoc/RubyXL/CustomWorkbookViews.html +1 -1
- data/rdoc/RubyXL/DXF.html +1 -1
- data/rdoc/RubyXL/DXFs.html +1 -1
- data/rdoc/RubyXL/DataBar.html +1 -1
- data/rdoc/RubyXL/DataConsolidate.html +1 -1
- data/rdoc/RubyXL/DataConsolidationReference.html +1 -1
- data/rdoc/RubyXL/DataConsolidationReferences.html +1 -1
- data/rdoc/RubyXL/DataType.html +1 -1
- data/rdoc/RubyXL/DataValidation.html +1 -1
- data/rdoc/RubyXL/DataValidations.html +1 -1
- data/rdoc/RubyXL/DateGroupItem.html +1 -1
- data/rdoc/RubyXL/DefinedName.html +1 -1
- data/rdoc/RubyXL/DefinedNames.html +1 -1
- data/rdoc/RubyXL/DocumentProperties.html +1 -1
- data/rdoc/RubyXL/DynamicFilter.html +1 -1
- data/rdoc/RubyXL/EmbeddedControl.html +1 -1
- data/rdoc/RubyXL/EmbeddedControls.html +1 -1
- data/rdoc/RubyXL/Extension.html +1 -1
- data/rdoc/RubyXL/ExtensionStorageArea.html +1 -1
- data/rdoc/RubyXL/Extents.html +1 -1
- data/rdoc/RubyXL/ExternalReference.html +1 -1
- data/rdoc/RubyXL/ExternalReferences.html +1 -1
- data/rdoc/RubyXL/ExtraColorSchemeList.html +1 -1
- data/rdoc/RubyXL/FieldItem.html +1 -1
- data/rdoc/RubyXL/FileRecoveryProperties.html +1 -1
- data/rdoc/RubyXL/FileSharing.html +1 -1
- data/rdoc/RubyXL/FileVersion.html +1 -1
- data/rdoc/RubyXL/Fill.html +1 -1
- data/rdoc/RubyXL/Fills.html +1 -1
- data/rdoc/RubyXL/FilterContainer.html +1 -1
- data/rdoc/RubyXL/FloatNode.html +1 -1
- data/rdoc/RubyXL/FloatValue.html +1 -1
- data/rdoc/RubyXL/Font.html +1 -1
- data/rdoc/RubyXL/FontScheme.html +1 -1
- data/rdoc/RubyXL/Fonts.html +1 -1
- data/rdoc/RubyXL/Formula.html +1 -1
- data/rdoc/RubyXL/FunctionGroup.html +1 -1
- data/rdoc/RubyXL/FunctionGroups.html +1 -1
- data/rdoc/RubyXL/GenericStorage.html +1 -1
- data/rdoc/RubyXL/GradientFill.html +1 -1
- data/rdoc/RubyXL/HeaderFooterSettings.html +1 -1
- data/rdoc/RubyXL/Hyperlink.html +1 -1
- data/rdoc/RubyXL/Hyperlinks.html +1 -1
- data/rdoc/RubyXL/IconFilter.html +1 -1
- data/rdoc/RubyXL/IconSet.html +1 -1
- data/rdoc/RubyXL/IgnoredError.html +1 -1
- data/rdoc/RubyXL/IgnoredErrors.html +1 -1
- data/rdoc/RubyXL/IndexedColors.html +1 -1
- data/rdoc/RubyXL/InputCells.html +1 -1
- data/rdoc/RubyXL/IntegerNode.html +1 -1
- data/rdoc/RubyXL/IntegerValue.html +1 -1
- data/rdoc/RubyXL/LegacyCell.html +1 -1
- data/rdoc/RubyXL/LegacyWorkbook.html +1 -1
- data/rdoc/RubyXL/LegacyWorksheet.html +54 -54
- data/rdoc/RubyXL/MRUColors.html +1 -1
- data/rdoc/RubyXL/MergedCell.html +1 -1
- data/rdoc/RubyXL/MergedCells.html +1 -1
- data/rdoc/RubyXL/NumFmt.html +1 -1
- data/rdoc/RubyXL/NumberFormat.html +1 -1
- data/rdoc/RubyXL/NumberFormats.html +1 -1
- data/rdoc/RubyXL/OLEObject.html +1 -1
- data/rdoc/RubyXL/OLEObjects.html +1 -1
- data/rdoc/RubyXL/OLESize.html +1 -1
- data/rdoc/RubyXL/OOXMLContainerObject.html +1 -1
- data/rdoc/RubyXL/OOXMLObject.html +1 -1
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +1 -1
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +1 -1
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +1 -1
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +1 -1
- data/rdoc/RubyXL/Offset.html +1 -1
- data/rdoc/RubyXL/OutlineProperties.html +1 -1
- data/rdoc/RubyXL/PageMargins.html +1 -1
- data/rdoc/RubyXL/PageSetup.html +1 -1
- data/rdoc/RubyXL/PageSetupProperties.html +1 -1
- data/rdoc/RubyXL/Pane.html +1 -1
- data/rdoc/RubyXL/Parser.html +1 -1
- data/rdoc/RubyXL/PatternFill.html +1 -1
- data/rdoc/RubyXL/PhoneticProperties.html +1 -1
- data/rdoc/RubyXL/PhoneticRun.html +1 -1
- data/rdoc/RubyXL/PivotArea.html +1 -1
- data/rdoc/RubyXL/PivotCache.html +1 -1
- data/rdoc/RubyXL/PivotCaches.html +1 -1
- data/rdoc/RubyXL/PivotReference.html +1 -1
- data/rdoc/RubyXL/PivotReferences.html +1 -1
- data/rdoc/RubyXL/PivotTableSelection.html +1 -1
- data/rdoc/RubyXL/PresetGeometry.html +1 -1
- data/rdoc/RubyXL/PrintOptions.html +1 -1
- data/rdoc/RubyXL/ProtectedRange.html +1 -1
- data/rdoc/RubyXL/ProtectedRanges.html +1 -1
- data/rdoc/RubyXL/Protection.html +1 -1
- data/rdoc/RubyXL/RID.html +1 -1
- data/rdoc/RubyXL/RawOOXML.html +1 -1
- data/rdoc/RubyXL/Reference.html +1 -1
- data/rdoc/RubyXL/Relationship.html +1 -1
- data/rdoc/RubyXL/RichText.html +1 -1
- data/rdoc/RubyXL/RichTextRun.html +1 -1
- data/rdoc/RubyXL/RootRelationships.html +1 -1
- data/rdoc/RubyXL/Row.html +1 -1
- data/rdoc/RubyXL/RunProperties.html +1 -1
- data/rdoc/RubyXL/Scenario.html +1 -1
- data/rdoc/RubyXL/Scenarios.html +1 -1
- data/rdoc/RubyXL/Selection.html +1 -1
- data/rdoc/RubyXL/ShapeGuide.html +1 -1
- data/rdoc/RubyXL/ShapeTextRectangle.html +1 -1
- data/rdoc/RubyXL/SharedStringsTable.html +1 -1
- data/rdoc/RubyXL/Sheet.html +1 -1
- data/rdoc/RubyXL/SheetCalculationProperties.html +1 -1
- data/rdoc/RubyXL/SheetData.html +1 -1
- data/rdoc/RubyXL/Sheets.html +1 -1
- data/rdoc/RubyXL/SmartTagProperties.html +1 -1
- data/rdoc/RubyXL/SmartTagType.html +1 -1
- data/rdoc/RubyXL/SmartTagTypes.html +1 -1
- data/rdoc/RubyXL/SmartTags.html +1 -1
- data/rdoc/RubyXL/SortCondition.html +1 -1
- data/rdoc/RubyXL/SortState.html +1 -1
- data/rdoc/RubyXL/Sqref.html +1 -1
- data/rdoc/RubyXL/Stop.html +1 -1
- data/rdoc/RubyXL/StringNode.html +1 -1
- data/rdoc/RubyXL/StringNodeW3C.html +1 -1
- data/rdoc/RubyXL/StringValue.html +1 -1
- data/rdoc/RubyXL/Stylesheet.html +1 -1
- data/rdoc/RubyXL/TableParts.html +1 -1
- data/rdoc/RubyXL/TableStyle.html +1 -1
- data/rdoc/RubyXL/TableStyles.html +1 -1
- data/rdoc/RubyXL/Text.html +1 -1
- data/rdoc/RubyXL/Theme.html +1 -1
- data/rdoc/RubyXL/ThemeElements.html +1 -1
- data/rdoc/RubyXL/Top10.html +1 -1
- data/rdoc/RubyXL/Variant.html +1 -1
- data/rdoc/RubyXL/Vector.html +1 -1
- data/rdoc/RubyXL/VectorValue.html +1 -1
- data/rdoc/RubyXL/VisualProperties.html +1 -1
- data/rdoc/RubyXL/WebPublishObject.html +1 -1
- data/rdoc/RubyXL/WebPublishObjects.html +1 -1
- data/rdoc/RubyXL/WebPublishingItem.html +1 -1
- data/rdoc/RubyXL/WebPublishingItems.html +1 -1
- data/rdoc/RubyXL/WebPublishingProperties.html +1 -1
- data/rdoc/RubyXL/Workbook.html +1 -1
- data/rdoc/RubyXL/WorkbookProperties.html +1 -1
- data/rdoc/RubyXL/WorkbookProtection.html +1 -1
- data/rdoc/RubyXL/WorkbookRelationships.html +1 -1
- data/rdoc/RubyXL/WorkbookView.html +1 -1
- data/rdoc/RubyXL/WorkbookViews.html +1 -1
- data/rdoc/RubyXL/Worksheet.html +1 -1
- data/rdoc/RubyXL/WorksheetDimensions.html +1 -1
- data/rdoc/RubyXL/WorksheetFormatProperties.html +1 -1
- data/rdoc/RubyXL/WorksheetProperties.html +1 -1
- data/rdoc/RubyXL/WorksheetProtection.html +1 -1
- data/rdoc/RubyXL/WorksheetView.html +1 -1
- data/rdoc/RubyXL/WorksheetViews.html +1 -1
- data/rdoc/RubyXL/XF.html +1 -1
- data/rdoc/created.rid +2 -2
- data/rdoc/index.html +2 -2
- data/rdoc/js/search_index.js +1 -1
- data/rdoc/table_of_contents.html +2 -2
- data/rubyXL.gemspec +2 -6
- data/spec/lib/cell_spec.rb +67 -67
- data/spec/lib/color_spec.rb +2 -2
- data/spec/lib/parser_spec.rb +20 -20
- data/spec/lib/reference_spec.rb +10 -10
- data/spec/lib/stylesheet_spec.rb +6 -6
- data/spec/lib/workbook_spec.rb +11 -10
- data/spec/lib/worksheet_spec.rb +744 -712
- metadata +1 -16
- data/Gemfile.lock +0 -94
data/spec/lib/color_spec.rb
CHANGED
@@ -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').
|
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
|
-
|
11
|
+
expect {RubyXL::Color.validate_color('#G')}.to raise_error
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/spec/lib/parser_spec.rb
CHANGED
@@ -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.
|
51
|
+
expect(@workbook2.worksheets.size).to eq(@workbook.worksheets.size)
|
52
52
|
@workbook2.worksheets.each_index { |i|
|
53
|
-
@workbook2[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
|
-
|
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
|
-
|
66
|
-
|
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.
|
75
|
-
@workbook2[0].extract_data.
|
76
|
-
@workbook2[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.
|
90
|
-
@workbook2["Escape Test"][0][1].value.
|
91
|
-
@workbook2["Escape Test"][0][2].value.
|
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.
|
94
|
-
@workbook2["Escape Test"][1][1].value.
|
95
|
-
@workbook2["Escape Test"][1][2].value.
|
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.
|
101
|
-
@workbook2.modifier.
|
102
|
-
@workbook2.created_at.
|
103
|
-
@workbook2.modified_at.
|
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].
|
109
|
-
@workbook2[@test_sheet_name[0..30]].
|
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
|
data/spec/lib/reference_spec.rb
CHANGED
@@ -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).
|
9
|
-
RubyXL::Reference.ind2ref(99, 0).
|
10
|
-
RubyXL::Reference.ind2ref(0, 26).
|
11
|
-
RubyXL::Reference.ind2ref(0, 51).
|
12
|
-
RubyXL::Reference.ind2ref(0, 52).
|
13
|
-
RubyXL::Reference.ind2ref(0, 77).
|
14
|
-
RubyXL::Reference.ind2ref(0, 78).
|
15
|
-
RubyXL::Reference.ind2ref(0, 16383).
|
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)).
|
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').
|
25
|
+
expect(RubyXL::Reference.ref2ind('A1B')).to eq([-1, -1])
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
data/spec/lib/stylesheet_spec.rb
CHANGED
@@ -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?().
|
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?().
|
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?().
|
17
|
-
RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => 'general').is_date_format?().
|
18
|
-
RubyXL::NumberFormat.new(:num_fmt_id => 1, :format_code => '0.00e+00').is_date_format?().
|
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.
|
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
|
data/spec/lib/workbook_spec.rb
CHANGED
@@ -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].
|
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].
|
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'].
|
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'].
|
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]).
|
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]).
|
53
|
+
expect(@workbook.get_fill_color(@workbook.cell_xfs[@cell.style_index])).to eq('ffffff')
|
53
54
|
end
|
54
55
|
end
|
55
56
|
|
data/spec/lib/worksheet_spec.rb
CHANGED
@@ -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].
|
24
|
-
data.size.
|
25
|
-
data[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').
|
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']).
|
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.
|
43
|
-
table_hash["0:0"].size.
|
44
|
-
table_hash["0:1"].size.
|
45
|
-
table_hash["0:4"].size.
|
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
|
-
|
52
|
-
|
53
|
-
|
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
|
-
|
57
|
+
expect {
|
58
58
|
@worksheet.change_row_fill(3,'#FFF000')
|
59
|
-
}.
|
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).
|
65
|
-
@worksheet[0][5].fill_color.
|
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
|
-
|
69
|
+
expect {
|
70
70
|
@worksheet.change_row_fill(-1,'111111')
|
71
|
-
}.
|
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.
|
75
|
+
expect(@worksheet.sheet_data.size).to eq(11)
|
76
76
|
@worksheet.change_row_fill(11,'111111')
|
77
|
-
@worksheet.get_row_fill(11).
|
78
|
-
@worksheet.sheet_data.size.
|
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).
|
86
|
-
@worksheet[0][5].font_name.
|
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
|
-
|
90
|
+
expect {
|
91
91
|
@worksheet.change_row_font_name(-1,'Arial')
|
92
|
-
}.
|
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.
|
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).
|
99
|
-
@worksheet.sheet_data.size.
|
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).
|
107
|
-
@worksheet[0][5].font_size.
|
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
|
-
|
111
|
+
expect {
|
112
112
|
@worksheet.change_row_font_size(0, '20')
|
113
|
-
}.
|
113
|
+
}.to raise_error
|
114
114
|
end
|
115
115
|
|
116
116
|
it 'should cause error if a negative argument is passed in' do
|
117
|
-
|
117
|
+
expect {
|
118
118
|
@worksheet.change_row_font_size(-1,20)
|
119
|
-
}.
|
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.
|
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).
|
126
|
-
@worksheet.sheet_data.size.
|
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).
|
134
|
-
@worksheet[0][5].font_color.
|
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
|
-
|
139
|
-
|
140
|
-
|
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
|
-
|
144
|
+
expect {
|
145
145
|
@worksheet.change_row_font_color(3,'#FFF000')
|
146
|
-
}.
|
146
|
+
}.to raise_error
|
147
147
|
end
|
148
148
|
|
149
149
|
it 'should cause error if a negative argument is passed in' do
|
150
|
-
|
150
|
+
expect {
|
151
151
|
@worksheet.change_row_font_color(-1,'0f0f0f')
|
152
|
-
}.
|
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.
|
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).
|
159
|
-
@worksheet.sheet_data.size.
|
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).
|
167
|
-
@worksheet[0][5].is_italicized.
|
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
|
-
|
171
|
+
expect {
|
172
172
|
@worksheet.change_row_italics(-1,false)
|
173
|
-
}.
|
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.
|
177
|
+
expect(@worksheet.sheet_data.size).to eq(11)
|
178
178
|
@worksheet.change_row_italics(11,true)
|
179
|
-
@worksheet.is_row_italicized(11).
|
180
|
-
@worksheet.sheet_data.size.
|
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).
|
188
|
-
@worksheet[0][5].is_bolded.
|
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
|
-
|
192
|
+
expect {
|
193
193
|
@worksheet.change_row_bold(-1,false)
|
194
|
-
}.
|
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.
|
198
|
+
expect(@worksheet.sheet_data.size).to eq(11)
|
199
199
|
@worksheet.change_row_bold(11,true)
|
200
|
-
@worksheet.is_row_bolded(11).
|
201
|
-
@worksheet.sheet_data.size.
|
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).
|
209
|
-
@worksheet[0][5].is_underlined.
|
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
|
-
|
213
|
+
expect {
|
214
214
|
@worksheet.change_row_underline(-1,false)
|
215
|
-
}.
|
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.
|
219
|
+
expect(@worksheet.sheet_data.size).to eq(11)
|
220
220
|
@worksheet.change_row_underline(11,true)
|
221
|
-
@worksheet.is_row_underlined(11).
|
222
|
-
@worksheet.sheet_data.size.
|
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).
|
230
|
-
@worksheet[0][5].is_struckthrough.
|
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
|
-
|
234
|
+
expect {
|
235
235
|
@worksheet.change_row_strikethrough(-1,false)
|
236
|
-
}.
|
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.
|
240
|
+
expect(@worksheet.sheet_data.size).to eq(11)
|
241
241
|
@worksheet.change_row_strikethrough(11,true)
|
242
|
-
@worksheet.is_row_struckthrough(11).
|
243
|
-
@worksheet.sheet_data.size.
|
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).
|
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).
|
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
|
-
|
259
|
+
expect {
|
260
260
|
@worksheet.change_row_height(0,'TEST')
|
261
|
-
}.
|
261
|
+
}.to raise_error
|
262
262
|
end
|
263
263
|
|
264
264
|
it 'should cause error if a negative argument is passed in' do
|
265
|
-
|
265
|
+
expect {
|
266
266
|
@worksheet.change_row_height(-1,30)
|
267
|
-
}.
|
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.
|
271
|
+
expect(@worksheet.sheet_data.size).to eq(11)
|
272
272
|
@worksheet.change_row_height(11,30)
|
273
|
-
@worksheet.get_row_height(11).
|
274
|
-
@worksheet.sheet_data.size.
|
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).
|
282
|
-
@worksheet[0][5].horizontal_alignment.
|
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
|
-
|
287
|
+
expect {
|
288
288
|
@worksheet.change_row_horizontal_alignment(-1,'center')
|
289
|
-
}.
|
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.
|
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).
|
296
|
-
@worksheet.sheet_data.size.
|
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).
|
304
|
-
@worksheet[0][5].vertical_alignment.
|
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
|
-
|
308
|
+
expect {
|
309
309
|
@worksheet.change_row_vertical_alignment(-1,'center')
|
310
|
-
}.
|
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.
|
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).
|
317
|
-
@worksheet.sheet_data.size.
|
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).
|
325
|
-
@worksheet[0][5].border_top.
|
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
|
-
|
329
|
+
expect {
|
330
330
|
@worksheet.change_row_border_top(-1,'thin')
|
331
|
-
}.
|
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.
|
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).
|
338
|
-
@worksheet.sheet_data.size.
|
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).
|
346
|
-
@worksheet[0][5].border_left.
|
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
|
-
|
350
|
+
expect {
|
351
351
|
@worksheet.change_row_border_left(-1,'thin')
|
352
|
-
}.
|
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.
|
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).
|
359
|
-
@worksheet.sheet_data.size.
|
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).
|
367
|
-
@worksheet[0][5].border_right.
|
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
|
-
|
371
|
+
expect {
|
372
372
|
@worksheet.change_row_border_right(-1,'thin')
|
373
|
-
}.
|
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.
|
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).
|
380
|
-
@worksheet.sheet_data.size.
|
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).
|
388
|
-
@worksheet[0][5].border_bottom.
|
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
|
-
|
392
|
+
expect {
|
393
393
|
@worksheet.change_row_border_bottom(-1,'thin')
|
394
|
-
}.
|
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.
|
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).
|
401
|
-
@worksheet.sheet_data.size.
|
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).
|
409
|
-
@worksheet[0][5].border_diagonal.
|
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
|
-
|
413
|
+
expect {
|
414
414
|
@worksheet.change_row_border_diagonal(-1,'thin')
|
415
|
-
}.
|
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.
|
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).
|
422
|
-
@worksheet.sheet_data.size.
|
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).
|
430
|
-
@worksheet[5][0].font_name.
|
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
|
-
|
434
|
+
expect {
|
435
435
|
@worksheet.change_column_font_name(-1,'Arial')
|
436
|
-
}.
|
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.
|
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).
|
443
|
-
@worksheet.sheet_data[0].size.
|
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).
|
451
|
-
@worksheet[5][0].font_size.
|
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
|
-
|
455
|
+
expect {
|
456
456
|
@worksheet.change_column_font_size(0, '20')
|
457
|
-
}.
|
457
|
+
}.to raise_error
|
458
458
|
end
|
459
459
|
|
460
460
|
it 'should cause error if a negative argument is passed in' do
|
461
|
-
|
461
|
+
expect {
|
462
462
|
@worksheet.change_column_font_size(-1,20)
|
463
|
-
}.
|
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.
|
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).
|
470
|
-
@worksheet.sheet_data[0].size.
|
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).
|
478
|
-
@worksheet[5][0].font_color.
|
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
|
-
|
483
|
-
|
484
|
-
|
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
|
-
|
488
|
+
expect {
|
489
489
|
@worksheet.change_column_font_color(0,'#FFF000')
|
490
|
-
}.
|
490
|
+
}.to raise_error
|
491
491
|
end
|
492
492
|
|
493
493
|
it 'should cause error if a negative argument is passed in' do
|
494
|
-
|
494
|
+
expect {
|
495
495
|
@worksheet.change_column_font_color(-1,'0f0f0f')
|
496
|
-
}.
|
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.
|
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).
|
503
|
-
@worksheet.sheet_data[0].size.
|
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).
|
511
|
-
@worksheet[5][0].is_italicized.
|
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
|
-
|
515
|
+
expect {
|
516
516
|
@worksheet.change_column_italicized(-1,false)
|
517
|
-
}.
|
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.
|
521
|
+
expect(@worksheet.sheet_data[0].size).to eq(11)
|
522
522
|
@worksheet.change_column_italics(11,true)
|
523
|
-
@worksheet.is_column_italicized(11).
|
524
|
-
@worksheet.sheet_data[0].size.
|
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).
|
532
|
-
@worksheet[5][0].is_bolded.
|
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
|
-
|
536
|
+
expect {
|
537
537
|
@worksheet.change_column_bold(-1,false)
|
538
|
-
}.
|
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.
|
542
|
+
expect(@worksheet.sheet_data[0].size).to eq(11)
|
543
543
|
@worksheet.change_column_bold(11,true)
|
544
|
-
@worksheet.is_column_bolded(11).
|
545
|
-
@worksheet.sheet_data[0].size.
|
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).
|
553
|
-
@worksheet[5][0].is_underlined.
|
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
|
-
|
557
|
+
expect {
|
558
558
|
@worksheet.change_column_underline(-1,false)
|
559
|
-
}.
|
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.
|
563
|
+
expect(@worksheet.sheet_data[0].size).to eq(11)
|
564
564
|
@worksheet.change_column_underline(11,true)
|
565
|
-
@worksheet.is_column_underlined(11).
|
566
|
-
@worksheet.sheet_data[0].size.
|
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).
|
574
|
-
@worksheet[5][0].is_struckthrough.
|
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
|
-
|
578
|
+
expect {
|
579
579
|
@worksheet.change_column_strikethrough(-1,false)
|
580
|
-
}.
|
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.
|
584
|
+
expect(@worksheet.sheet_data[0].size).to eq(11)
|
585
585
|
@worksheet.change_column_strikethrough(11,true)
|
586
|
-
@worksheet.is_column_struckthrough(11).
|
587
|
-
@worksheet.sheet_data[0].size.
|
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 '.
|
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).
|
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
|
-
|
599
|
-
@worksheet.
|
600
|
-
}.
|
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.
|
605
|
-
@worksheet.
|
606
|
-
@worksheet.
|
607
|
-
@worksheet.sheet_data[0].size.
|
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
|
-
|
614
|
-
|
615
|
-
|
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
|
-
|
619
|
+
expect {
|
620
620
|
@worksheet.change_column_fill(3,'#FFF000')
|
621
|
-
}.
|
621
|
+
}.to raise_error
|
622
622
|
end
|
623
623
|
|
624
|
-
|
625
|
-
|
626
|
-
@worksheet.get_column_fill(0).
|
627
|
-
@worksheet[5][0].fill_color.
|
628
|
-
|
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
|
-
|
631
|
-
|
630
|
+
it 'should cause error if a negative argument is passed in' do
|
631
|
+
expect {
|
632
632
|
@worksheet.change_column_fill(-1,'111111')
|
633
|
-
}.
|
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.
|
637
|
+
expect(@worksheet.sheet_data[0].size).to eq(11)
|
638
638
|
@worksheet.change_column_fill(11,'111111')
|
639
|
-
@worksheet.get_column_fill(11).
|
640
|
-
@worksheet.sheet_data[0].size.
|
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).
|
648
|
-
@worksheet[5][0].horizontal_alignment.
|
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
|
-
|
652
|
+
expect {
|
653
653
|
@worksheet.change_column_horizontal_alignment(-1,'center')
|
654
|
-
}.
|
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.
|
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).
|
661
|
-
@worksheet.sheet_data[0].size.
|
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).
|
669
|
-
@worksheet[5][0].vertical_alignment.
|
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
|
-
|
674
|
-
@worksheet.change_column_vertical_alignment(-1,'center')
|
675
|
-
}.
|
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.
|
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).
|
682
|
-
@worksheet.sheet_data[0].size.
|
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).
|
690
|
-
@worksheet[5][0].border_top.
|
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
|
-
|
705
|
+
expect {
|
695
706
|
@worksheet.change_column_border_top(-1,'thin')
|
696
|
-
}.
|
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.
|
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).
|
703
|
-
@worksheet.sheet_data[0].size.
|
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).
|
711
|
-
@worksheet[5][0].border_left.
|
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
|
-
|
726
|
+
expect {
|
716
727
|
@worksheet.change_column_border_left(-1,'thin')
|
717
|
-
}.
|
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.
|
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).
|
724
|
-
@worksheet.sheet_data[0].size.
|
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).
|
732
|
-
@worksheet[5][0].border_right.
|
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
|
-
|
747
|
+
expect {
|
737
748
|
@worksheet.change_column_border_right(-1,'thin')
|
738
|
-
}.
|
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.
|
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).
|
745
|
-
@worksheet.sheet_data[0].size.
|
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).
|
753
|
-
@worksheet[5][0].border_bottom.
|
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
|
-
|
768
|
+
expect {
|
758
769
|
@worksheet.change_column_border_bottom(-1,'thin')
|
759
|
-
}.
|
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.
|
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).
|
766
|
-
@worksheet.sheet_data[0].size.
|
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).
|
774
|
-
@worksheet[5][0].border_diagonal.
|
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
|
-
|
789
|
+
expect {
|
779
790
|
@worksheet.change_column_border_diagonal(-1,'thin')
|
780
|
-
}.
|
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.
|
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).
|
787
|
-
@worksheet.sheet_data[0].size.
|
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 }.
|
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.
|
802
|
-
@worksheet[0][0].value.
|
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.
|
808
|
-
@worksheet[0][0].formula.
|
809
|
-
@worksheet[0][0].value.
|
810
|
-
@worksheet[0][0].formula.expression.
|
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.
|
816
|
-
@worksheet[0][0].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.
|
822
|
-
@worksheet[11][11].formula.expression.
|
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
|
-
|
837
|
+
expect {
|
827
838
|
@worksheet.add_cell(-1,-1,'')
|
828
|
-
}.
|
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.
|
836
|
-
@worksheet[0][0].formula.
|
837
|
-
@worksheet[0][0].row.
|
838
|
-
@worksheet[0][0].column.
|
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).
|
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.
|
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
|
-
|
865
|
+
expect {
|
855
866
|
@worksheet.delete_row(-1)
|
856
|
-
}.
|
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].
|
864
|
-
@worksheet[1][0].value.
|
865
|
-
@worksheet[1][0].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).
|
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.
|
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
|
-
|
892
|
+
expect {
|
882
893
|
@worksheet.insert_row(-1)
|
883
|
-
}.
|
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.
|
898
|
+
expect(@worksheet.sheet_data.size).to eq(11)
|
888
899
|
@worksheet.insert_row(11)
|
889
|
-
@worksheet.sheet_data.size.
|
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.
|
897
|
-
@worksheet[0][0].formula.
|
898
|
-
@worksheet[0][0].row.
|
899
|
-
@worksheet[0][0].column.
|
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).
|
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.
|
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
|
-
|
926
|
+
expect {
|
916
927
|
@worksheet.delete_column(-1)
|
917
|
-
}.
|
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].
|
925
|
-
@worksheet[0][1].value.
|
926
|
-
@worksheet[0][1].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).
|
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).
|
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.
|
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
|
-
|
959
|
+
expect {
|
949
960
|
@worksheet.insert_column(-1)
|
950
|
-
}.
|
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.
|
965
|
+
expect(@worksheet.sheet_data[0].size).to eq(11)
|
955
966
|
@worksheet.insert_column(11)
|
956
|
-
@worksheet.sheet_data[0].size.
|
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.
|
964
|
-
@worksheet[0][1].value.
|
965
|
-
@worksheet[1][0].value.
|
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.
|
971
|
-
@worksheet[0][1].value.
|
972
|
-
@worksheet[1][0].value.
|
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.
|
978
|
-
@worksheet[0][1].value.
|
979
|
-
@worksheet[1][0].value.
|
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
|
-
|
994
|
+
expect {
|
984
995
|
@worksheet.insert_cell(0,0,'test',nil,:up)
|
985
|
-
}.
|
996
|
+
}.to raise_error
|
986
997
|
end
|
987
998
|
|
988
999
|
it 'should cause error if a negative argument is passed in' do
|
989
|
-
|
1000
|
+
expect {
|
990
1001
|
@worksheet.insert_cell(-1,-1)
|
991
|
-
}.
|
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].
|
999
|
-
@old_cell.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).
|
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
|
-
|
1018
|
+
expect {
|
1008
1019
|
@worksheet.delete_cell(-1,-1)
|
1009
|
-
}.
|
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.
|
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.
|
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
|
-
|
1034
|
+
expect {
|
1024
1035
|
@worksheet.delete_cell(0,0,:down)
|
1025
|
-
}.
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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).
|
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
|
-
|
1147
|
+
expect {
|
1137
1148
|
@worksheet.get_row_height(-1)
|
1138
|
-
}.
|
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).
|
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).
|
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
|
-
|
1163
|
+
expect {
|
1153
1164
|
@worksheet.get_row_horizontal_alignment(-1)
|
1154
|
-
}.
|
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).
|
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).
|
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).
|
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
|
-
|
1184
|
+
expect {
|
1174
1185
|
@worksheet.get_row_vertical_alignment(-1)
|
1175
|
-
}.
|
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).
|
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).
|
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).
|
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
|
-
|
1206
|
+
expect {
|
1196
1207
|
@worksheet.get_row_border_top(-1)
|
1197
|
-
}.
|
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).
|
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).
|
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).
|
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
|
-
|
1227
|
+
expect {
|
1217
1228
|
@worksheet.get_row_border_left(-1)
|
1218
|
-
}.
|
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).
|
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).
|
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).
|
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
|
-
|
1248
|
+
expect {
|
1238
1249
|
@worksheet.get_row_border_right(-1)
|
1239
|
-
}.
|
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).
|
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).
|
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).
|
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
|
-
|
1270
|
+
expect {
|
1260
1271
|
@worksheet.get_row_border_bottom(-1)
|
1261
|
-
}.
|
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).
|
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).
|
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).
|
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
|
-
|
1291
|
+
expect {
|
1281
1292
|
@worksheet.get_row_border_diagonal(-1)
|
1282
|
-
}.
|
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).
|
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).
|
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
|
-
|
1308
|
+
expect {
|
1298
1309
|
@worksheet.get_column_font_name(-1)
|
1299
|
-
}.
|
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).
|
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
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
|
1360
|
-
|
1361
|
-
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
|
1384
|
-
|
1385
|
-
|
1386
|
-
|
1387
|
-
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
|
1392
|
-
|
1393
|
-
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1406
|
-
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1413
|
-
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1419
|
-
|
1420
|
-
|
1421
|
-
|
1422
|
-
|
1423
|
-
|
1424
|
-
|
1425
|
-
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
|
1436
|
-
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
|
-
|
1441
|
-
@worksheet.
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
|
1453
|
-
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
|
1464
|
-
|
1465
|
-
|
1466
|
-
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1477
|
-
|
1478
|
-
|
1479
|
-
|
1480
|
-
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1515
|
-
|
1516
|
-
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
|
1542
|
-
|
1543
|
-
|
1544
|
-
|
1545
|
-
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
|
1552
|
-
|
1553
|
-
|
1554
|
-
|
1555
|
-
|
1556
|
-
|
1557
|
-
|
1558
|
-
|
1559
|
-
|
1560
|
-
|
1561
|
-
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
1599
|
-
|
1600
|
-
|
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.
|
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).
|
1611
|
-
@worksheet.cols.column_ranges.size.
|
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).
|
1616
|
-
@worksheet.cols.column_ranges.size.
|
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).
|
1621
|
-
@worksheet.get_column_width(0).
|
1622
|
-
@worksheet.cols.column_ranges.size.
|
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
|