Skip to content

Commit

Permalink
. d updated markdown snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Feb 3, 2025
1 parent 8ad1652 commit 35fe4a1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions approvaltests/docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ Function2<Class, String, File> myFinder = new Function2<Class, String, File>()
@Override
public File call(Class clazz, String fileName)
{
return new File("src/test/java/" + clazz.getPackage().getName().replaceAll("\\.", "/"));
return new File(ClassUtils.getProjectRootPath() + "/src/test/java/"
+ clazz.getPackage().getName().replaceAll("\\.", "/"));
}
};
```
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/namer/NamerSamplesTest.java#L16-L25' title='Snippet source file'>snippet source</a> | <a href='#snippet-define_alternative_source_directory_finder' title='Start of snippet'>anchor</a></sup>
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/namer/NamerSamplesTest.java#L17-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-define_alternative_source_directory_finder' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
### Using alternatives
Thanks to the try block, the default is restored afterwards allowing tests to be independent.
Expand All @@ -169,7 +170,7 @@ try (SourceDirectoryRestorer sdr = TestUtils.registerSourceDirectoryFinder(myFin
Approvals.verify("Ragunath");
}
```
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/namer/NamerSamplesTest.java#L26-L31' title='Snippet source file'>snippet source</a> | <a href='#snippet-configure_alternative_source_directory' title='Start of snippet'>anchor</a></sup>
<sup><a href='/approvaltests-tests/src/test/java/org/approvaltests/namer/NamerSamplesTest.java#L28-L33' title='Snippet source file'>snippet source</a> | <a href='#snippet-configure_alternative_source_directory' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

---
Expand Down

0 comments on commit 35fe4a1

Please sign in to comment.