tests/testthat/test_rename.R

library(odkr); library(stringr)
context("Test renaming of ODK datasets")

case <- renameODK(sampleData1)
test <- str_split(names(sampleData1), pattern = "\\.", simplify = TRUE)[,1]

test_that("Output has no '.'", {
  expect_false(str_detect(names(case), "\\.")[1])
  expect_false(str_detect(names(case), "\\.")[5])
  expect_false(str_detect(names(case), "\\.")[10])
  expect_false(str_detect(names(case), "\\.")[15])
})

test_that("Output has names", {
  expect_named(case)
})

Try the odkr package in your browser

Any scripts or data that you put into this service are public.

odkr documentation built on Feb. 11, 2018, 3:10 p.m.