context("Protection") test_that("Protection", { wb <- createWorkbook() addWorksheet(wb, "s1") addWorksheet(wb, "s2") protectWorksheet(wb, sheet = "s1", protect = TRUE, password = "abcdefghij", lockSelectingLockedCells = FALSE, lockSelectingUnlockedCells = FALSE, lockFormattingCells = TRUE, lockFormattingColumns = TRUE, lockPivotTables = TRUE) expect_true(wb$worksheets[[1]]$sheetProtection == "") protectWorksheet(wb, sheet = "s2", protect = TRUE) expect_true(wb$worksheets[[2]]$sheetProtection == "") protectWorksheet(wb, sheet = "s2", protect = FALSE) expect_true(wb$worksheets[[2]]$sheetProtection == "") })