Skip to content

Commit

Permalink
Add tests for issue #122.
Browse files Browse the repository at this point in the history
  • Loading branch information
Non-Contradiction committed Oct 21, 2019
1 parent 44ad6b2 commit ba70e83
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/testthat/Rmd_error_test.Rmd
Original file line number Diff line number Diff line change
@@ -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
```
20 changes: 20 additions & 0 deletions tests/testthat/Rmd_error_test1.Rmd
Original file line number Diff line number Diff line change
@@ -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")
```
12 changes: 12 additions & 0 deletions tests/testthat/test_rmd_error.R
Original file line number Diff line number Diff line change
@@ -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))
})

0 comments on commit ba70e83

Please sign in to comment.