brodieG / unitizer

Easy R Unit Tests
Other
39 stars 7 forks source link

Failing to Find File When Starting in Tests #225

Closed brodieG closed 6 years ago

brodieG commented 7 years ago
> setwd('tests')
> unitize('tests2')

Warning in infer_unitizer_location.character(test.file) :
  No possible matching files for tests2
Error in unitize_core(test.file.inf, list(store.id.inf), state = state,  : 
  Internal Error: `test.files` must all point to valid files in unitize mode; contact maintainer
In addition: Warning message:
In filename_to_storeid(test.file.inf) :
  Unable to translate file name 'tests2' to store id; please provide explicit store id
> setwd('..')
> unitize('tests2')

| Inferred test file location: tests/unitizer/tests2.R

| 6/6 tests passed; nothing to review.                                          

> getwd()
[1] "/Users/brodie/repos/unitizer"
brodieG commented 7 years ago

Loosely related, find files when they are not in tests directory is less than ideal:

> library(unitizer)
> unitize('empt')

Warning in infer_unitizer_location.character(test.file) :
  No possible matching files for empt
Error in unitize_core(test.file.inf, list(store.id.inf), state = state,  : 
  Internal Error: `test.files` must all point to valid files in unitize mode; contact maintainer
In addition: Warning message:
In filename_to_storeid(test.file.inf) :
  Unable to translate file name 'empt' to store id; please provide explicit store id
> list.files()
 [1] "covr.R"                 "DESCRIPTION"            "DEVNOTES.md"           
 [4] "empty.R"                "inst"                   "man"                   
 [7] "NAMESPACE"              "NEWS.md"                "R"                     
[10] "README.md"              "README.Rmd"             "scratch.R"             
[13] "src"                    "tests"                  "vetr_0.0.2.9007.tar.gz"
[16] "vignettes"             
> unitize('empty.R')

| 0/0 tests passed; nothing to review.                                          

> unitize('empty.R', force=T)

+------------------------------------------------------------------------------+
| unitizer for: ../empty.R                                                     |
+------------------------------------------------------------------------------+

Note the ../empty.R when that file is actually in the working directory.

brodieG commented 6 years ago

We're not going to worry about the '../empty.R' issue.