Fix mix task to pass pretty
flag to custom codecs, add tests
#676
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.
Suggestions 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.
This fixes an issue preventing the
pretty
flag from being passed to custom codecs. It also adds tests to ensure that CLI options are parsed correctly, appropriate defaults are used, and custom codecs are called successfully.Note that in order to make the tests perform an actual conversion to JSON, we would have to add Jason or Poison as a test-mode dependency. I opted against this because if we can ensure that the codec is accessed correctly, the risk of Poison's or Jason's
encode/2
method failing should be low.However, if we don't add Jason or Poison as production-mode dependencies, we may want .to update the README to indicate that the application must load the the codec module in order for the mix task to work, even if using the default Jason encoder.