Sha256: bb21b83e79f3934de9a9493057b38c11a3fd3bfc5df273bdddc6cd8d562726a4

Contents?: true

Size: 1.18 KB

Versions: 19

Compression:

Stored size: 1.18 KB

Contents

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

class TestRegressionQuoteName01 < Minitest::Test
  def setup
    setup_dir_var
  end

  def teardown
    @tempfile.close(true)
  end

  def test_quote_name01
    @xlsx = 'quote_name01.xlsx'
    workbook  = WriteXLSX.new(@io)

    data = [
            [1, 2, 3,  4,  5],
            [2, 4, 6,  8, 10],
            [3, 6, 9, 12, 15]
           ]

    # Test quoted/non-quoted sheet names.
    worksheet = workbook.add_worksheet('Sheet 1')
    chart = workbook.add_chart( :type => 'pie', :embedded => 1 )

    worksheet.write( 'A1', data )
    chart.add_series(:values => [ "'Sheet 1'", 0, 4, 0, 0 ])
    worksheet.insert_chart( 'E6', chart, 26, 17 )

    sheetnames = [
                  'Sheet 2', "Sheet!3", 'Sheet"4',
                  'Sheet#5', 'Sheet$6', 'Sheet%7', 'Sheet&8'
                 ]

    sheetnames.each do |sheetname|
      worksheet = workbook.add_worksheet( sheetname )
      chart = workbook.add_chart( :type => 'pie', :embedded => 1 )

      worksheet.write( 'A1', data )
      chart.add_series(:values => [sheetname, 0, 4, 0, 0])
      worksheet.insert_chart( 'E6', chart, 26, 17 )
    end

    workbook.close
    compare_for_regression
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
write_xlsx-1.09.4 test/regression/test_quote_name01.rb
write_xlsx-1.09.3 test/regression/test_quote_name01.rb
write_xlsx-1.09.2 test/regression/test_quote_name01.rb
write_xlsx-1.09.1 test/regression/test_quote_name01.rb
write_xlsx-1.09.0 test/regression/test_quote_name01.rb
write_xlsx-1.08.2 test/regression/test_quote_name01.rb
write_xlsx-1.08.1 test/regression/test_quote_name01.rb
write_xlsx-1.08.0 test/regression/test_quote_name01.rb
write_xlsx-1.07.0 test/regression/test_quote_name01.rb
write_xlsx-1.04.0 test/regression/test_quote_name01.rb
write_xlsx-1.02.0 test/regression/test_quote_name01.rb
write_xlsx-1.01.0 test/regression/test_quote_name01.rb
write_xlsx-1.00.0 test/regression/test_quote_name01.rb
write_xlsx-0.99.0 test/regression/test_quote_name01.rb
write_xlsx-0.97.0 test/regression/test_quote_name01.rb
write_xlsx-0.90.0 test/regression/test_quote_name01.rb
write_xlsx-0.89.0 test/regression/test_quote_name01.rb
write_xlsx-0.88.0 test/regression/test_quote_name01.rb
write_xlsx-0.87.0 test/regression/test_quote_name01.rb