Sha256: 0e044b7487439360be15de0cf1133c8b6800604359eca42b01c22e41c3c4083c
Contents?: true
Size: 878 Bytes
Versions: 6
Compression:
Stored size: 878 Bytes
Contents
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
6 entries across 6 versions & 1 rubygems