Browse Source

tests

tags/v0.3.0
Bob Rudis 8 years ago
parent
commit
4b4f21d104
  1. 4
      README.md
  2. 2
      tests/test-all.R
  3. 7
      tests/testthat/test-wand.R

4
README.md

@ -70,13 +70,13 @@ library(testthat)
date() date()
``` ```
## [1] "Fri Aug 12 23:38:14 2016" ## [1] "Fri Aug 12 23:58:20 2016"
``` r ``` r
test_dir("tests/") test_dir("tests/")
``` ```
## testthat results ======================================================================================================== ## testthat results ========================================================================================================
## OK: 0 SKIPPED: 0 FAILED: 0 ## OK: 1 SKIPPED: 0 FAILED: 0
## ##
## DONE =================================================================================================================== ## DONE ===================================================================================================================

2
tests/test-all.R

@ -1,2 +1,2 @@
library(testthat) library(testthat)
test_check("filemagic") test_check("wand")

7
tests/testthat/test-wand.R

@ -1,6 +1,11 @@
context("basic functionality") context("basic functionality")
test_that("we can do something", { test_that("we can do something", {
#expect_that(some_function(), is_a("data.frame")) tmp <- incant(list.files(system.file("img", package="wand"), full.names=TRUE),
magic_wand_file())
tmp <- tmp$description
tmp <- unlist(tmp, use.names=FALSE)
expect_that(tmp[2], equals("C source, ASCII text"))
}) })

Loading…
Cancel
Save