inst/tests/test_write_yaml.R

test_output_is_written_to_a_file_when_a_filename_is_specified <- function() {
  filename <- tempfile()
  write_yaml(1:3, filename)
  output <- readLines(filename)
  unlink(filename)
  checkEquals(c("- 1", "- 2", "- 3"), output)
}

Try the yaml package in your browser

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

yaml documentation built on Feb. 1, 2020, 9:07 a.m.