Skip to content

Commit

Permalink
Remove styling test
Browse files Browse the repository at this point in the history
  • Loading branch information
Noam Ross committed Nov 28, 2023
1 parent 132ffd2 commit 8b8efa3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion R/cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @examples
#' relic_cache()
relic_cache <- function() {
path_norm(dir_create(Sys.getenv(
dir_create(path_tidy(Sys.getenv(
"RELIC_CACHE_DIR",
getOption("relic.cache.dir",
default = tools::R_user_dir("relic", "cache")
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-cache.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("A relic cache dir set by environent variable overrides one set by options", {
env_dir <- path_norm(tempfile())
options_dir <- path_norm(tempfile())
env_dir <- path_tidy(tempfile())
options_dir <- path_tidy(tempfile())
withr::local_envvar(RELIC_CACHE_DIR = env_dir)
withr::local_options(relic.cache.dir = options_dir)
expect_equal(relic_cache(), env_dir)
Expand Down
16 changes: 1 addition & 15 deletions tests/testthat/tests-strict.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,4 @@ test_that("Spelling", {
}
})

test_that("Styling", {
testthat::skip_on_cran()
testthat::skip_on_covr()
styler_output <- capture.output(styler_data <- styler::style_pkg(dry = "on"))
has_style_changes <- any(styler_data$changed)
if (strict_tests) {
expect(!has_style_changes, paste0(
"Style changes to make: \n",
collapse(styler_output, "\n")
))
} else {
if (has_style_changes) warning("Style changes found, run `styler::style_pkg()` to fix them.")
expect_true(TRUE)
}
})

0 comments on commit 8b8efa3

Please sign in to comment.