Description
I have added the following configuration to specify my source directory to use the source of the pre-compiled class but the approve.txt
and receive.txt
files are saved in the compile location (something like user/.cache/...
). Is there a separate configuration to specify the output source?
I have tried the Package settings method but this doesn't change the source, only the path:
public class PackageSettings { public static String ApprovalBaseDirectory = "../resources"; }
My configuration to specify path (with test):
` @test
public void testPresentAvailabilityItems() {
List items =
presenter.presentAvailabilityItems(
PriceAvailabilityDataPresenter.CONTENT_ITEM_TYPES_IN_ORDER, false, false, true);
// begin-snippet: define_alternative_source_directory_finder
Function2<Class, String, File> myFinder = new Function2<Class, String, File>()
{
@Override
public File call(Class clazz, String fileName)
{
System.out.println("source: "+ clazz.getPackage().getName().replaceAll("\\.", "/"));
return new File("src/test/java/" + clazz.getPackage().getName().replaceAll("\\.", "/"));
}
};
// end-snippet
// begin-snippet: configure_alternative_source_directory
try (SourceDirectoryRestorer sdr = registerSourceDirectoryFinder(myFinder))
{
Approvals.verify("Ragunath");
}`
If there's a configuration to specify the location of the test result files, please point me in the right direction. I'm using version 24.