Currently, DirEquals/TarGzEquals checkers are only able to check whether directory structure and file content is EXACTLY the same as expected. This brings a problem when we can't tell EXACLTY what the content will be, e.g. because Capstan prepends --env prefix to bootcommands in random order.
With this commit we extend DirEquals/TarGzEquals so that it now accepts map of expectations that can either contain expected string (EXACT match) or lambda function (more extensible match).
To reuse same logic for DirEquals and TarGzEquals checkers we quickly recaftor the code by introducing loadDir() and loadTarGz() auxilary functions.
Currently, DirEquals/TarGzEquals checkers are only able to check whether directory structure and file content is EXACTLY the same as expected. This brings a problem when we can't tell EXACLTY what the content will be, e.g. because Capstan prepends --env prefix to bootcommands in random order.
With this commit we extend DirEquals/TarGzEquals so that it now accepts map of expectations that can either contain expected string (EXACT match) or lambda function (more extensible match).
To reuse same logic for DirEquals and TarGzEquals checkers we quickly recaftor the code by introducing loadDir() and loadTarGz() auxilary functions.
This PR depends on https://github.com/mikelangelo-project/capstan/pull/40 to be merged.