Sha256: d808473679d65afed412553cd5759196b4e1423990afd3500c4b0b97cc250c34

Contents?: true

Size: 1.26 KB

Versions: 9

Compression:

Stored size: 1.26 KB

Contents

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

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

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

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

    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_xlsx_for_regression(File.join(@regression_output, @xlsx), @xlsx)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
write_xlsx-0.85.5 test/regression/test_quote_name01.rb
write_xlsx-0.85.4 test/regression/test_quote_name01.rb
write_xlsx-0.85.3 test/regression/test_quote_name01.rb
write_xlsx-0.85.2 test/regression/test_quote_name01.rb
write_xlsx-0.85.1 test/regression/test_quote_name01.rb
write_xlsx-0.83.0 test/regression/test_quote_name01.rb
write_xlsx-0.81.1 test/regression/test_quote_name01.rb
write_xlsx-0.81.0 test/regression/test_quote_name01.rb
write_xlsx-0.80.0 test/regression/test_quote_name01.rb