tests/testthat/test-input-usage.R

test_that("R files look for dummy_input list", {
  code <- "dummy_input <- list(x = 1); y = 2;"
  expected <- "input <- list(x = 1)"
  
  tmp <- tempfile("data", fileext = ".R")
  write(code, tmp)
  actual <- find_input_code(file = tmp)
  unlink(tmp)
  
  expect_equal(actual, expected)
})

Try the shinyobjects package in your browser

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

shinyobjects documentation built on July 29, 2020, 9:07 a.m.