File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ title : Purl Test Document
3+ toc-title : Table of contents
4+ ---
5+
6+ Hello, world
7+
8+ :::: cell
9+ ``` {.r .cell-code}
10+ cat(" more" )
11+ ```
12+
13+ ::: {.cell-output .cell-output-stdout}
14+ more
15+ :::
16+ ::::
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ test_that("extract_r_code() errors on existing script", {
1717 )
1818})
1919
20- test_that(" extract_r_code() writes metadata " , {
20+ test_that(" extract_r_code() writes R file that renders " , {
2121 skip_if_no_quarto()
2222 r_script <- withr :: local_tempfile(pattern = " purl" , fileext = " .R" )
2323
@@ -30,6 +30,20 @@ test_that("extract_r_code() writes metadata", {
3030 ),
3131 name = " purl.R"
3232 )
33+
34+ skip_if_no_quarto(" 1.4.511" )
35+ announce_snapshot_file(name = " purl.md" )
36+ md_file <- xfun :: with_ext(r_script , " md" )
37+ quarto :: quarto_render(
38+ r_script ,
39+ output_format = " markdown" ,
40+ output_file = basename(md_file ),
41+ quiet = TRUE
42+ )
43+ expect_snapshot_file(
44+ path = md_file ,
45+ name = " purl.md"
46+ )
3347})
3448
3549test_that(" extract_r_code() do nothing on file with no code" , {
You can’t perform that action at this time.
0 commit comments