Another idea: refactor the configuration/parse.go -> loadConfigFromFile() and loadIQConfigFromFile() methods to take io.Reader - instead of a path configLocation. The tests could then easily pass in bytes representing the various file contents. This would also allow the test avoid pesky disk access.
And in the other direction, similarly use io.Writer instead of ConfigLocation inside configuration/set.go -> marshallAndWriteToDisk.
We've been sneaking up on changing the design of the OSSI / IQ config classes to support better reuse/reduced duplication/DRYness.
This Issue exists to track that, and collect ideas on how to git 'er done.
see: loadConfigFromFile(configLocation string, config *Configuration)
see: https://github.com/sonatype-nexus-community/nancy/pull/108/files
Another idea: refactor the
configuration/parse.go -> loadConfigFromFile()
andloadIQConfigFromFile()
methods to takeio.Reader
- instead of a pathconfigLocation
. The tests could then easily pass in bytes representing the various file contents. This would also allow the test avoid pesky disk access.And in the other direction, similarly use
io.Writer
instead ofConfigLocation
insideconfiguration/set.go -> marshallAndWriteToDisk
.cc @bhamail / @DarthHater