Skip to content

Commit

Permalink
test execution with help
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy committed Sep 24, 2016
1 parent 5ce309f commit c15ffa1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ LazyData: true
Suggests:
testthat,
knitr,
rmarkdown
rmarkdown,
stringr
RoxygenNote: 5.0.1
VignetteBuilder: knitr
13 changes: 13 additions & 0 deletions tests/testthat/test-init_args.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,16 @@ test_that("init_args works for a simple example", {
expect_identical(args, expected)

})

context("example")

example <- "%s/example.R" %>% sprintf(system.file("exec", package = "args"))
library(stringr)

test_that("help works", {

command <- "%s --help" %>% sprintf(example)
res <- suppressWarnings(system(command, intern = TRUE))
expect_identical(res[1] %>% str_sub(1, 6), "usage:")

})

0 comments on commit c15ffa1

Please sign in to comment.