Sha256: f93091b797982088132a67d9276b21f6f6508870ce1bc3333e6f410231abd8a9

Contents?: true

Size: 592 Bytes

Versions: 6

Compression:

Stored size: 592 Bytes

Contents

require_relative 'test_helper'

describe "FastExcel::Worksheet" do

  it "should get_worksheet_by_name" do
    workbook = FastExcel.open(constant_memory: false)
    workbook.add_worksheet("Page1")

    ws = workbook.get_worksheet_by_name("Page1")
    ws.write_row(0, ['1'])

    workbook.close

    error = assert_raises do
      FastExcel.open(workbook.filename, constant_memory: false)
    end

    assert_equal(error.class, ArgumentError)
    assert_equal(error.message, "File '#{workbook.filename}' already exists. FastExcel can not open existing files, only create new files")
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fast_excel-0.5.0 test/reopen_test.rb
fast_excel-0.4.1 test/reopen_test.rb
fast_excel-0.4.0 test/reopen_test.rb
fast_excel-0.3.0 test/reopen_test.rb
fast_excel-0.2.6 test/reopen_test.rb
fast_excel-0.2.5 test/reopen_test.rb