tests/testthat/test-parse_packages.R

context("parse_packages")

test_that("Identifies packages correctly in .R files",{
  expect_equal(
    parse_packages("samples/Simple.R"),
    paste0('pkg', 1:11)
  )
})

test_that("Errors for non-exisiting R file",{
    expect_error(parse_packages("samples/not_here.R"))
})

Try the automagic package in your browser

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

automagic documentation built on May 2, 2019, 6:02 a.m.