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", {
59
59
})
60
60
61
61
test_that(" ggsave warns about empty or multiple filenames" , {
62
- filenames <- c(" plot1.png" , " plot2.png" )
63
62
plot <- ggplot(mtcars , aes(disp , mpg )) + geom_point()
64
63
65
- withr :: with_file( filenames , {
64
+ withr :: with_tempfile(c( " file1 " , " file2 " ), fileext = " .png " , {
66
65
expect_warning(
67
- suppressMessages(ggsave(filenames , plot )),
66
+ suppressMessages(ggsave(c( file1 , file2 ) , plot )),
68
67
" `filename` must have length 1"
69
68
)
70
- expect_error(
71
- ggsave(character (), plot ),
72
- " `filename` cannot be empty."
73
- )
74
69
})
70
+
71
+ expect_error(
72
+ ggsave(character (), plot ),
73
+ " `filename` cannot be empty."
74
+ )
75
75
})
76
76
77
77
# plot_dim ---------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments