diff --git a/tests/testthat/Rmd_error_test.Rmd b/tests/testthat/Rmd_error_test.Rmd new file mode 100644 index 00000000..b4a9d1ca --- /dev/null +++ b/tests/testthat/Rmd_error_test.Rmd @@ -0,0 +1,19 @@ +--- +title: "Test" +author: "Changcheng Li" +date: "2017/9/23" +output: github_document +--- + +## Use JuliaCall as Julia Engine in R Markdown + +To use `JuliaCall` package for julia engine in R Markdown document. +Just set the engine for julia to `JuliaCall::eng_juliacall` like this: + +```{r setup} +knitr::knit_engines$set(julia = JuliaCall::eng_juliacall) +``` + +```{julia} +abc +``` diff --git a/tests/testthat/Rmd_error_test1.Rmd b/tests/testthat/Rmd_error_test1.Rmd new file mode 100644 index 00000000..6f2b8343 --- /dev/null +++ b/tests/testthat/Rmd_error_test1.Rmd @@ -0,0 +1,20 @@ +--- +title: "Test" +author: "Changcheng Li" +date: "2017/9/23" +output: github_document +--- + +## Use JuliaCall as Julia Engine in R Markdown + +To use `JuliaCall` package for julia engine in R Markdown document. +Just set the engine for julia to `JuliaCall::eng_juliacall` like this: + +```{r setup} +knitr::knit_engines$set(julia = JuliaCall::eng_juliacall) +``` + +```{r} +library(JuliaCall) +julia_command("abc") +``` diff --git a/tests/testthat/test_rmd_error.R b/tests/testthat/test_rmd_error.R new file mode 100644 index 00000000..cf0f3474 --- /dev/null +++ b/tests/testthat/test_rmd_error.R @@ -0,0 +1,12 @@ +context("rmd error test") + +test_that("test error throwing in rmd", { + skip_on_cran() + skip_on_appveyor() + + tmp <- tempfile(fileext = ".md") + expect_error(rmarkdown::render(test_path("Rmd_error_test.Rmd"), + output_file = tmp)) + expect_error(rmarkdown::render(test_path("Rmd_error_test1.Rmd"), + output_file = tmp)) +})