[testing] Add HasTestingDirectory subdir factory #4774
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Su
2BCF
ggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a new member function to
HasTestingDirectory
calledwithSubdirectory
. This is a factory of newHasTestingDirectory
objects which will return directories nested under the original.This is intended to fit a very specific use case where a user is passing command line arguments through Scalatest's ConfigMap API (i.e.,
-D<key>=<value>
) and they want to use the information in the ConfigMap to affect the directory structure. Because the ConfigMap is only availalbe inside the test, it cannot be used to set the test name. If a user is not passing arguments via the ConfigMap, then a user can instead structure the ScalaTest scopes in such a way to get the directory structure they want.Release Notes
Add
withSubdirectory
factory toHasTestingDirectory
type class. This can be used to create newHasTestingDirectory
objects with directories under the original. This can be used to affect the directory inside a Scalatest test if the information a user has is only available inside the test (e.g., Scalatest's ConfigMap).