File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ test_that("ggsave can create directories", {
1616
1717  p  <-  ggplot(mpg , aes(displ , hwy )) +  geom_point()
1818
19-   expect_snapshot(ggsave(path , p ), error  =  TRUE )
19+   expect_snapshot(
20+     ggsave(path , p ), error  =  TRUE ,
21+     transform  =  function (x ) gsub(" directory '.*'\\ .$"  , " directory 'PATH'"  , x )
22+   )
2023  expect_false(dir.exists(dirname(path )))
2124
2225  #  2 messages: 1 for saving and 1 informing about directory creation
@@ -88,7 +91,10 @@ test_that("ggsave warns about empty or multiple filenames", {
8891
8992test_that(" ggsave fails informatively for no-extension filenames"  , {
9093  plot  <-  ggplot(mtcars , aes(disp , mpg )) +  geom_point()
91-   expect_snapshot(ggsave(tempfile(), plot ), error  =  TRUE )
94+   expect_snapshot(
95+     ggsave(tempfile(), plot ), error  =  TRUE ,
96+     transform  =  function (x ) gsub(" to .*\\ .$"  , " to PATH"  , x )
97+   )
9298})
9399
94100#  plot_dim ---------------------------------------------------------------
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments