Sha256: f03e6554e9a81daa655b5ca2d806cea234f1a8f9b5d918ddc60d938dde391111

Contents?: true

Size: 1.24 KB

Versions: 12

Compression:

Stored size: 1.24 KB

Contents

# -*- coding: utf-8 -*-
require 'helper'
require 'write_xlsx/workbook'
require 'write_xlsx/worksheet'
require 'write_xlsx/shape'
require 'write_xlsx/drawing'
require 'stringio'

class DrawingShape07 < Minitest::Test
  def setup
    @workbook = WriteXLSX.new(StringIO.new)
    @worksheet = @workbook.add_worksheet('')
  end

  def test_drawing_shape_07
    shape = Writexlsx::Shape.new
    shape.line_weight = 5
    shape.line_type   = 'lgDashDot'

    @obj = Writexlsx::Drawings.new
    @obj.embedded = 1
    dimensions = [
      4, 8, 209550, 95250, 12, 22, 209660, 96260, 10000, 20000
    ]
    drawing = Writexlsx::Drawing.new(
      3, dimensions, 95250, 190500, '', shape, 1
    )
    @obj.add_drawing_object(drawing)
                            # 3, 4, 8, 209550, 95250, 12, 22, 209660,
                            # 96260, 10000, 20000, 95250, 190500, '', shape
                            # )
    @obj.__send__(:write_a_ln, shape)

    result = got_to_array(@obj.xml_str)
    expected = expected_to_array(expected_str)
    assert_equal(expected, result)
  end

  def expected_str
<<EOS
<a:ln w="47625">
<a:solidFill>
<a:srgbClr val="000000"/>
</a:solidFill>
<a:prstDash val="lgDashDot"/>
<a:miter lim="800000"/>
<a:headEnd/>
<a:tailEnd/>
</a:ln>
EOS
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
write_xlsx-1.09.4 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.09.3 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.09.2 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.09.1 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.09.0 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.08.2 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.08.1 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.08.0 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.07.0 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.04.0 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.02.0 test/drawing/test_drawing_shape_07.rb
write_xlsx-1.01.0 test/drawing/test_drawing_shape_07.rb