Skip to content

Commit 9cf0288

Browse files
remove redundant encoding argument
1 parent 730c7b6 commit 9cf0288

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

R/testing-public-api.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#' how many characters the path of the temporary directory has.
1818
#' @importFrom utils capture.output
1919
#' @keywords internal
20-
catch_style_file_output <- function(file_in, encoding) {
20+
catch_style_file_output <- function(file_in) {
2121
file_in <- testthat_file(file_in)
2222
temp_path <- copy_to_tempdir(file_in)
2323
raw_output <- withr::with_dir(

man/catch_style_file_output.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-public_api.R

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ test_that("messages (via cat()) of style_file are correct", {
157157
"public-api",
158158
"xyzdir-dirty",
159159
"dirty-sample-with-scope-tokens.R"
160-
), encoding = encoding)
160+
))
161161
expect_known_value(
162162
output,
163163
testthat_file(paste0(
@@ -170,7 +170,7 @@ test_that("messages (via cat()) of style_file are correct", {
170170
# No message if scope > line_breaks and code does not change
171171
output <- catch_style_file_output(file.path(
172172
"public-api", "xyzdir-dirty", "clean-sample-with-scope-tokens.R"
173-
), encoding = encoding)
173+
))
174174
expect_known_value(
175175
output,
176176
testthat_file(paste0(
@@ -183,7 +183,7 @@ test_that("messages (via cat()) of style_file are correct", {
183183
# No message if scope <= line_breaks even if code is changed.
184184
output <- catch_style_file_output(file.path(
185185
"public-api", "xyzdir-dirty", "dirty-sample-with-scope-spaces.R"
186-
), encoding = encoding)
186+
))
187187
expect_known_value(
188188
output,
189189
testthat_file(paste0(
@@ -198,17 +198,15 @@ test_that("messages (via cat()) of style_file are correct", {
198198
})
199199

200200
test_that("Messages can be suppressed", {
201-
for (encoding in ls_testable_encodings()) {
202201
withr::with_options(
203-
list(cli.unicode = encoding == "utf8", styler.quiet = TRUE),
202+
list(styler.quiet = TRUE),
204203
{
205204
output <- catch_style_file_output(file.path(
206205
"public-api", "xyzdir-dirty", "dirty-sample-with-scope-spaces.R"
207-
), encoding = encoding)
206+
))
208207
expect_equal(output, character(0))
209208
}
210209
)
211-
}
212210
})
213211

214212
context("public API - Rmd in style_dir()")

0 commit comments

Comments
 (0)