File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -59,19 +59,19 @@ test_that("ggsave can handle blank background", {
5959})
6060
6161test_that(" ggsave warns about empty or multiple filenames" , {
62- filenames <- c(" plot1.png" , " plot2.png" )
6362 plot <- ggplot(mtcars , aes(disp , mpg )) + geom_point()
6463
65- withr :: with_file( filenames , {
64+ withr :: with_tempfile(c( " file1 " , " file2 " ), fileext = " .png " , {
6665 expect_warning(
67- suppressMessages(ggsave(filenames , plot )),
66+ suppressMessages(ggsave(c( file1 , file2 ) , plot )),
6867 " `filename` must have length 1"
6968 )
70- expect_error(
71- ggsave(character (), plot ),
72- " `filename` cannot be empty."
73- )
7469 })
70+
71+ expect_error(
72+ ggsave(character (), plot ),
73+ " `filename` cannot be empty."
74+ )
7575})
7676
7777# plot_dim ---------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments