File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,23 @@ test_that("it uses config home directory settings if provided", {
43
43
expect_identical(settings $ exclude , " test" )
44
44
})
45
45
46
+ test_that(" it uses system config directory settings if provided" , {
47
+ path <- withr :: local_tempdir()
48
+ config_parent_path <- withr :: local_tempdir(" config" )
49
+ config_path <- file.path(config_parent_path , " R" , " lintr" )
50
+ dir.create(config_path , recursive = TRUE )
51
+ file <- withr :: local_tempfile(tmpdir = path )
52
+ local_config(config_path , ' exclude: "test"' , filename = " config" )
53
+
54
+ withr :: with_envvar(c(R_USER_CONFIG_DIR = config_parent_path ), lintr ::: read_settings(file ))
55
+
56
+ lapply(setdiff(ls(settings ), " exclude" ), function (setting ) {
57
+ expect_identical(settings [[setting ]], default_settings [[setting ]])
58
+ })
59
+
60
+ expect_identical(settings $ exclude , " test" )
61
+ })
62
+
46
63
test_that(" it errors if the config file does not end in a newline" , {
47
64
f <- withr :: local_tempfile()
48
65
cat(" linters: linters_with_defaults(closed_curly_linter = NULL)" , file = f )
You can’t perform that action at this time.
0 commit comments