Skip to content

Commit

Permalink
Merge pull request #1 from datacamp/travisci
Browse files Browse the repository at this point in the history
Travisci
  • Loading branch information
machow committed Jun 23, 2017
2 parents 63fa2d2 + a9c530e commit 381c894
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
@@ -0,0 +1,2 @@
language: r
cache: packages
2 changes: 2 additions & 0 deletions DESCRIPTION
Expand Up @@ -8,6 +8,8 @@ Description: This package contains functions that build off of the core
building blocks in testwhat. Often, these will be multiple simple
SCTs combined.
Imports: testwhat
Suggests: testthat
Remotes: datacamp/testwhat
License: MIT + file LICENSE
LazyData: TRUE
RoxygenNote: 5.0.1
1 change: 1 addition & 0 deletions R/examples.R
Expand Up @@ -18,6 +18,7 @@ check_object2 <- function(state, names) {
#' @param state state to start from
#' @param name passed to check_function
#' @param index passed to check_function
#' @param args an array of argument names, passed to check_args, then check_equal.
#' @importFrom testwhat check_function check_arg check_equal %>%
#'
#' @export
Expand Down
2 changes: 2 additions & 0 deletions man/check_function2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions man/hello.Rd

This file was deleted.

10 changes: 5 additions & 5 deletions tests/testthat/helper-setup_state.R
@@ -1,15 +1,15 @@
setup_state <- function(stu_code, sol_code, PEC = "", output = "") {
if (is.character(output)) output <- list(type = "output", payload = output)
if (is.character(output)) output <- list(list(type = "output", payload = output))

tw <<- testwhat:::tw

sol_env <- new.env()
stu_env <- new.env()

evaluate::evaluate(PEC, envir=sol_env)
evaluate::evaluate(sol_code, envir=sol_env)
evaluate::evaluate(PEC, envir=stu_env)
evaluate::evaluate(stu_code, envir=stu_env)
eval(parse(text = PEC), envir=sol_env)
eval(parse(text = sol_code), envir=sol_env)
eval(parse(text = PEC), envir=stu_env)
eval(parse(text = stu_code), envir=stu_env)

tw$clear()

Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test_examples.R
@@ -1,5 +1,10 @@
context("Examples")

test_that("state is setup correctly", {
state <- setup_state("x <- 1", "x <- 1", output = "a b c")
state %>% testwhat::check_output("a b c")
})

test_that("check_object2 passes", {
state <- setup_state("x <- 1; y <- 2", "x <- 1; y <- 2")
state %>% check_object2(c('x', 'y'))
Expand Down

0 comments on commit 381c894

Please sign in to comment.