diff --git a/tests/testthat/_snaps/use_lintr.md b/tests/testthat/_snaps/use_lintr.md new file mode 100644 index 000000000..986f7c96b --- /dev/null +++ b/tests/testthat/_snaps/use_lintr.md @@ -0,0 +1,9 @@ +# use_lintr add .lintr to .Rbuildignore for packages + + Code + cat(brio::read_file(file.path(tmp_package_dir, ".Rbuildignore"))) + Output + ^lintr\.Rproj$ + ^\.Rproj\.user$ + ^\.lintr$ + diff --git a/tests/testthat/test-use_lintr.R b/tests/testthat/test-use_lintr.R index db4eb7b60..a93227c0d 100644 --- a/tests/testthat/test-use_lintr.R +++ b/tests/testthat/test-use_lintr.R @@ -45,5 +45,5 @@ test_that("use_lintr add .lintr to .Rbuildignore for packages", { setwd(tmp_package_dir) lintr_file <- use_lintr() expect_true(file.exists(lintr_file)) - expect_true("^\\.lintr$" %in% readLines(".Rbuildignore")) + expect_snapshot(cat(brio::read_file(file.path(tmp_package_dir, ".Rbuildignore")))) })