tests/testthat/test-checks.R

# tests of functions in the checks.R script

context("checks")


test_that("check check_cols", {

    # shouldn't throw an error
    check_cols(calc_TURN(TUR_dat),
               required_cols = c("epidate", "n_active", "n_active_adj"),
               name = "TURN_df")

    expect_error(check_cols(cars, required_cols = "blahhh"))

})

test_that("initial_check", {

    expect_equal(initial_check(rp_raw), message("check passed"))
    expect_message(initial_check(rp_raw, "Gastro_Intestinal"))
    expect_error(initial_check(rp_raw, target_PouchTitle = "blaha"))

    expect_error(initial_check(cars))
})
MartinHoldrege/turnr documentation built on May 16, 2020, 10:39 a.m.