@Test
void overrideDestination() throws Exception
{
String toArgument = JRE.JAVA_11.isCurrentVersion() ? "--to=" + System.getProperty( "user.dir" ) + "/other/" : "--to=other/";
String[] args = {toArgument, "all"};
try ( RealOutsideWorld outsideWorld = new RealOutsideWorld() )
{
DiagnosticsReportCommand
diagnosticsReportCommand = new DiagnosticsReportCommand( homeDir, configDir, outsideWorld );
diagnosticsReportCommand.execute( args );
File other = testDirectory.directory( "other" );
FileSystemAbstraction fs = outsideWorld.fileSystem();
assertThat( fs.fileExists( other ), is( true ) );
assertThat( fs.listFiles( other ).length, is( 1 ) );
File reports = new File( testDirectory.directory(), "reports" );
assertThat( fs.fileExists( reports ), is( false ) );
}
}