-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Labels
area/documentationImprovements or additions to documentation.Improvements or additions to documentation.kind/enhancementImprovements to existing feature.Improvements to existing feature.
Description
When implementing an external provider package (e.g., TOMLProvider, it's unclear how to implement a compatibility suite on par with the ones for built-in JSON and YAML providers.
Specifically, for the compat() test, both JSONFileProviderTests and YAMLFileProviderTests declare configurations with string literals and use InMemoryFileSystem and pass that to ProviderCompatTest. However, InMemoryFileSystem lives in ConfigurationTestingInternal and is not exposed publicly.
I found a different solution, loading a file from the package resource bundle, but that wasn't obvious.
private let resourcesPath = FilePath(try! #require(Bundle.module.path(forResource: "Resources", ofType: nil)))
let tomlConfigFile = resourcesPath.appending("config.toml")It'd be great to document this pattern in swift-configuration docs.
czechboy0
Metadata
Metadata
Assignees
Labels
area/documentationImprovements or additions to documentation.Improvements or additions to documentation.kind/enhancementImprovements to existing feature.Improvements to existing feature.