Sha256: 07774639999168c1ba450d48a258b11b09797c8b13d8ee5e15f8a60a2dcb5994

Contents?: true

Size: 567 Bytes

Versions: 4

Compression:

Stored size: 567 Bytes

Contents

# frozen_string_literal: true

require 'test/unit'

class TestErrors < Test::Unit::TestCase
  def test_long_sheet_name
    file_path = 'tmp/error_long_sheet_name.xlsx'
    was_in_block = false
    XlsxWriter::Workbook.open(file_path) do |wb|
      assert_raise(RuntimeError.new('worksheet was not created')) do
        wb.add_worksheet('a' * 32) do |ws|
          was_in_block = true
          ws.add_row(['test'])
        end
      end
    end
    assert_equal(was_in_block, false)
  ensure
    File.delete file_path if file_path && File.exist?(file_path)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xlsxwriter-0.2.0.pre test/test-errors.rb
xlsxwriter-0.1.2.pre test/test-errors.rb
xlsxwriter-0.1.1 test/test-errors.rb
xlsxwriter-0.1.0 test/test-errors.rb