Sha256: ede6cb43aab474692ea807f8d50cdd57f591799031a53080735a9577184322f6

Contents?: true

Size: 1.49 KB

Versions: 42

Compression:

Stored size: 1.49 KB

Contents

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

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

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

  def test_table08
    @xlsx = 'table08.xlsx'
    workbook  = WriteXLSX.new(@xlsx)
    worksheet = workbook.add_worksheet

    # Set the column width to match the taget worksheet.
    worksheet.set_column('C:F', 10.288)

    # Add some strings to order the string table.
    worksheet.write_string('A1', 'Column1')
    worksheet.write_string('B1', 'Column2')
    worksheet.write_string('C1', 'Column3')
    worksheet.write_string('D1', 'Column4')
    worksheet.write_string('E1', 'Total')

    # Add the table.
    worksheet.add_table(
                        'C3:F14',
                        {
                          :total_row => 1,
                          :columns   => [
                                         {:total_string => 'Total'},
                                         {},
                                         {},
                                         {:total_function => 'count'}
                                        ]
                        }
                        )

    workbook.close
    compare_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx,
                                [ 'xl/calcChain.xml', '[Content_Types].xml', 'xl/_rels/workbook.xml.rels' ],
                                {  'xl/workbook.xml' => ['<workbookView'] }
                                )
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
write_xlsx-0.54.0 test/regression/test_table08.rb
write_xlsx-0.51.0 test/regression/test_table08.rb