tests/testthat/test-this_file.r

context( "opt_this_file" )

# TYPICAL  
  flags <- str_to_opts( "Rscript --slave --no-restore --file=test-this_file.r --args sub1" )
  file  <- this_file(flags, full.path = FALSE ) 
  
  expect_equal( file, "test-this_file.r" )
  
# MULTIPLE --file
  flags <- str_to_opts( "Rscript --slave --no-restore --file=test-this_file.r --args sub1 --file other-file" )
  this_file(flags, full.path = FALSE)

  expect_equal( file, "test-this_file.r" )

Try the optigrab package in your browser

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

optigrab documentation built on May 2, 2019, 2:10 a.m.