# -*- coding: utf-8 -*- require 'helper' require 'write_xlsx/workbook' require 'write_xlsx/worksheet' require 'write_xlsx/shape' require 'write_xlsx/drawing' require 'stringio' class DrawingShape04 < Minitest::Test def setup @workbook = WriteXLSX.new(StringIO.new) @worksheet = @workbook.add_worksheet('') end def test_drawing_shape_04 shape = Writexlsx::Shape.new(:text => 'test', :id => 1000) # Mock up the color palette. shape.palette[0] = [0x00, 0x00, 0x00, 0x00] shape.palette[7] = [0x00, 0x00, 0x00, 0x00] @obj = Writexlsx::Drawings.new @obj.embedded = 2 dimensions = [ 4, 8, 209550, 95250, 12, 22, 209660, 96260, 10000, 20000 ] drawing = Writexlsx::Drawing.new( 3, dimensions, 95250, 190500, 'rect 1', shape, 1 ) @obj.add_drawing_object(drawing) @obj.assemble_xml_file result = got_to_array(@obj.xml_str) expected = expected_to_array(expected_str) assert_equal(expected, result) end def expected_str < 4 209550 8 95250 12 209660 22 96260 test EOS end end