Sha256: e3b036a0aec0c988734c8266bb46824b7b4663ae27807e1b46f83e2d5ce43969

Contents?: true

Size: 1.25 KB

Versions: 32

Compression:

Stored size: 1.25 KB

Contents

# -*- coding: utf-8 -*-
require 'helper'

class TestRegressionShapeConnect02 < Test::Unit::TestCase
  def setup
    setup_dir_var
  end

  def teardown
    File.delete(@xlsx) if File.exist?(@xlsx)
  end

  def test_shape_connect02
    @xlsx = 'shape_connect02.xlsx'
    workbook  = WriteXLSX.new(@xlsx)
    worksheet = workbook.add_worksheet

    s1 = workbook.add_shape(:type => 'chevron', :width=> 60, :height => 60)
    worksheet.insert_shape('A1', s1, 50, 50)

    s2 = workbook.add_shape(:type => 'pentagon', :width=> 20, :height => 20)
    worksheet.insert_shape('A1', s2, 250, 200)

    # Create a connector to link the two shapes
    cxn_shape = workbook.add_shape(:type => 'curvedConnector3')

    # Link the start of the connector to the right side
    cxn_shape.start = s1.id
    cxn_shape.start_index = 2   # 2nd connection point, clockwise from top(0)
    cxn_shape.start_side = 'r'  # r)ight or b)ottom

    # Link the end of the connector to the left side
    cxn_shape.end = s2.id
    cxn_shape.end_index = 4     # 4th connection point, clockwise from top(0)
    cxn_shape.end_side = 'l'    # l)eft or t)op

    worksheet.insert_shape('A1', cxn_shape, 0, 0)

    workbook.close
    compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
write_xlsx-0.85.5 test/regression/test_shape_connect02.rb
write_xlsx-0.85.4 test/regression/test_shape_connect02.rb
write_xlsx-0.85.3 test/regression/test_shape_connect02.rb
write_xlsx-0.85.2 test/regression/test_shape_connect02.rb
write_xlsx-0.85.1 test/regression/test_shape_connect02.rb
write_xlsx-0.83.0 test/regression/test_shape_connect02.rb
write_xlsx-0.81.1 test/regression/test_shape_connect02.rb
write_xlsx-0.81.0 test/regression/test_shape_connect02.rb
write_xlsx-0.80.0 test/regression/test_shape_connect02.rb
write_xlsx-0.79.0 test/regression/test_shape_connect02.rb
write_xlsx-0.78.0 test/regression/test_shape_connect02.rb
write_xlsx-0.77.2 test/regression/test_shape_connect02.rb
write_xlsx-0.77.1 test/regression/test_shape_connect02.rb
write_xlsx-0.77.0 test/regression/test_shape_connect02.rb
write_xlsx-0.76.3 test/regression/test_shape_connect02.rb
write_xlsx-0.76.2 test/regression/test_shape_connect02.rb
write_xlsx-0.76.1 test/regression/test_shape_connect02.rb
write_xlsx-0.76.0 test/regression/test_shape_connect02.rb
write_xlsx-0.75.0 test/regression/test_shape_connect02.rb
write_xlsx-0.74.0 test/regression/test_shape_connect02.rb