Browse Source

file test

master
Bob Rudis 6 years ago
parent
commit
33523acf1e
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 2
      R/RcppExports.R
  2. 6
      R/zzz.r
  3. 1
      tests/testthat/test-wand.R

2
R/RcppExports.R

@ -11,6 +11,8 @@
#' Specifically, mime type, encoding, possible file extensions and
#' type description are returned as colums in the data frame along
#' with \code{path}.
#' @note Various fields might not be available depending on the version
#' of \code{libmagic} you have installed.
#' @references See \url{http://openpreservation.org/blog/2012/08/09/magic-editing-and-creation-primer/}
#' for information on how to create your own \code{magic} database
#' @export

6
R/zzz.r

@ -26,8 +26,10 @@ magic_wand_file <- function(force=FALSE) {
if (!dir.exists(cache)) dir.create(cache, showWarnings=FALSE)
if (!dir.exists(cache)) return("system")
suppressWarnings(unzip(system.file("magic.mgc.zip", package="wand"),
exdir=cache, overwrite=force))
if (!file.exists(file.path(rappdirs::user_cache_dir("wandr"), "magic.mgc"))) {
suppressWarnings(unzip(system.file("magic.mgc.zip", package="wand"),
exdir=cache, overwrite=force))
}
file.path(rappdirs::user_cache_dir("wandr"), "magic.mgc")

1
tests/testthat/test-wand.R

@ -5,6 +5,7 @@ test_that("we can do something", {
magic_wand_file())
tmp <- tmp$description
tmp <- unlist(tmp, use.names=FALSE)
tmp <- sort(tmp)
expect_that(tmp[2], equals("C source, ASCII text"))

Loading…
Cancel
Save