tests/testthat/test-column-modification.R

context("test-column-modification")

test_that("supplied nr. of columnames equals nr. of columns",{
  df <- tibble::tibble(x = 1:2, y = 3:4)
  expect_error(print_df(df, colnames = c("eins")))
})

test_that("column-width modification works",{
  df <- tibble::tibble(x = 1:2, y = 3:4)
  expect_match(
    print_df(df, output = "pdf", modify_these_columns =  c("x"), column_widths = c("8 cm")),
    "8 cm"
  )
  expect_match(
    print_df(df, output = "pdf", modify_these_columns = c("x", "y"), column_widths =  c("4 cm")),
    "4 cm"
  )

})
stephanGit/reporters documentation built on May 22, 2019, 6:34 p.m.