Sha256: 8b4fe57eb7030b36498f4fe2950ecbf1b9aa24dab1411b98fb1ce80dbabc8b7c

Contents?: true

Size: 909 Bytes

Versions: 8

Compression:

Stored size: 909 Bytes

Contents

# frozen_string_literal: true

require_relative './xlsx-func-testcase'

class TestProtect < XlsxWriterTestCase
  test 'protect02' do |wb, t|
    t.ignore_elements = { 'xl/worksheets/sheet1.xml' => [ '<pageMargins' ] }
    wb.add_format :unlocked, unlocked: true
    wb.add_format :hidden, unlocked: true, hidden: true
    wb.add_worksheet do |ws|
      ws.protect
      ws.write_number(0, 'A', 1, nil)
      ws.write_number(1, 'A', 2, :unlocked)
      ws.write_number(2, 'A', 3, :hidden)
    end
  end

  test 'protect03' do |wb, t|
    t.ignore_elements = { 'xl/worksheets/sheet1.xml' => [ '<pageMargins' ] }
    wb.add_format :unlocked, unlocked: true
    wb.add_format :hidden, unlocked: true, hidden: true
    wb.add_worksheet do |ws|
      ws.protect 'password'
      ws.write_number(0, 'A', 1, nil)
      ws.write_number(1, 'A', 2, :unlocked)
      ws.write_number(2, 'A', 3, :hidden)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
xlsxwriter-0.2.1.pre.2 test/test-protect.rb
xlsxwriter-0.2.1.pre test/test-protect.rb
xlsxwriter-0.2.0 test/test-protect.rb
xlsxwriter-0.2.0.pre.2 test/test-protect.rb
xlsxwriter-0.2.0.pre test/test-protect.rb
xlsxwriter-0.1.2.pre test/test-protect.rb
xlsxwriter-0.1.1 test/test-protect.rb
xlsxwriter-0.1.0 test/test-protect.rb